Class: Conflict::InfoParser
- Inherits:
-
Object
- Object
- Conflict::InfoParser
- Defined in:
- lib/conflict/parsers.rb
Instance Method Summary collapse
Instance Method Details
#parse(info) ⇒ Object
73 74 75 76 77 78 79 80 81 82 83 84 85 |
# File 'lib/conflict/parsers.rb', line 73 def parse info raise ConflictException::new("info cannot be nil or empty") if info.nil? || info.empty? properties = {} info.split(%r{\n}).each do | line | properties[:url] = line.to_s.sub(@@url, "").chomp if line.to_s.index(@@url) == 0 properties[:path] = line.to_s.sub(@@path, "").chomp if line.to_s.index(@@path) == 0 end properties end |