cffa9a2fda28e9b2913776c3db588f4f28412864

Author
Celestino Gomes <tinorj@gmail.com>
Committer
GitHub <noreply@github.com>
Date

Message

feat(ruby): add new aliases `rrun` and `rserver` (#10218)

Diff

 1diff --git a/plugins/ruby/README.md b/plugins/ruby/README.md
 2index 59594ade7e404dd1dbd3c9a588ccdb7d93b5ccf2..59d839c5cd56783949258a635b7b12c75feeebd0 100644
 3--- a/plugins/ruby/README.md
 4+++ b/plugins/ruby/README.md
 5@@ -10,22 +10,24 @@ plugins=(... ruby)
 6 
 7 ## Aliases
 8 
 9-| Alias  | Command                                | Description                                          |
10-|--------|----------------------------------------|------------------------------------------------------|
11-| rb     | `ruby`                                 | The Ruby command                                     |
12-| sgem   | `sudo gem`                             | Run sudo gem on the system ruby, not the active ruby |
13-| rfind  | `find . -name "*.rb" \| xargs grep -n` | Find ruby file                                       |
14-| gein   | `gem install`                          | Install a gem into the local repository              |
15-| geun   | `gem uninstall`                        | Uninstall gems from the local repository             |
16-| geli   | `gem list`                             | Display gems installed locally                       |
17-| gei    | `gem info`                             | Show information for the given gem                   |
18-| geiall | `gem info --all`                       | Display all gem versions                             |
19-| geca   | `gem cert --add`                       | Add a trusted certificate                            |
20-| gecr   | `gem cert --remove`                    | Remove a trusted certificate                         |
21-| gecb   | `gem cert --build`                     | Build private key and self-signed certificate        |
22-| geclup | `gem cleanup -n`                       | Do not uninstall gem                                 |
23-| gegi   | `gem generate_index`                   | Generate index file for gem server                   |
24-| geh    | `gem help`                             | Provide additional help                              |
25-| gel    | `gem lock`                             | Generate a lockdown list of gems                     |
26-| geo    | `gem open`                             | Open gem source in default editor                    |
27-| geoe   | `gem open -e`                          | Open gem sources in preferred editor                 |
28+| Alias   | Command                                | Description                                          |
29+| ------- | -------------------------------------- | ---------------------------------------------------- |
30+| rb      | `ruby`                                 | The Ruby command                                     |
31+| sgem    | `sudo gem`                             | Run sudo gem on the system ruby, not the active ruby |
32+| rfind   | `find . -name "*.rb" \| xargs grep -n` | Find ruby file                                       |
33+| rrun    | `ruby -e`                              | Execute some code: E.g: `rrun "puts 'Hello world!'"` |
34+| rserver | `ruby -e httpd . -p 8080`              | Start HTTP Webrick serving local directory/files     |
35+| gein    | `gem install`                          | Install a gem into the local repository              |
36+| geun    | `gem uninstall`                        | Uninstall gems from the local repository             |
37+| geli    | `gem list`                             | Display gems installed locally                       |
38+| gei     | `gem info`                             | Show information for the given gem                   |
39+| geiall  | `gem info --all`                       | Display all gem versions                             |
40+| geca    | `gem cert --add`                       | Add a trusted certificate                            |
41+| gecr    | `gem cert --remove`                    | Remove a trusted certificate                         |
42+| gecb    | `gem cert --build`                     | Build private key and self-signed certificate        |
43+| geclup  | `gem cleanup -n`                       | Do not uninstall gem                                 |
44+| gegi    | `gem generate_index`                   | Generate index file for gem server                   |
45+| geh     | `gem help`                             | Provide additional help                              |
46+| gel     | `gem lock`                             | Generate a lockdown list of gems                     |
47+| geo     | `gem open`                             | Open gem source in default editor                    |
48+| geoe    | `gem open -e`                          | Open gem sources in preferred editor                 |
49diff --git a/plugins/ruby/ruby.plugin.zsh b/plugins/ruby/ruby.plugin.zsh
50index 890fcb179d08a87558ed6b41e3d202517b0a3390..408512110467756b17517bf2cd2186e65d68d076 100644
51--- a/plugins/ruby/ruby.plugin.zsh
52+++ b/plugins/ruby/ruby.plugin.zsh
53@@ -22,3 +22,5 @@ alias geh="gem help"
54 alias gel="gem lock"
55 alias geo="gem open"
56 alias geoe="gem open -e"
57+alias rrun="ruby -e"
58+alias rserver="ruby -e httpd . -p 8080" # requires webrick