55cc936d4e6d88f18518cedc9574b1df10702f8b

Author
Peter Tillemans <pti@snamellit.com>
Committer
Peter Tillemans <pti@snamellit.com>
Date

Message

Merge branch 'master' of https://github.com/robbyrussell/oh-my-zsh

Diff

  1diff --git a/lib/rvm.zsh b/lib/rvm.zsh
  2index 597be1b33b2076c267b202527909f6e896c099bd..cb870a9bbca96bfa1f3a1d795510daf1ef7c63b4 100644
  3--- a/lib/rvm.zsh
  4+++ b/lib/rvm.zsh
  5@@ -1,7 +1,5 @@
  6 # get the name of the branch we are on
  7 function rvm_prompt_info() {
  8   ruby_version=$(~/.rvm/bin/rvm-prompt 2> /dev/null) || return
  9-  echo "($ruby_version)"
 10+  [[ ! -z $ruby_version ]] && echo "($ruby_version)"
 11 }
 12-
 13-
 14diff --git a/plugins/cap/cap.plugin.zsh b/plugins/cap/cap.plugin.zsh
 15index 8336182d5d8692f609b04d0c9c9c385fc6de5367..d22d104017ecdddad5b670d1188140e6c39f2672 100644
 16--- a/plugins/cap/cap.plugin.zsh
 17+++ b/plugins/cap/cap.plugin.zsh
 18@@ -1,8 +1,30 @@
 19-function _cap_does_task_list_need_generating () {
 20-  if [ ! -f .cap_tasks~ ]; then return 0;
 21+stat -f%m . > /dev/null 2>&1
 22+if [ "$?" = 0 ]; then
 23+  stat_cmd=(stat -f%m)
 24+else
 25+  stat_cmd=(stat -L --format=%y)
 26+fi
 27+
 28+# Cache filename
 29+_cap_show_undescribed_tasks=0
 30+
 31+# Cache filename
 32+_cap_task_cache_file='.cap_task_cache'
 33+
 34+_cap_get_task_list () {
 35+  if [ ${_cap_show_undescribed_tasks} -eq 0 ]; then
 36+    cap -T | grep '^cap' | cut -d " " -f 2
 37+  else
 38+    cap -vT | grep '^cap' | cut -d " " -f 2
 39+  fi
 40+}
 41+
 42+_cap_does_task_list_need_generating () {
 43+
 44+  if [ ! -f ${_cap_task_cache_file} ]; then return 0;
 45   else
 46-    accurate=$(stat -f%m .cap_tasks~)
 47-    changed=$(stat -f%m config/deploy.rb)
 48+    accurate=$($stat_cmd $_cap_task_cache_file)
 49+    changed=$($stat_cmd config/deploy.rb)
 50     return $(expr $accurate '>=' $changed)
 51   fi
 52 }
 53@@ -10,12 +32,10 @@ function _cap_does_task_list_need_generating () {
 54 function _cap () {
 55   if [ -f config/deploy.rb ]; then
 56     if _cap_does_task_list_need_generating; then
 57-      echo "\nGenerating .cap_tasks~..." > /dev/stderr
 58-      cap show_tasks -q | cut -d " " -f 1 | sed -e '/^ *$/D' -e '1,2D'
 59-> .cap_tasks~
 60+      _cap_get_task_list > ${_cap_task_cache_file}
 61     fi
 62-    compadd `cat .cap_tasks~`
 63+    compadd `cat ${_cap_task_cache_file}`
 64   fi
 65 }
 66 
 67-compctl -K _cap cap
 68+compdef _cap cap
 69diff --git a/plugins/composer/composer.plugin.zsh b/plugins/composer/composer.plugin.zsh
 70new file mode 100644
 71index 0000000000000000000000000000000000000000..c9b762d072ab2a3a0c7df36f76f91c6bc624da6b
 72--- /dev/null
 73+++ b/plugins/composer/composer.plugin.zsh
 74@@ -0,0 +1,29 @@
 75+# ------------------------------------------------------------------------------
 76+#          FILE:  composer.plugin.zsh
 77+#   DESCRIPTION:  oh-my-zsh composer plugin file.
 78+#        AUTHOR:  Daniel Gomes (me@danielcsgomes.com)
 79+#       VERSION:  1.0.0
 80+# ------------------------------------------------------------------------------
 81+
 82+# Composer basic command completion
 83+_composer_get_command_list () {
 84+	composer --no-ansi | sed "1,/Available commands/d" | awk '/^  [a-z]+/ { print $1 }'
 85+}
 86+
 87+_composer () {
 88+  if [ -f composer.json ]; then
 89+    compadd `_composer_get_command_list`
 90+  fi
 91+}
 92+
 93+compdef _composer composer
 94+
 95+# Aliases
 96+alias c='composer'
 97+alias csu='composer self-update'
 98+alias cu='composer update'
 99+alias ci='composer install'
100+alias ccp='composer create-project'
101+
102+# install composer in the current directory
103+alias cget='curl -s https://getcomposer.org/installer | php'
104diff --git a/plugins/jira/jira.plugin.zsh b/plugins/jira/jira.plugin.zsh
105new file mode 100644
106index 0000000000000000000000000000000000000000..636e4619e37be6b64eea2ee1fed5d62bb0b8f98b
107--- /dev/null
108+++ b/plugins/jira/jira.plugin.zsh
109@@ -0,0 +1,22 @@
110+# To use: add a .jira-url file in the base of your project
111+# Setup: cd to/my/project
112+#        echo "https://name.jira.com" >> .jira-url
113+# Usage: jira           # opens a new issue
114+#        jira ABC-123   # Opens an existing issue
115+open_jira_issue () {
116+  if [ ! -f .jira-url ]; then
117+    echo "There is no .jira-url file in the current directory..."
118+    return 0;
119+  else
120+    jira_url=$(cat .jira-url);
121+    if [ -z "$1" ]; then
122+      echo "Opening new issue";
123+      `open $jira_url/secure/CreateIssue!default.jspa`;
124+    else
125+      echo "Opening issue #$1";
126+      `open $jira_url/issues/$1`;
127+    fi
128+  fi
129+}
130+
131+alias jira='open_jira_issue'
132diff --git a/plugins/nanoc/_nanoc b/plugins/nanoc/_nanoc
133new file mode 100644
134index 0000000000000000000000000000000000000000..fde07c3fccc5c8faae39916f8a7dd9e5edc43afe
135--- /dev/null
136+++ b/plugins/nanoc/_nanoc
137@@ -0,0 +1,44 @@
138+#compdef nanoc
139+#autoload
140+
141+# nanoc zsh completion - based on the homebrew zsh completion
142+# requires the 'nanoc' gem to be installed
143+
144+local -a _1st_arguments
145+_1st_arguments=(
146+  'autocompile:start the autocompiler'
147+  'compile:compile items of this site'
148+  'create-item:create an item'
149+  'create-layout:create a layout'
150+  'create-site:create a site'
151+  'deploy:deploy the compiled site'
152+  'help:show help'
153+  'prune:remove files not managed by nanoc from the output directory'
154+  'show-data:show data in this site'
155+  'show-plugins:show all available plugins'
156+  'show-rules:describe the rules for each item'
157+  'update:update the data stored by the data source to a newer version'
158+  'validate-css:validate the site’s CSS'
159+  'validate-html:validate the site’s HTML'
160+  'validate-links:validate links in site'
161+  'view:start the web server that serves static files'
162+  'watch:start the watcher'
163+)
164+
165+local expl
166+local -a pkgs installed_pkgs
167+
168+_arguments \
169+  '(--color)--color[enable color]' \
170+  '(--debug)--debug[enable debugging]' \
171+  '(--help)--help[show the help message and quit]' \
172+  '(--no-color)--no-color[disable color]' \
173+  '(--verbose)--verbose[make nanoc output more detailed]' \
174+  '(--version)--version[show version information and quit]' \
175+  '(--warn)--warn[enable warnings]' \
176+  '*:: :->subcmds' && return 0
177+
178+if (( CURRENT == 1 )); then
179+  _describe -t commands "nanoc subcommand" _1st_arguments
180+  return
181+fi
182diff --git a/plugins/nanoc/nanoc.plugin.zsh b/plugins/nanoc/nanoc.plugin.zsh
183new file mode 100644
184index 0000000000000000000000000000000000000000..5a5064613a999f01d98fea4ccc9f7a384e80460f
185--- /dev/null
186+++ b/plugins/nanoc/nanoc.plugin.zsh
187@@ -0,0 +1,9 @@
188+alias n='nanoc'
189+alias na='nanoc autocompile'
190+alias nco='nanoc compile'
191+alias nci='nanoc create_item'
192+alias ncl='nanoc create_layout'
193+alias ncs='nanoc create_site'
194+alias nd='nanoc deploy'
195+alias nv='nanoc view'
196+alias nw='nanoc watch'
197diff --git a/plugins/symfony2/symfony2.plugin.zsh b/plugins/symfony2/symfony2.plugin.zsh
198index 644266841fe11393c8b253da3479f52383f7dfdf..223401298df2bbdeaffe9bff6716608b051c0716 100644
199--- a/plugins/symfony2/symfony2.plugin.zsh
200+++ b/plugins/symfony2/symfony2.plugin.zsh
201@@ -10,4 +10,8 @@ _symfony2 () {
202   fi
203 }
204 
205-compdef _symfony2 app/console
206+compdef _symfony2 app/console
207+
208+#Alias
209+alias sf2='php app/console'
210+alias sf2clear='php app/console cache:clear'
211diff --git a/plugins/urltools/urltools.plugin.zsh b/plugins/urltools/urltools.plugin.zsh
212new file mode 100644
213index 0000000000000000000000000000000000000000..0d29314d6790700a681af8c0d6ffde94e5303b47
214--- /dev/null
215+++ b/plugins/urltools/urltools.plugin.zsh
216@@ -0,0 +1,9 @@
217+# URL Tools
218+# Adds handy command line aliases useful for dealing with URLs
219+#
220+# Taken from:
221+# http://ruslanspivak.com/2010/06/02/urlencode-and-urldecode-from-a-command-line/
222+
223+alias urlencode='python -c "import sys, urllib as ul; print ul.quote_plus(sys.argv[1])"'
224+
225+alias urldecode='python -c "import sys, urllib as ul; print ul.unquote_plus(sys.argv[1])"'
226diff --git a/plugins/zeus/README.md b/plugins/zeus/README.md
227new file mode 100644
228index 0000000000000000000000000000000000000000..4409943fe67fc9a8a6aea1d40060d45629312052
229--- /dev/null
230+++ b/plugins/zeus/README.md
231@@ -0,0 +1,41 @@
232+## zeus
233+**Maintainer:** [b4mboo](https://github.com/b4mboo)
234+
235+* `zi` aliases `zeus init`
236+* `zinit` aliases `zeus init`
237+
238+* `zs` aliases `zeus start`
239+* `ztart` aliases `zeus start`
240+
241+* `zc` aliases `zeus console`
242+* `zonsole` aliases `zeus console`
243+
244+* `zsr` aliases `zeus server`
245+* `zerver` aliases `zeus server`
246+
247+* `zr` aliases `zeus rake`
248+* `zake` aliases `zeus rake`
249+
250+* `zg` aliases `zeus generate`
251+* `zenerate` aliases `zeus generate`
252+
253+* `zrn` aliases `zeus runner`
254+* `zunner` aliases `zeus runner`
255+
256+* `zcu` aliases `zeus cucumber`
257+* `zucumber` aliases `zeus cucumber`
258+
259+* `zt` aliases `zeus test`
260+* `zest` aliases `zeus test`
261+
262+* `zu` aliases `zeus test test/unit/*`
263+* `zunits` aliases `zeus test test/unit/*`
264+
265+* `zf` aliases `zeus test test/functional/*`
266+* `zunctional` aliases `zeus test test/functional/*`
267+
268+* `za` aliases `zeus test test/unit/*; zeus test test/functional/; zeus cucumber`
269+* `zall` aliases `zeus test test/unit/*; zeus test test/functional/; zeus cucumber`
270+
271+* `zsw` aliases `rm .zeus.sock`
272+* `zweep` aliases `rm .zeus.sock`
273diff --git a/plugins/zeus/zeus.plugin.zsh b/plugins/zeus/zeus.plugin.zsh
274new file mode 100644
275index 0000000000000000000000000000000000000000..2fc7e1ebf06033182b0483d8c99c0189451f7c96
276--- /dev/null
277+++ b/plugins/zeus/zeus.plugin.zsh
278@@ -0,0 +1,58 @@
279+# Some aliases for zeus. (See: https://github.com/burke/zeus)
280+# Zeus preloads your Rails environment and forks that process whenever
281+# needed. This effectively speeds up Rails' boot process to under 1 sec.
282+
283+# Always use bundler.
284+# Rails depends on bundler, so we can be pretty sure, that there are no
285+# problems with this command. For all the other aliases I provided an 
286+# alternative, in case people have conflicts with other plugins (e.g. suse).
287+alias zeus='bundle exec zeus'
288+
289+# Init
290+alias zi='zeus init'
291+alias zinit='zeus init'
292+
293+# Start
294+alias zs='zeus start'
295+alias ztart='zeus start'
296+
297+# Console
298+alias zc='zeus console'
299+alias zonsole='zeus console'
300+
301+# Server
302+alias zsr='zeus server'
303+alias zerver='zeus server'
304+
305+# Rake
306+alias zr='zeus rake'
307+alias zake='zeus rake'
308+
309+# Generate
310+alias zg='zeus generate'
311+alias zenerate='zeus generate'
312+
313+# Runner
314+alias zrn='zeus runner'
315+alias zunner='zeus runner'
316+
317+# Cucumber
318+alias zcu='zeus cucumber'
319+alias zucumber='zeus cucumber'
320+
321+# Test
322+alias zt='zeus test'
323+alias zest='zeus test'
324+
325+alias zu='zeus test test/unit/*'
326+alias zunits='zeus test test/unit/*'
327+
328+alias zf='zeus test test/functional/*'
329+alias zunctional='zeus test test/functional/*'
330+
331+alias za='zeus test test/unit/*; zeus test test/functional/; zeus cucumber'
332+alias zall='zeus test test/unit/*; zeus test test/functional/; zeus cucumber'
333+
334+# Clean up crashed zeus instances.
335+alias zsw='rm .zeus.sock'
336+alias zweep='rm .zeus.sock'