banister/method_source — Issue #11: method_source can raise a EOFError.
Author: robgleeson
Created: 2012-01-05 10:04:32+00:00
State: open

To reproduce:

```ruby

require 'rubygems'
require 'method_source'

block = proc { puts "Hello, world!" }
original = block.source

File.open '/tmp/foo.txt', 'a' { |f| f.write(original) }

buf = File.read '/tmp/foo.txt'
block = eval(buf, binding, __FILE__, __LINE__)

block.source
```

If you change the mode from `a` to `w`, it works fine.
It looks like method_source loops past the end of the file (`valid_expression?` never returns true) - code in source_helper.