当前位置: 移动技术网 > IT编程>脚本编程>Ruby > 源代码快速定位工具-qwandry使用指南

源代码快速定位工具-qwandry使用指南

2017年12月08日  | 移动技术网IT编程  | 我要评论
github地址: qwandry 能快速定位到我们需要找到 库文件, 项目 的工具。 ruby中实现快速定位的方法有好多种,我知道的有三个: cd `bun

github地址:

qwandry 能快速定位到我们需要找到 库文件, 项目 的工具。

ruby中实现快速定位的方法有好多种,我知道的有三个:

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如下内容到文件中

register 'projects' do
 add 'your project path'
end

default :ruby, :gem, :projects

解释

register 方法是 将指定的目录打包

add 将目录加入到搜索中

default 是设置默认的搜索范围

实现的基本原理

通过配置 config 将很多目录打包成 package, 然后将 package 打包成 repository(仓库)
初始化一个launcher(有editor等)

根据输入的名称找到对应的repository中的package(实际上是一个目录地址)

执行系统命令: editor(vim) path

如您对本文有疑问或者有任何想说的,请 点击进行留言回复,万千网友为您解惑!

相关文章:

验证码:
移动技术网