源代碼快速定位工具-qwandry使用指南
GitHub地址:https://github.com/adamsanderson/qwandry
qwandry 能快速定位到我們需要找到 庫文件, 項(xiàng)目 的工具。
Ruby中實(shí)現(xiàn)快速定位的方法有好多種,我知道的有三個(gè):
cd `bundle show active_record`
通過tag方法(tag 定位更精確,可以定位到方法級(jí)別)
或者通過 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 是設(shè)置默認(rèn)的搜索范圍
實(shí)現(xiàn)的基本原理
通過配置 config 將很多目錄打包成 Package, 然后將 Package 打包成 Repository(倉庫)
初始化一個(gè)Launcher(有Editor等)
根據(jù)輸入的名稱找到對(duì)應(yīng)的Repository中的package(實(shí)際上是一個(gè)目錄地址)
執(zhí)行系統(tǒng)命令: editor(vim) path
相關(guān)文章
快速正確的安裝 Ruby, Rails 運(yùn)行環(huán)境
對(duì)于新入門的開發(fā)者,如何安裝 Ruby, Ruby Gems 和 Rails 的運(yùn)行環(huán)境可能會(huì)是個(gè)問題,本頁主要介紹如何用一條靠譜的路子快速安裝 Ruby 開發(fā)環(huán)境2014-07-07GitHub倡導(dǎo)的Ruby代碼編寫風(fēng)格總結(jié)
GitHub網(wǎng)站服務(wù)器端主要就是使用的Ruby作為編程語言,因而GitHub所提倡采用的Ruby書寫規(guī)范也就顯得更有些說服力XD 下面我們就整理除了這份GitHub倡導(dǎo)的Ruby代碼編寫風(fēng)格總結(jié),需要的朋友可以參考下2016-05-05Ruby使用Monkey Patch猴子補(bǔ)丁方式進(jìn)行程序開發(fā)的示例
Monkey Patch猴子補(bǔ)丁是指在程序解釋運(yùn)行時(shí)動(dòng)態(tài)添加類或模塊的做法,這里我們就來看一下Ruby使用Monkey Patch猴子補(bǔ)丁方式進(jìn)行程序開發(fā)的示例2016-05-05編寫Ruby腳本來對(duì)Twitter用戶的數(shù)據(jù)進(jìn)行深度挖掘
這篇文章主要介紹了編寫Ruby腳本來對(duì)Twitter用戶的數(shù)據(jù)進(jìn)行深度挖掘的一些例子,通過調(diào)用Twitter API來實(shí)現(xiàn)各種功能(內(nèi)地注意墻),需要的朋友可以參考下2015-11-11