Class: Safedep::GemfileLock

Inherits:
Object
  • Object
show all
Defined in:
lib/safedep/gemfile_lock.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(path) ⇒ GemfileLock

Returns a new instance of GemfileLock.



8
9
10
# File 'lib/safedep/gemfile_lock.rb', line 8

def initialize(path)
  @path = path
end

Instance Attribute Details

#pathObject (readonly)

Returns the value of attribute path.



6
7
8
# File 'lib/safedep/gemfile_lock.rb', line 6

def path
  @path
end

Instance Method Details

#dependenciesObject



16
17
18
# File 'lib/safedep/gemfile_lock.rb', line 16

def dependencies
  @dependencies ||= lockfile.specs + [bundler_dependency]
end

#find_dependency(name) ⇒ Object



12
13
14
# File 'lib/safedep/gemfile_lock.rb', line 12

def find_dependency(name)
  dependencies.find { |dep| dep.name == name }
end