Class: Bundler::LockfileParser
Instance Attribute Summary collapse
-
#dependencies ⇒ Object
readonly
Returns the value of attribute dependencies.
-
#platforms ⇒ Object
readonly
Returns the value of attribute platforms.
-
#sources ⇒ Object
readonly
Returns the value of attribute sources.
-
#specs ⇒ Object
readonly
Returns the value of attribute specs.
Instance Method Summary collapse
-
#initialize(lockfile) ⇒ LockfileParser
constructor
A new instance of LockfileParser.
Constructor Details
#initialize(lockfile) ⇒ LockfileParser
Returns a new instance of LockfileParser.
7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 |
# File 'lib/bundler/lockfile_parser.rb', line 7 def initialize(lockfile) @platforms = [] @sources = [] @dependencies = [] @specs = [] @state = :source lockfile.split(/(\r?\n)+/).each do |line| if line == "DEPENDENCIES" @state = :dependency elsif line == "PLATFORMS" @state = :platform else send("parse_#{@state}", line) end end end |
Instance Attribute Details
#dependencies ⇒ Object (readonly)
Returns the value of attribute dependencies.
5 6 7 |
# File 'lib/bundler/lockfile_parser.rb', line 5 def dependencies @dependencies end |
#platforms ⇒ Object (readonly)
Returns the value of attribute platforms.
5 6 7 |
# File 'lib/bundler/lockfile_parser.rb', line 5 def platforms @platforms end |
#sources ⇒ Object (readonly)
Returns the value of attribute sources.
5 6 7 |
# File 'lib/bundler/lockfile_parser.rb', line 5 def sources @sources end |
#specs ⇒ Object (readonly)
Returns the value of attribute specs.
5 6 7 |
# File 'lib/bundler/lockfile_parser.rb', line 5 def specs @specs end |