Class: EY::Serverside::LockfileParser::Parse10
- Inherits:
-
Parse09
- Object
- BaseParser
- Parse09
- EY::Serverside::LockfileParser::Parse10
- Defined in:
- lib/engineyard-serverside/lockfile_parser.rb
Direct Known Subclasses
Instance Method Summary collapse
Methods inherited from Parse09
Methods inherited from BaseParser
Constructor Details
This class inherits a constructor from EY::Serverside::LockfileParser::BaseParser
Instance Method Details
#parse ⇒ Object
46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 |
# File 'lib/engineyard-serverside/lockfile_parser.rb', line 46 def parse unless @contents.index(/^DEPENDENCIES/) return super end dep_section = "" in_dependencies_section = false @contents.each_line do |line| if line =~ /^DEPENDENCIES/ in_dependencies_section = true elsif line =~ /^\S/ in_dependencies_section = false elsif in_dependencies_section dep_section << line end end unless dep_section.length > 0 raise "Couldn't parse #{@contents}; exiting" exit(1) end result = dep_section.scan(/^\s*bundler\s*\(=\s*([^\)]+)\)/).first bundler_version = result ? result.first : nil [:bundler10, bundler_version] end |