summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCelestino Gomes <tinorj@gmail.com>2021-12-29 05:44:08 -0300
committerGitHub <noreply@github.com>2021-12-29 09:44:08 +0100
commitcffa9a2fda28e9b2913776c3db588f4f28412864 (patch)
treec55afcf9ec2d283ab85d4578bdd7e9c968497a3b
parenteb94df6428808afc74445a3c6433912982e4de75 (diff)
downloadzsh-cffa9a2fda28e9b2913776c3db588f4f28412864.tar.gz
zsh-cffa9a2fda28e9b2913776c3db588f4f28412864.tar.bz2
zsh-cffa9a2fda28e9b2913776c3db588f4f28412864.zip
feat(ruby): add new aliases `rrun` and `rserver` (#10218)
-rw-r--r--plugins/ruby/README.md40
-rw-r--r--plugins/ruby/ruby.plugin.zsh2
2 files changed, 23 insertions, 19 deletions
diff --git a/plugins/ruby/README.md b/plugins/ruby/README.md
index 59594ade7..59d839c5c 100644
--- a/plugins/ruby/README.md
+++ b/plugins/ruby/README.md
@@ -10,22 +10,24 @@ plugins=(... ruby)
## Aliases
-| Alias | Command | Description |
-|--------|----------------------------------------|------------------------------------------------------|
-| rb | `ruby` | The Ruby command |
-| sgem | `sudo gem` | Run sudo gem on the system ruby, not the active ruby |
-| rfind | `find . -name "*.rb" \| xargs grep -n` | Find ruby file |
-| gein | `gem install` | Install a gem into the local repository |
-| geun | `gem uninstall` | Uninstall gems from the local repository |
-| geli | `gem list` | Display gems installed locally |
-| gei | `gem info` | Show information for the given gem |
-| geiall | `gem info --all` | Display all gem versions |
-| geca | `gem cert --add` | Add a trusted certificate |
-| gecr | `gem cert --remove` | Remove a trusted certificate |
-| gecb | `gem cert --build` | Build private key and self-signed certificate |
-| geclup | `gem cleanup -n` | Do not uninstall gem |
-| gegi | `gem generate_index` | Generate index file for gem server |
-| geh | `gem help` | Provide additional help |
-| gel | `gem lock` | Generate a lockdown list of gems |
-| geo | `gem open` | Open gem source in default editor |
-| geoe | `gem open -e` | Open gem sources in preferred editor |
+| Alias | Command | Description |
+| ------- | -------------------------------------- | ---------------------------------------------------- |
+| rb | `ruby` | The Ruby command |
+| sgem | `sudo gem` | Run sudo gem on the system ruby, not the active ruby |
+| rfind | `find . -name "*.rb" \| xargs grep -n` | Find ruby file |
+| rrun | `ruby -e` | Execute some code: E.g: `rrun "puts 'Hello world!'"` |
+| rserver | `ruby -e httpd . -p 8080` | Start HTTP Webrick serving local directory/files |
+| gein | `gem install` | Install a gem into the local repository |
+| geun | `gem uninstall` | Uninstall gems from the local repository |
+| geli | `gem list` | Display gems installed locally |
+| gei | `gem info` | Show information for the given gem |
+| geiall | `gem info --all` | Display all gem versions |
+| geca | `gem cert --add` | Add a trusted certificate |
+| gecr | `gem cert --remove` | Remove a trusted certificate |
+| gecb | `gem cert --build` | Build private key and self-signed certificate |
+| geclup | `gem cleanup -n` | Do not uninstall gem |
+| gegi | `gem generate_index` | Generate index file for gem server |
+| geh | `gem help` | Provide additional help |
+| gel | `gem lock` | Generate a lockdown list of gems |
+| geo | `gem open` | Open gem source in default editor |
+| geoe | `gem open -e` | Open gem sources in preferred editor |
diff --git a/plugins/ruby/ruby.plugin.zsh b/plugins/ruby/ruby.plugin.zsh
index 890fcb179..408512110 100644
--- a/plugins/ruby/ruby.plugin.zsh
+++ b/plugins/ruby/ruby.plugin.zsh
@@ -22,3 +22,5 @@ alias geh="gem help"
alias gel="gem lock"
alias geo="gem open"
alias geoe="gem open -e"
+alias rrun="ruby -e"
+alias rserver="ruby -e httpd . -p 8080" # requires webrick