Class: Gemstar::PackageLockFile

Inherits:
Object
  • Object
show all
Defined in:
lib/gemstar/package_lock_file.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(path: nil, content: nil) ⇒ PackageLockFile

Returns a new instance of PackageLockFile.



5
6
7
8
9
10
# File 'lib/gemstar/package_lock_file.rb', line 5

def initialize(path: nil, content: nil)
  @path = path
  parsed = parse_content(content || File.read(path))
  @specs = parsed[:specs]
  @spec_sources = parsed[:spec_sources]
end

Instance Attribute Details

#spec_sourcesObject (readonly)

Returns the value of attribute spec_sources.



13
14
15
# File 'lib/gemstar/package_lock_file.rb', line 13

def spec_sources
  @spec_sources
end

#specsObject (readonly)

Returns the value of attribute specs.



12
13
14
# File 'lib/gemstar/package_lock_file.rb', line 12

def specs
  @specs
end

Instance Method Details

#source_for(name) ⇒ Object



15
16
17
# File 'lib/gemstar/package_lock_file.rb', line 15

def source_for(name)
  spec_sources[name]
end