e33bc4035171168ea7134d1494f7476cb9d9f352

Author
Julien Negrotto <jtnegrotto@gmail.com>
Committer
Marc Cornellà <hello@mcornella.com>
Date

Message

feat(rake): support square brackets with rake binstub (#5361)

Closes #5361

Diff

 1diff --git a/plugins/rake/README.md b/plugins/rake/README.md
 2index e888c078577bb4f7918ff02765385220edd5e4c5..72f2a85250f01b888d76b593ce3dc34486f1bdce 100644
 3--- a/plugins/rake/README.md
 4+++ b/plugins/rake/README.md
 5@@ -13,25 +13,29 @@ plugins=(... rake)
 6 
 7 The plugin aliases the rake command so you can pass arguments when invoking rake tasks
 8 without having to escape the brackets, i.e., you can run
 9-```
10+
11+```sh
12 rake namespace:task['argument']
13 ```
14+
15 instead of having to do
16-```
17+
18+```sh
19 rake namespace:task\['argument'\]
20 ```
21 
22-| Alias  | Command                        | Description                                   |
23-|--------|--------------------------------|-----------------------------------------------|
24-| rake   | `noglob rake`                  | Allows unescaped square brackets              |
25-| brake  | `noglob bundle exec rake`      | Same as above but call rake using bundler     |
26-| srake  | `noglob sudo rake`             | Same as rake but using sudo                   |
27-| sbrake | `noglob sudo bundle exec rake` | Same as above but using both sudo and bundler |
28+| Alias      | Command                        | Description                                   |
29+| ---------- | ------------------------------ | --------------------------------------------- |
30+| `rake`     | `noglob rake`                  | Allows unescaped square brackets              |
31+| `bin/rake` | `noglob bin/rake`              | Same as above but using rake binstub          |
32+| `brake`    | `noglob bundle exec rake`      | Same as above but call rake using bundler     |
33+| `srake`    | `noglob sudo rake`             | Same as rake but using sudo                   |
34+| `sbrake`   | `noglob sudo bundle exec rake` | Same as above but using both sudo and bundler |
35 
36 ## Jim Weirich
37 
38 The plugin also aliases `rake` to [`jimweirich`](https://github.com/jimweirich), author of Rake
39 and big time contributor to the Ruby open source community. He passed away in 2014:
40 
41-> Thank you Jim for everything you contributed to the Ruby and open source community 
42+> Thank you Jim for everything you contributed to the Ruby and open source community
43 > over the years. We will miss you dearly. — [**@robbyrussell**](https://github.com/ohmyzsh/ohmyzsh/commit/598a9c6f990756386517d66b6bcf77e53791e905)
44diff --git a/plugins/rake/rake.plugin.zsh b/plugins/rake/rake.plugin.zsh
45index 3ceb20fea9c1dcb403b412b7a750de14b47bd36b..0c507e628cd424e8a7ff57c7b1b0056da52bd3dd 100644
46--- a/plugins/rake/rake.plugin.zsh
47+++ b/plugins/rake/rake.plugin.zsh
48@@ -1,10 +1,9 @@
49-# Thank you Jim for everything you contributed to the Ruby and open source community 
50+# Thank you Jim for everything you contributed to the Ruby and open source community
51 # over the years. We will miss you dearly.
52-alias jimweirich="rake"  
53-
54-alias rake="noglob rake" # allows square brackets for rake task invocation
55-alias brake='noglob bundle exec rake' # execute the bundled rake gem
56-alias srake='noglob sudo rake' # noglob must come before sudo
57-alias sbrake='noglob sudo bundle exec rake' # altogether now ... 
58-
59+alias jimweirich='rake'
60 
61+alias rake='noglob rake'                    # allows square brackts for rake task invocation
62+alias 'bin/rake'='noglob bin/rake'          # support use of binstub
63+alias brake='noglob bundle exec rake'       # execute the bundled rake gem
64+alias srake='noglob sudo rake'              # noglob must come before sudo
65+alias sbrake='noglob sudo bundle exec rake' # altogether now ...