Permalink
Browse files

Merge and join Rails plugin

  • Loading branch information...
tinogomes committed Aug 21, 2013
2 parents 9fbc06c + 434f3bc commit f7a2486fbd6cda238c78d5f91311d30f9eda1d58
Showing with 1,758 additions and 182 deletions.
  1. +2 −0 README.textile
  2. +14 −14 lib/git.zsh
  3. +3 −1 lib/termsupport.zsh
  4. +72 −29 plugins/bower/bower.plugin.zsh
  5. +1 −1 plugins/bundler/bundler.plugin.zsh
  6. +36 −0 plugins/cabal/cabal.plugin.zsh
  7. +1 −1 plugins/capistrano/_capistrano
  8. +129 −0 plugins/celery/_celery
  9. +13 −3 plugins/coffee/_coffee
  10. +17 −1 plugins/composer/composer.plugin.zsh
  11. +2 −2 plugins/debian/debian.plugin.zsh
  12. +19 −0 plugins/docker/README.md
  13. +290 −0 plugins/docker/_docker
  14. +5 −3 plugins/gem/_gem
  15. +4 −0 plugins/git/README.md
  16. +83 −0 plugins/git/_git-branch
  17. +74 −0 plugins/git/_git-remote
  18. +18 −0 plugins/git/git.plugin.zsh
  19. +17 −9 plugins/gpg-agent/gpg-agent.plugin.zsh
  20. +2 −2 plugins/jira/jira.plugin.zsh
  21. +18 −0 plugins/knife_ssh/knife_ssh.plugin.zsh
  22. +46 −1 plugins/mercurial/mercurial.plugin.zsh
  23. +63 −0 plugins/mix/_mix
  24. +2 −2 plugins/osx/osx.plugin.zsh
  25. +381 −0 plugins/pod/_pod
  26. +6 −0 plugins/postgres/postgres.plugin.zsh
  27. +56 −0 plugins/rails/_rails
  28. +37 −16 plugins/rails/rails.plugin.zsh
  29. +0 −35 plugins/rails3/rails3.plugin.zsh
  30. +0 −30 plugins/rails4/rails4.plugin.zsh
  31. +17 −0 plugins/rand-quote/rand-quote.plugin.zsh
  32. +7 −0 plugins/repo/README.md
  33. +272 −0 plugins/repo/_repo
  34. +2 −0 plugins/repo/repo.plugin.zsh
  35. +3 −4 plugins/rvm/rvm.plugin.zsh
  36. +1 −1 plugins/ssh-agent/ssh-agent.plugin.zsh
  37. +1 −1 plugins/symfony/symfony.plugin.zsh
  38. +5 −3 plugins/tmux/tmux.plugin.zsh
  39. +3 −4 plugins/virtualenv/virtualenv.plugin.zsh
  40. +15 −10 plugins/virtualenvwrapper/virtualenvwrapper.plugin.zsh
  41. +13 −4 themes/agnoster.zsh-theme
  42. +2 −0 themes/rkj-repos.zsh-theme
  43. +2 −1 themes/rkj.zsh-theme
  44. +3 −3 themes/superjarin.zsh-theme
  45. +1 −1 tools/upgrade.sh
View
@@ -72,6 +72,8 @@ To disable updates entirely, put this in your ~/.zshrc
@DISABLE_AUTO_UPDATE=true@
+To upgrade directly from the command line, just run @upgrade_oh_my_zsh@
+
h3. Uninstalling
If you want to uninstall it, just run @uninstall_oh_my_zsh@ from the command line and it'll remove itself and revert you to bash (or your previous zsh config).
View
@@ -1,7 +1,7 @@
# get the name of the branch we are on
function git_prompt_info() {
- ref=$(git symbolic-ref HEAD 2> /dev/null) || \
- ref=$(git rev-parse --short HEAD 2> /dev/null) || return
+ ref=$(command git symbolic-ref HEAD 2> /dev/null) || \
+ ref=$(command git rev-parse --short HEAD 2> /dev/null) || return
echo "$ZSH_THEME_GIT_PROMPT_PREFIX${ref#refs/heads/}$(parse_git_dirty)$ZSH_THEME_GIT_PROMPT_SUFFIX"
}
@@ -11,14 +11,14 @@ parse_git_dirty() {
local SUBMODULE_SYNTAX=''
local GIT_STATUS=''
local CLEAN_MESSAGE='nothing to commit (working directory clean)'
- if [[ "$(git config --get oh-my-zsh.hide-status)" != "1" ]]; then
+ if [[ "$(command git config --get oh-my-zsh.hide-status)" != "1" ]]; then
if [[ $POST_1_7_2_GIT -gt 0 ]]; then
SUBMODULE_SYNTAX="--ignore-submodules=dirty"
fi
if [[ "$DISABLE_UNTRACKED_FILES_DIRTY" == "true" ]]; then
- GIT_STATUS=$(git status -s ${SUBMODULE_SYNTAX} -uno 2> /dev/null | tail -n1)
+ GIT_STATUS=$(command git status -s ${SUBMODULE_SYNTAX} -uno 2> /dev/null | tail -n1)
else
- GIT_STATUS=$(git status -s ${SUBMODULE_SYNTAX} 2> /dev/null | tail -n1)
+ GIT_STATUS=$(command git status -s ${SUBMODULE_SYNTAX} 2> /dev/null | tail -n1)
fi
if [[ -n $GIT_STATUS ]]; then
echo "$ZSH_THEME_GIT_PROMPT_DIRTY"
@@ -32,10 +32,10 @@ parse_git_dirty() {
# get the difference between the local and remote branches
git_remote_status() {
- remote=${$(git rev-parse --verify ${hook_com[branch]}@{upstream} --symbolic-full-name 2>/dev/null)/refs\/remotes\/}
+ remote=${$(command git rev-parse --verify ${hook_com[branch]}@{upstream} --symbolic-full-name 2>/dev/null)/refs\/remotes\/}
if [[ -n ${remote} ]] ; then
- ahead=$(git rev-list ${hook_com[branch]}@{upstream}..HEAD 2>/dev/null | wc -l)
- behind=$(git rev-list HEAD..${hook_com[branch]}@{upstream} 2>/dev/null | wc -l)
+ ahead=$(command git rev-list ${hook_com[branch]}@{upstream}..HEAD 2>/dev/null | wc -l)
+ behind=$(command git rev-list HEAD..${hook_com[branch]}@{upstream} 2>/dev/null | wc -l)
if [ $ahead -eq 0 ] && [ $behind -gt 0 ]
then
@@ -52,24 +52,24 @@ git_remote_status() {
# Checks if there are commits ahead from remote
function git_prompt_ahead() {
- if $(echo "$(git log origin/$(current_branch)..HEAD 2> /dev/null)" | grep '^commit' &> /dev/null); then
+ if $(echo "$(command git log origin/$(current_branch)..HEAD 2> /dev/null)" | grep '^commit' &> /dev/null); then
echo "$ZSH_THEME_GIT_PROMPT_AHEAD"
fi
}
# Formats prompt string for current git commit short SHA
function git_prompt_short_sha() {
- SHA=$(git rev-parse --short HEAD 2> /dev/null) && echo "$ZSH_THEME_GIT_PROMPT_SHA_BEFORE$SHA$ZSH_THEME_GIT_PROMPT_SHA_AFTER"
+ SHA=$(command git rev-parse --short HEAD 2> /dev/null) && echo "$ZSH_THEME_GIT_PROMPT_SHA_BEFORE$SHA$ZSH_THEME_GIT_PROMPT_SHA_AFTER"
}
# Formats prompt string for current git commit long SHA
function git_prompt_long_sha() {
- SHA=$(git rev-parse HEAD 2> /dev/null) && echo "$ZSH_THEME_GIT_PROMPT_SHA_BEFORE$SHA$ZSH_THEME_GIT_PROMPT_SHA_AFTER"
+ SHA=$(command git rev-parse HEAD 2> /dev/null) && echo "$ZSH_THEME_GIT_PROMPT_SHA_BEFORE$SHA$ZSH_THEME_GIT_PROMPT_SHA_AFTER"
}
# Get the status of the working tree
git_prompt_status() {
- INDEX=$(git status --porcelain -b 2> /dev/null)
+ INDEX=$(command git status --porcelain -b 2> /dev/null)
STATUS=""
if $(echo "$INDEX" | grep -E '^\?\? ' &> /dev/null); then
STATUS="$ZSH_THEME_GIT_PROMPT_UNTRACKED$STATUS"
@@ -96,7 +96,7 @@ git_prompt_status() {
elif $(echo "$INDEX" | grep '^AD ' &> /dev/null); then
STATUS="$ZSH_THEME_GIT_PROMPT_DELETED$STATUS"
fi
- if $(git rev-parse --verify refs/stash >/dev/null 2>&1); then
+ if $(command git rev-parse --verify refs/stash >/dev/null 2>&1); then
STATUS="$ZSH_THEME_GIT_PROMPT_STASHED$STATUS"
fi
if $(echo "$INDEX" | grep '^UU ' &> /dev/null); then
@@ -121,7 +121,7 @@ function git_compare_version() {
local INPUT_GIT_VERSION=$1;
local INSTALLED_GIT_VERSION
INPUT_GIT_VERSION=(${(s/./)INPUT_GIT_VERSION});
- INSTALLED_GIT_VERSION=($(git --version 2>/dev/null));
+ INSTALLED_GIT_VERSION=($(command git --version 2>/dev/null));
INSTALLED_GIT_VERSION=(${(s/./)INSTALLED_GIT_VERSION[3]});
for i in {1..3}; do
View
@@ -27,7 +27,9 @@ function omz_termsupport_preexec {
emulate -L zsh
setopt extended_glob
local CMD=${1[(wr)^(*=*|sudo|ssh|rake|-*)]} #cmd name only, or if this is sudo or ssh, the next cmd
- title "$CMD" "%100>...>${2:gs/%/%%}%<<"
+ local LINE="${2:gs/$/\\$}"
+ LINE="${LINE:gs/%/%%}"
+ title "$CMD" "%100>...>$LINE%<<"
}
autoload -U add-zsh-hook
@@ -2,37 +2,80 @@ alias bi="bower install"
alias bl="bower list"
alias bs="bower search"
-bower_package_list=''
-
+_bower_installed_packages () {
+ bower_package_list=$(bower ls --no-color 2>/dev/null| awk 'NR>3{print p}{p=$0}'| cut -d ' ' -f 2|sed 's/#.*//')
+}
_bower ()
{
- local curcontext="$curcontext" state line
- typeset -A opt_args
-
- _arguments -C \
- ':command:->command' \
- '*::options:->options'
-
- case $state in
- (command)
-
- local -a subcommands
- subcommands=(${=$(bower help | grep help | sed -e 's/,//g')})
- _describe -t commands 'bower' subcommands
- ;;
-
- (options)
- case $line[1] in
-
- (install)
- if [ -z "$bower_package_list" ];then
- bower_package_list=$(bower search | awk 'NR > 2' | cut -d '-' -f 2 | cut -d ' ' -f 2 | sed -r "s/\x1B\[([0-9]{1,2}(;[0-9]{1,2})?)?[m|K]//g")
- fi
- compadd "$@" $(echo $bower_package_list)
- ;;
- esac
- ;;
- esac
+ local -a _1st_arguments _no_color _dopts _save_dev _force_lastest _production
+ local expl
+ typeset -A opt_args
+
+ _no_color=('--no-color[Do not print colors (available in all commands)]')
+
+ _dopts=(
+ '(--save)--save[Save installed packages into the project"s bower.json dependencies]'
+ '(--force)--force[Force fetching remote resources even if a local copy exists on disk]'
+ )
+
+ _save_dev=('(--save-dev)--save-dev[Save installed packages into the project"s bower.json devDependencies]')
+
+ _force_lastest=('(--force-latest)--force-latest[Force latest version on conflict]')
+
+ _production=('(--production)--production[Do not install project devDependencies]')
+
+ _1st_arguments=(
+ 'cache-clean:Clean the Bower cache, or the specified package caches' \
+ 'help:Display help information about Bower' \
+ 'info:Version info and description of a particular package' \
+ 'init:Interactively create a bower.json file' \
+ 'install:Install a package locally' \
+ 'link:Symlink a package folder' \
+ 'lookup:Look up a package URL by name' \
+ 'register:Register a package' \
+ 'search:Search for a package by name' \
+ 'uninstall:Remove a package' \
+ 'update:Update a package' \
+ {ls,list}:'[List all installed packages]'
+ )
+ _arguments \
+ $_no_color \
+ '*:: :->subcmds' && return 0
+
+ if (( CURRENT == 1 )); then
+ _describe -t commands "bower subcommand" _1st_arguments
+ return
+ fi
+
+ case "$words[1]" in
+ install)
+ _arguments \
+ $_dopts \
+ $_save_dev \
+ $_force_lastest \
+ $_no_color \
+ $_production
+ ;;
+ update)
+ _arguments \
+ $_dopts \
+ $_no_color \
+ $_force_lastest
+ _bower_installed_packages
+ compadd "$@" $(echo $bower_package_list)
+ ;;
+ uninstall)
+ _arguments \
+ $_no_color \
+ $_dopts
+ _bower_installed_packages
+ compadd "$@" $(echo $bower_package_list)
+ ;;
+ *)
+ $_no_color \
+ ;;
+ esac
+
}
compdef _bower bower
@@ -7,7 +7,7 @@ alias bu="bundle update"
# The following is based on https://github.com/gma/bundler-exec
-bundled_commands=(annotate cap capify cucumber foreman guard jekyll middleman nanoc rackup rainbows rake rspec ruby shotgun spec spin spork thin thor unicorn unicorn_rails puma)
+bundled_commands=(annotate berks cap capify cucumber foodcritic foreman guard jekyll kitchen knife middleman nanoc rackup rainbows rake rspec ruby shotgun spec spin spork strainer tailor thin thor unicorn unicorn_rails puma)
## Functions
@@ -0,0 +1,36 @@
+function _cabal_commands() {
+ local ret=1 state
+ _arguments ':subcommand:->subcommand' && ret=0
+
+ case $state in
+ subcommand)
+ subcommands=(
+ "bench:Run the benchmark, if any (configure with UserHooks)"
+ "build:Make this package ready for installation"
+ "check:Check the package for common mistakes"
+ "clean:Clean up after a build"
+ "copy:Copy teh files into the install locations"
+ "configure:Prepare to build the package"
+ "fetch:Downloads packages for later installation"
+ "haddock:Generate HAddock HTML documentation"
+ "help:Help about commands"
+ "hscolour:Generate HsColour colourised code, in HTML format"
+ "info:Display detailed information about a particular package"
+ "init:Interactively create a .cabal file"
+ "install:Installs a list of packages"
+ "list:List packages matching a search string"
+ "register:Register this package with the compiler"
+ "report:Upload build reports to a remote server"
+ "sdist:Generate a source distribution file (.tar.gz)"
+ "test:Run the test suite, if any (configure with UserHooks)"
+ "unpack:Unpacks packages for user inspection"
+ "update:Updates list of known packages"
+ "upload:Uploads source packages to Hackage"
+ )
+ _describe -t subcommands 'cabal subcommands' subcommands && ret=0
+ esac
+
+ return ret
+}
+
+compdef _cabal_commands cabal
@@ -4,7 +4,7 @@
if [[ -f config/deploy.rb || -f Capfile ]]; then
if [[ ! -f .cap_tasks~ || config/deploy.rb -nt .cap_tasks~ ]]; then
echo "\nGenerating .cap_tasks~..." > /dev/stderr
- cap --tasks | grep '#' | cut -d " " -f 2 > .cap_tasks~
+ cap -v --tasks | grep '#' | cut -d " " -f 2 > .cap_tasks~
fi
compadd `cat .cap_tasks~`
fi
Oops, something went wrong.

0 comments on commit f7a2486

Please sign in to comment.