{"action":"opened","issue":{"url":"https://api.github.com/repos/banister/method_source/issues/34","labels_url":"https://api.github.com/repos/banister/method_source/issues/34/labels{/name}","comments_url":"https://api.github.com/repos/banister/method_source/issues/34/comments","events_url":"https://api.github.com/repos/banister/method_source/issues/34/events","html_url":"https://github.com/banister/method_source/issues/34","id":116288267,"number":34,"title":"Shouldn't `source` method work with `eval` ?","user":{"login":"yanyingwang","id":4198408,"avatar_url":"https://avatars.githubusercontent.com/u/4198408?v=3","gravatar_id":"","url":"https://api.github.com/users/yanyingwang","html_url":"https://github.com/yanyingwang","followers_url":"https://api.github.com/users/yanyingwang/followers","following_url":"https://api.github.com/users/yanyingwang/following{/other_user}","gists_url":"https://api.github.com/users/yanyingwang/gists{/gist_id}","starred_url":"https://api.github.com/users/yanyingwang/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/yanyingwang/subscriptions","organizations_url":"https://api.github.com/users/yanyingwang/orgs","repos_url":"https://api.github.com/users/yanyingwang/repos","events_url":"https://api.github.com/users/yanyingwang/events{/privacy}","received_events_url":"https://api.github.com/users/yanyingwang/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2015-11-11T08:28:10Z","updated_at":"2015-11-11T08:28:10Z","closed_at":null,"body":"This is a test case to demonstrate what I mentioned in the title:\r\n\r\n```ruby\r\n#!/usr/bin/env ruby\r\n# test.rb\r\n\r\nclass TestClass\r\n  source = <<-EOF\r\n  def test_m\r\n    \"test_m here\"\r\n  end\r\n  EOF\r\n\r\n  eval(source)\r\nend\r\n```\r\n\r\n```ruby\r\n  ~  pry                                                                                                                                                                                                                                    \r\n[1] pry(main)> require './test.rb'                                                                                                                                                                                                                                      \r\n=> true\r\n[2] pry(main)> TestClass.new.test_m                                                                                                                                                                                                                                     \r\n=> \"test_m here\"\r\n[3] pry(main)> m  = TestClass.new.method :test_m                                                                                                                                                                                                                        \r\n=> #<Method: TestClass#test_m>\r\n[4] pry(main)> m.source                                                                                                                                                                                                                                                 \r\nMethodSource::SourceNotFoundError: Could not load source for : No such file or directory @ rb_sysopen - (eval)\r\nfrom /home/yanying/.rvm/gems/ruby-2.1.5/gems/method_source-0.8.2/lib/method_source.rb:55:in `rescue in lines_for'\r\n[5] pry(main)> m.source_location                                                                                                                                                                                                                                        \r\n=> [\"(eval)\", 1]\r\n[6] pry(main)>      \r\n```\r\n"}}