Browse code

merge bundler and bundle-exec plugins

Hakan Ensari authored on 13/07/2011 at 21:41:09
Showing 2 changed files
1 1
deleted file mode 100644
... ...
@@ -1,34 +0,0 @@
1
-# This plugin is based on https://github.com/gma/bundler-exec
2
-# modify the bundled_commands if needed
3
-
4
-bundled_commands=(cap capify cucumber heroku rackup rails rake rspec ruby shotgun spec spork thin unicorn unicorn_rails)
5
-
6
-## Functions
7
-
8
-_bundler-installed() {
9
-  which bundle > /dev/null 2>&1
10
-}
11
-
12
-_within-bundled-project() {
13
-  local check_dir=$PWD
14
-  while [ "$(dirname $check_dir)" != "/" ]; do
15
-    [ -f "$check_dir/Gemfile" ] && return
16
-    check_dir="$(dirname $check_dir)"
17
-  done
18
-  false
19
-}
20
-
21
-_run-with-bundler() {
22
-  local command="$1"
23
-  shift
24
-  if _bundler-installed && _within-bundled-project; then
25
-    bundle exec $command "$@"
26
-  else
27
-    $command "$@"
28
-  fi
29
-}
30
-
31
-## Main program
32
-for cmd in $bundled_commands; do
33
-  alias $cmd="_run-with-bundler $cmd"
34
-done
... ...
@@ -1,3 +1,37 @@
1 1
 alias be="bundle exec"
2 2
 alias bi="bundle install"
3 3
 alias bu="bundle update"
4
+
5
+# The following is based on https://github.com/gma/bundler-exec
6
+
7
+bundled_commands=(cap capify cucumber heroku rackup rails rake rspec ruby shotgun spec spork thin unicorn unicorn_rails)
8
+
9
+## Functions
10
+
11
+_bundler-installed() {
12
+  which bundle > /dev/null 2>&1
13
+}
14
+
15
+_within-bundled-project() {
16
+  local check_dir=$PWD
17
+  while [ "$(dirname $check_dir)" != "/" ]; do
18
+    [ -f "$check_dir/Gemfile" ] && return
19
+    check_dir="$(dirname $check_dir)"
20
+  done
21
+  false
22
+}
23
+
24
+_run-with-bundler() {
25
+  local command="$1"
26
+  shift
27
+  if _bundler-installed && _within-bundled-project; then
28
+    bundle exec $command "$@"
29
+  else
30
+    $command "$@"
31
+  fi
32
+}
33
+
34
+## Main program
35
+for cmd in $bundled_commands; do
36
+  alias $cmd="_run-with-bundler $cmd"
37
+done