From 0283d426bf3d9b343ea3536d04dc64805703fd52 Mon Sep 17 00:00:00 2001 From: Pablo Cantero Date: Sat, 19 Apr 2014 13:33:49 -0300 Subject: [PATCH] Adds bundler `bump` completion --- plugins/bundler_bump/_bundler_bump | 26 ++++++++++++++++++++ plugins/bundler_bump/bundler_bump.plugin.zsh | 3 +++ 2 files changed, 29 insertions(+) create mode 100644 plugins/bundler_bump/_bundler_bump create mode 100644 plugins/bundler_bump/bundler_bump.plugin.zsh diff --git a/plugins/bundler_bump/_bundler_bump b/plugins/bundler_bump/_bundler_bump new file mode 100644 index 00000000..b3aa98b0 --- /dev/null +++ b/plugins/bundler_bump/_bundler_bump @@ -0,0 +1,26 @@ +#compdef bump +#autoload + +local curcontext="$curcontext" state line ret=1 +local -a _configs + +_arguments -C \ + '1: :->cmds' + +_bundle_gems() { + if [ -f Gemfile ]; then + OLD_IFS=$IFS + IFS=$'\n' + _values 'available gems' $(awk '/gem / {print $2}' Gemfile | sed 's/[^a-zA-Z0-9_-]//g') + IFS=$OLD_IFS + fi +} + +case $state in + cmds) + _bundle_gems + ret=0 + ;; +esac + +return ret diff --git a/plugins/bundler_bump/bundler_bump.plugin.zsh b/plugins/bundler_bump/bundler_bump.plugin.zsh new file mode 100644 index 00000000..42643a43 --- /dev/null +++ b/plugins/bundler_bump/bundler_bump.plugin.zsh @@ -0,0 +1,3 @@ +func bump() { + bundle update --source $* +}