源代碼快速定位工具-qwandry使用指南
GitHub地址:https://github.com/adamsanderson/qwandry
qwandry 能快速定位到我們需要找到 庫文件, 項目 的工具。
Ruby中實現(xiàn)快速定位的方法有好多種,我知道的有三個:
cd `bundle show active_record`
通過tag方法(tag 定位更精確,可以定位到方法級別)
或者通過 qwandry
安裝
gem install qwandry
使用
qw matrix # opens ruby's matrix class in your editor qw rails # will ask you which version of rails you want to open qw activerec 3.1 # will find the gem activerecord 3.1 and open it You can also use Qwandry with other common languages: qw -r python numpy # opens python's numpy library qw -r perl URI # open perl's URI library qw -r node express # open express if it is installed for node
指定編輯器打開
EDITOR=subl qw activerecord 3.2.14
如何自定義?
touch ~/.qwandry/init.rb
然后copy如下內(nèi)容到文件中
register 'projects' do add 'your project path' end default :ruby, :gem, :projects
解釋
register 方法是 將指定的目錄打包
add 將目錄加入到搜索中
default 是設置默認的搜索范圍
實現(xiàn)的基本原理
通過配置 config 將很多目錄打包成 Package, 然后將 Package 打包成 Repository(倉庫)
初始化一個Launcher(有Editor等)
根據(jù)輸入的名稱找到對應的Repository中的package(實際上是一個目錄地址)
執(zhí)行系統(tǒng)命令: editor(vim) path
相關(guān)文章
快速正確的安裝 Ruby, Rails 運行環(huán)境
對于新入門的開發(fā)者,如何安裝 Ruby, Ruby Gems 和 Rails 的運行環(huán)境可能會是個問題,本頁主要介紹如何用一條靠譜的路子快速安裝 Ruby 開發(fā)環(huán)境2014-07-07
Ruby使用Monkey Patch猴子補丁方式進行程序開發(fā)的示例
Monkey Patch猴子補丁是指在程序解釋運行時動態(tài)添加類或模塊的做法,這里我們就來看一下Ruby使用Monkey Patch猴子補丁方式進行程序開發(fā)的示例2016-05-05
編寫Ruby腳本來對Twitter用戶的數(shù)據(jù)進行深度挖掘
這篇文章主要介紹了編寫Ruby腳本來對Twitter用戶的數(shù)據(jù)進行深度挖掘的一些例子,通過調(diào)用Twitter API來實現(xiàn)各種功能(內(nèi)地注意墻),需要的朋友可以參考下2015-11-11

