Method: Autoversion::DSL#parse_file
- Defined in:
- lib/autoversion/dsl.rb
#parse_file(path, matcher) ⇒ Object
Parse the specified file with the provided matcher.
The first returned match will be used as the version.
30 31 32 33 34 35 36 37 38 39 40 |
# File 'lib/autoversion/dsl.rb', line 30 def parse_file path, matcher File.open(path) do |f| f.each do |line| if m = matcher.call(line) return m end end end raise "#{path}: found no matching lines." end |