SourcePosition
Editor friendly source location
Tested on 1.8.7, 1.9.3, ree, rbx-18mode, rbx-19mode
If you are using 1.8.7 or ree, you have to install ruby18_source_location.
Installation
Add this line to your application's Gemfile:
gem 'source_position'
And then execute:
$ bundle
Or install it yourself as:
$ gem install source_position
Usage
# file: /foo/bar.rb
class Dummy
def
puts '42'
end
end
Dummy.method(:foobar).source_position
should ouputs something like this:
"/foo/bar.rb:4"
So, in iTerm, you can press ⌘-Click
to open this file and navigate to
line 4.
Contributing
- Fork it
- Create your feature branch (
git checkout -b my-new-feature
) - Commit your changes (
git commit -am 'Added some feature'
) - Push to the branch (
git push origin my-new-feature
) - Create new Pull Request