Permalink
Browse files

merge railsrc, sshrc into cmdrc, envrc

  • Loading branch information...
1 parent 0081864 commit 9e3b9aa63d3cd89431a1dc8f9b2dc3a8e477fac1 @quark-zju committed Apr 11, 2012
Showing with 38 additions and 36 deletions.
  1. +33 −0 .profile.d/cmdrc
  2. +5 −0 .profile.d/envrc
  3. +0 −32 .profile.d/railsrc
  4. +0 −4 .profile.d/sshrc
View
@@ -201,3 +201,36 @@ EOF
popd &>/dev/null
}
+# rails related
+rails() {
+ if [[ -e Gemfile ]]; then
+ bundle exec rails "$@"
+ else
+ command rails "$@"
+ fi
+}
+
+rake() {
+ if [[ -e Gemfile ]]; then
+ bundle exec rake "$@"
+ else
+ command rake "$@"
+ fi
+}
+
+thin() {
+ if [[ -e Gemfile ]]; then
+ bundle exec thin "$@"
+ else
+ command thin "$@"
+ fi
+}
+
+unicorn() {
+ if [[ -e Gemfile ]]; then
+ bundle exec unicorn "$@"
+ else
+ command unicorn "$@"
+ fi
+}
+
View
@@ -29,3 +29,8 @@ export WINEDEBUG=err-all,fixme-all,warn-all
# utils
export EDITOR=vim
+
+# dynamically set according to ssh_client
+if [ -n "$SSH_CLIENT" ]; then
+ export PULSE_SERVER=${SSH_CLIENT/ [ 0-9]*/}
+fi
View
@@ -1,32 +0,0 @@
-rails() {
- if [[ -e Gemfile ]]; then
- bundle exec rails "$@"
- else
- command rails "$@"
- fi
-}
-
-rake() {
- if [[ -e Gemfile ]]; then
- bundle exec rake "$@"
- else
- command rake "$@"
- fi
-}
-
-thin() {
- if [[ -e Gemfile ]]; then
- bundle exec thin "$@"
- else
- command thin "$@"
- fi
-}
-
-unicorn() {
- if [[ -e Gemfile ]]; then
- bundle exec unicorn "$@"
- else
- command unicorn "$@"
- fi
-}
-
View
@@ -1,4 +0,0 @@
-
-if [ -n "$SSH_CLIENT" ]; then
- export PULSE_SERVER=${SSH_CLIENT/ [ 0-9]*/}
-fi

0 comments on commit 9e3b9aa

Please sign in to comment.