Class: Pessimize::GemfileLockVersionParser
- Inherits:
-
Object
- Object
- Pessimize::GemfileLockVersionParser
- Defined in:
- lib/pessimize/gemfile_lock_version_parser.rb
Instance Attribute Summary collapse
-
#versions ⇒ Object
readonly
Returns the value of attribute versions.
Instance Method Summary collapse
- #call(gemfile_lock_file) ⇒ Object
-
#initialize ⇒ GemfileLockVersionParser
constructor
A new instance of GemfileLockVersionParser.
Constructor Details
#initialize ⇒ GemfileLockVersionParser
Returns a new instance of GemfileLockVersionParser.
5 6 7 8 |
# File 'lib/pessimize/gemfile_lock_version_parser.rb', line 5 def initialize self.versions = {} self.parse_enabled = false end |
Instance Attribute Details
#versions ⇒ Object
Returns the value of attribute versions.
3 4 5 |
# File 'lib/pessimize/gemfile_lock_version_parser.rb', line 3 def versions @versions end |
Instance Method Details
#call(gemfile_lock_file) ⇒ Object
10 11 12 13 14 15 16 17 18 19 |
# File 'lib/pessimize/gemfile_lock_version_parser.rb', line 10 def call(gemfile_lock_file) gemfile_lock_file.each_line do |line| if line.start_with? 'GEM' self.parse_enabled = true end if parse_enabled parse_line(line) end end end |