GitHub address: https://github.com/adamsanderson/qwandry
Qwandry can quickly locate the tools we need to find library files and projects.
There are many methods for Fast Location in Ruby, And I know three of them:
cd `bundle show active_record`
Use the tag method (tag location is more accurate and the method level can be located)
Or through qwandry
Install
gem install qwandry
Use
qw matrix # opens ruby's matrix class in your editorqw rails # will ask you which version of rails you want to openqw activerec 3.1 # will find the gem activerecord 3.1 and open itYou can also use Qwandry with other common languages:qw -r python numpy # opens python's numpy libraryqw -r perl URI # open perl's URI libraryqw -r node express # open express if it is installed for node
Specify editor to open
EDITOR=subl qw activerecord 3.2.14
How to customize it?
touch ~/.qwandry/init.rb
Copy the following content to the file.
register 'projects' do add 'your project path'enddefault :ruby, :gem, :projects
Explanation
The register method is to package the specified directory.
Add directory to search
Default indicates the default search range.
Basic Principle of implementation
Package many directories into packages by configuring config, and then Package them into a Repository (warehouse)
Initialize a Launcher (with Editor, etc)
Find the package in the corresponding Repository based on the input name (actually a directory address)
Execute the system command: editor (vim) path