= find_gem and edit_gem
This RubyGem includes two command-line applications, plus some auto-complete helper apps (see below)
== find_gem
Returns the path of a RubyGem within the gem cache. That is, the location of the gem after you "gem install" it.
This allows you to quickly inspect a gem's source, its tests, its examples, etc.
Usage: find_gem [gem name]
Example: find_gem newgem
If the gem name is not included, the root path of all gems is returned.
== edit_gem
Loads a RubyGem into your editor (uses find_gem to determine the gem's location)
Usage: edit_gem [gem name]
Example: edit_gem newgem
If the gem name is not included, the editor will attempt to load the root path for all gems.
Requires: your EDITOR environment to be set, e.g. EDITOR=mate -w
= auto-complete
For bash users, auto-completion help is available with 2 included scripts:
To your ~/.bashrc or ~/.profile add
complete -C gem_autocomplete -o default find_gem
complete -C gem_autocomplete -o default edit_gem
complete -C gem_autocomplete -o default gem
And reload your profile:
source ~/.bashrc
Now you will be able to use TAB-auto-completion to discover RubyGems in your cache, or in the remote Gem server (for "gem install")
== For example:
Gem command auto-complete
gem <TAB><TAB> (double TAB)
-> build contents install query specification
cert dependency list rdoc uninstall
check environment outdated search unpack
cleanup help pristine sources update
gem inst<TAB>
-> gem install
Remote gem server auto-complete:
gem install new<TAB>
-> gem install newgem
# press <ENTER> to install this gem
Local gem cache auto-complete:
edit_gem new<TAB>
-> edit_gem newgem
# press <ENTER> to edit the gem from your cache
This RubyGem includes two command-line applications, plus some auto-complete helper apps (see below)
== find_gem
Returns the path of a RubyGem within the gem cache. That is, the location of the gem after you "gem install" it.
This allows you to quickly inspect a gem's source, its tests, its examples, etc.
Usage: find_gem [gem name]
Example: find_gem newgem
If the gem name is not included, the root path of all gems is returned.
== edit_gem
Loads a RubyGem into your editor (uses find_gem to determine the gem's location)
Usage: edit_gem [gem name]
Example: edit_gem newgem
If the gem name is not included, the editor will attempt to load the root path for all gems.
Requires: your EDITOR environment to be set, e.g. EDITOR=mate -w
= auto-complete
For bash users, auto-completion help is available with 2 included scripts:
To your ~/.bashrc or ~/.profile add
complete -C gem_autocomplete -o default find_gem
complete -C gem_autocomplete -o default edit_gem
complete -C gem_autocomplete -o default gem
And reload your profile:
source ~/.bashrc
Now you will be able to use TAB-auto-completion to discover RubyGems in your cache, or in the remote Gem server (for "gem install")
== For example:
Gem command auto-complete
gem <TAB><TAB> (double TAB)
-> build contents install query specification
cert dependency list rdoc uninstall
check environment outdated search unpack
cleanup help pristine sources update
gem inst<TAB>
-> gem install
Remote gem server auto-complete:
gem install new<TAB>
-> gem install newgem
# press <ENTER> to install this gem
Local gem cache auto-complete:
edit_gem new<TAB>
-> edit_gem newgem
# press <ENTER> to edit the gem from your cache