From 65eefd32256237be36bfc6cf1689e7a1fbc93fa3 Mon Sep 17 00:00:00 2001 From: Zhao Cai Date: Tue, 21 Aug 2012 04:05:07 -0400 Subject: [PATCH 1/5] update git-flow finish argument -K --- src/_git-flow | 1 + 1 file changed, 1 insertion(+) diff --git a/src/_git-flow b/src/_git-flow index f3f4f24..b8a4740 100644 --- a/src/_git-flow +++ b/src/_git-flow @@ -216,6 +216,7 @@ __git-flow-feature () _arguments \ -F'[Fetch from origin before performing finish]' \ -r'[Rebase instead of merge]'\ + -k'[Keep branch after performing finish]'\ ':feature:__git_flow_feature_list' ;; From 6c7e9527d645852f58b34727a21e60adb225cc94 Mon Sep 17 00:00:00 2001 From: Zhao Cai Date: Sun, 21 Oct 2012 00:55:19 -0400 Subject: [PATCH 2/5] gem edit (http://gemedit.rubyforge.org) --- src/_gem | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/_gem b/src/_gem index 3f8f7c2..851c83f 100644 --- a/src/_gem +++ b/src/_gem @@ -40,6 +40,7 @@ _gem() { "cleanup[Clean up old versions of installed gems in the local repository]" \ "contents[Display the contents of the installed gems]" \ "dependency[Show the dependencies of an installed gem]" \ + "edit[Edit installed gem in editor]" \ "environment[Display information about the RubyGems environment]" \ "fetch[Download a gem and place it in the current directory]" \ "generate_index[Generates the index files for a gem server directory]" \ @@ -179,6 +180,13 @@ _gem_dependency() { "(-p --pipe)"{-p,--pipe}"[Pipe Format (name --version ver)]" \ $gem_general_flags && ret=0 } +_gem_edit() { + _arguments \ + "*:gemname:__all_gems" \ + "(-e --editor)"{-e,--editor}"[GEMEDITOR, BUNDLER_EDITOR, VISUAL and EDITOR environment variables are used to by default]" \ + "(-d --dryrun)"{-d,--dryrun}"[Shows what command would be run without running it]" \ + $gem_general_flags && ret=0 +} _gem_environment() { typeset -g _environment_arg= From aaff6c94efa841cccebfd0acd22bf31ec16f08f9 Mon Sep 17 00:00:00 2001 From: Zhao Cai Date: Sun, 28 Oct 2012 20:35:44 -0400 Subject: [PATCH 3/5] check gem edit command availability --- src/_gem | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/_gem b/src/_gem index 851c83f..7446106 100644 --- a/src/_gem +++ b/src/_gem @@ -28,6 +28,11 @@ _gem() { $nul_arg ) + local gem_edit_command + + ruby -rgemedit -e 'true' >/dev/null 2>&1 && + gem_edit_command="edit[Edit installed gem in editor]" + if (( CURRENT > 2 )); then (( CURRENT-- )) shift words @@ -40,7 +45,7 @@ _gem() { "cleanup[Clean up old versions of installed gems in the local repository]" \ "contents[Display the contents of the installed gems]" \ "dependency[Show the dependencies of an installed gem]" \ - "edit[Edit installed gem in editor]" \ + ${gem_edit_command} \ "environment[Display information about the RubyGems environment]" \ "fetch[Download a gem and place it in the current directory]" \ "generate_index[Generates the index files for a gem server directory]" \ @@ -85,6 +90,7 @@ __gem_help_arguments() { "cleanup" "contents" "dependency" + $(_call_program commands "ruby -rgemedit -e 'print \"edit\"' 2>/dev/null") "environment" "fetch" "generate_index" From 6dd470b50f34ae6eb47a32be043a9594413d4e08 Mon Sep 17 00:00:00 2001 From: Zhao Cai Date: Fri, 9 Nov 2012 00:42:34 -0500 Subject: [PATCH 4/5] ! fix '_files -g' option for install and push + macgem --- src/_gem | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/_gem b/src/_gem index 7446106..d799b72 100644 --- a/src/_gem +++ b/src/_gem @@ -1,4 +1,4 @@ -#compdef gem gem1.9 +#compdef gem gem1.9 macgem # ------------------------------------------------------------------------------ # Description # ----------- @@ -237,7 +237,7 @@ _gem_help() { _gem_install() { _arguments \ - "*:URI: _alternative 'files:file:_files -g *.gem' 'urls:URL:__all_gems'" \ + "*:URI: _alternative 'files:file:_files -g \"*.gem\"' 'urls:URL:__all_gems'" \ "(-i --install-dir)"{-i,--install-dir}"[Gem repository directory to get installed gems]":directory:_directories \ "(-n --bindir)"{-n,--bindir}"[Directory where binary files are located]":directory:_directories \ "(-d --no-rdoc)"{-d,--no-rdoc}"[Generate RDoc documentation for the gem on install]" \ @@ -319,7 +319,7 @@ _gem_pristine() { _gem_push() { _arguments \ - "*:URI: _alternative 'files:file:_files -g *.gem'" \ + "*:URI: _alternative 'files:file:_files -g \"*.gem\"'" \ "(-k --key)"{-k,--key}"[Use the given API key from ~/.gem/credentials]" \ "--host[Push to another gemcutter-compatible host]" \ $gem_general_flags && ret=0 From b490d3d8bd3a8fe5dee377aa15441130290a6585 Mon Sep 17 00:00:00 2001 From: Zhao Cai Date: Mon, 12 Nov 2012 14:37:19 -0500 Subject: [PATCH 5/5] use gem instead of ruby to check 'edit' command availability --- src/_gem | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/_gem b/src/_gem index d799b72..f5f7fe6 100644 --- a/src/_gem +++ b/src/_gem @@ -30,7 +30,7 @@ _gem() { local gem_edit_command - ruby -rgemedit -e 'true' >/dev/null 2>&1 && + gem which gemedit >/dev/null 2>&1 && gem_edit_command="edit[Edit installed gem in editor]" if (( CURRENT > 2 )); then @@ -90,7 +90,7 @@ __gem_help_arguments() { "cleanup" "contents" "dependency" - $(_call_program commands "ruby -rgemedit -e 'print \"edit\"' 2>/dev/null") + $(_call_program commands "gem which gemedit >/dev/null 2>&1 && printf 'edit'") "environment" "fetch" "generate_index"