Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Editor friendly source location.

branch: master

Fetching latest commit…

Octocat-spinner-32-eaf2f5

Cannot retrieve the latest commit at this time

Octocat-spinner-32 gemfiles
Octocat-spinner-32 lib
Octocat-spinner-32 spec
Octocat-spinner-32 .gitignore
Octocat-spinner-32 .rspec
Octocat-spinner-32 .travis.yml
Octocat-spinner-32 Gemfile
Octocat-spinner-32 LICENSE
Octocat-spinner-32 README.md
Octocat-spinner-32 Rakefile
Octocat-spinner-32 source_position.gemspec
README.md

SourcePosition

Editor friendly source location

Build Status Dependency Status Gem Version Code Climate endorse

Tested on 1.8.7, 1.9.3, 2.0.0, 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 foobar
    puts '42'
  end
end
Dummy.method(:foobar).source_position
# => "/foo/bar.rb:4"

So, in iTerm, you can use ⌘-Click to open this file on line 4.

Contributing

  1. Fork it
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Added some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create new Pull Request
Something went wrong with that request. Please try again.