← Back to Upcase

Art of Vim/Vim for Rails Developers: Vendoring Rails?


(Geoff Harcourt) #1

@benorenstein, been working through the Vim for Rails Developers screencast. Around minute 20, you mention that ctags work best when Rails is vendored. I know this screencast was made a while back, is that practice still the best way to be able to link to Rails API methods?

Also, is the proper way to vendor Rails to use rake rails:freeze:gems?

Thanks,
Geoff


(Ben Orenstein) #2

Thanks for the question!

Nope, I don’t vendor Rails anymore. And I haven’t replaced my method for viewing source on gems/Rails code right from their call-site.

It’s actually been on my todo list for a while. If you find a handy way to pull that off using modern practices, please let me know!


(Matt Rohrer) #3

Tpope’s gem-ctags is very nice for exploring library code.


(Geoff Harcourt) #4

@matt thanks, just gave that a try.

@benorenstein I think changes have been made to either rails or vim-rails that don’t require vendoring rails any longer. I ran gf on ActiveRecord::Base and vim jumped to the Rails source on its own.


(Patrick Hereford) #5

@matt Nice one!

I have been using https://coderwall.com/p/du_sgq to get rails (and gems) recognized by ctags. So far, so good.


(Jon Seidel) #6

I recently found a great little bash command that does it all (I wish I could remember where I got it from!) and doesn’t require vendoring or an add-on:

ctags -R . $(bundle show --path)