Class: Gemfiler::Cabinet

Inherits:
Object
  • Object
show all
Defined in:
lib/Gemfiler/cabinet.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(gemfile) ⇒ Cabinet

Returns a new instance of Cabinet.



5
6
7
8
# File 'lib/Gemfiler/cabinet.rb', line 5

def initialize(gemfile)
  @gemfile = gemfile
  @shim    = BundlerShim.new
end

Instance Attribute Details

#gemfileObject (readonly)

Returns the value of attribute gemfile.



3
4
5
# File 'lib/Gemfiler/cabinet.rb', line 3

def gemfile
  @gemfile
end

#shimObject (readonly)

Returns the value of attribute shim.



3
4
5
# File 'lib/Gemfiler/cabinet.rb', line 3

def shim
  @shim
end

#source_contentsObject (readonly)

Returns the value of attribute source_contents.



3
4
5
# File 'lib/Gemfiler/cabinet.rb', line 3

def source_contents
  @source_contents
end

Instance Method Details

#collect!Object



14
15
16
17
# File 'lib/Gemfiler/cabinet.rb', line 14

def collect!
  @source_contents ||= File.read(gemfile)
  self.shim.gather(@source_contents)
end

#gemsObject



10
11
12
# File 'lib/Gemfiler/cabinet.rb', line 10

def gems
  self.shim.gems
end