Class: FakeGemfile
- Inherits:
-
Object
- Object
- FakeGemfile
- Defined in:
- lib/commands/gems.rb
Instance Attribute Summary collapse
-
#gems ⇒ Object
readonly
Returns the value of attribute gems.
-
#sources ⇒ Object
readonly
Returns the value of attribute sources.
Instance Method Summary collapse
- #gem(name, version = nil, options = {}) ⇒ Object
-
#initialize ⇒ FakeGemfile
constructor
A new instance of FakeGemfile.
- #method_missing(name, *values) {|block| ... } ⇒ Object
Constructor Details
#initialize ⇒ FakeGemfile
Returns a new instance of FakeGemfile.
4 5 6 |
# File 'lib/commands/gems.rb', line 4 def initialize @sources, @gems = [], [] end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(name, *values) {|block| ... } ⇒ Object
12 13 14 |
# File 'lib/commands/gems.rb', line 12 def method_missing(name, *values, &block) yield block if block_given? end |
Instance Attribute Details
#gems ⇒ Object (readonly)
Returns the value of attribute gems.
2 3 4 |
# File 'lib/commands/gems.rb', line 2 def gems @gems end |
#sources ⇒ Object (readonly)
Returns the value of attribute sources.
2 3 4 |
# File 'lib/commands/gems.rb', line 2 def sources @sources end |
Instance Method Details
#gem(name, version = nil, options = {}) ⇒ Object
8 9 10 |
# File 'lib/commands/gems.rb', line 8 def gem(name, version = nil, = {}) @gems << {:name => name, :version => version, :options => } end |