Class: Gemfiler::Cabinet
- Inherits:
-
Object
- Object
- Gemfiler::Cabinet
- Defined in:
- lib/gemfiler/cabinet.rb
Instance Attribute Summary collapse
-
#gemfile ⇒ Object
readonly
Returns the value of attribute gemfile.
-
#shim ⇒ Object
readonly
Returns the value of attribute shim.
-
#source_contents ⇒ Object
readonly
Returns the value of attribute source_contents.
Instance Method Summary collapse
- #collect! ⇒ Object
- #gems ⇒ Object
-
#initialize(gemfile) ⇒ Cabinet
constructor
A new instance of Cabinet.
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
#gemfile ⇒ Object (readonly)
Returns the value of attribute gemfile.
3 4 5 |
# File 'lib/gemfiler/cabinet.rb', line 3 def gemfile @gemfile end |
#shim ⇒ Object (readonly)
Returns the value of attribute shim.
3 4 5 |
# File 'lib/gemfiler/cabinet.rb', line 3 def shim @shim end |
#source_contents ⇒ Object (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 |
#gems ⇒ Object
10 11 12 |
# File 'lib/gemfiler/cabinet.rb', line 10 def gems self.shim.gems end |