Class: Cany::Recipes::Bundler::Gem
- Inherits:
-
Object
- Object
- Cany::Recipes::Bundler::Gem
- Defined in:
- lib/cany/recipes/bundler/gem.rb
Defined Under Namespace
Classes: DSL
Instance Attribute Summary collapse
-
#dependencies ⇒ Object
readonly
Returns the value of attribute dependencies.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
Class Method Summary collapse
-
.clear ⇒ Object
Clear all stored data.
-
.get(gem_name) ⇒ Object
This methods returns the Gem instance for the specified gem.
-
.specify(gem_name, &block) ⇒ Object
Specify meta data about the given gem @block: A block that defines the meta data.
Instance Attribute Details
#dependencies ⇒ Object (readonly)
Returns the value of attribute dependencies.
24 25 26 |
# File 'lib/cany/recipes/bundler/gem.rb', line 24 def dependencies @dependencies end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
24 25 26 |
# File 'lib/cany/recipes/bundler/gem.rb', line 24 def name @name end |
Class Method Details
.clear ⇒ Object
Clear all stored data. Only used in rspec
20 21 22 |
# File 'lib/cany/recipes/bundler/gem.rb', line 20 def self.clear @gems = {} end |
.get(gem_name) ⇒ Object
This methods returns the Gem instance for the specified gem
6 7 8 9 |
# File 'lib/cany/recipes/bundler/gem.rb', line 6 def self.get(gem_name) @gems ||= {} @gems[gem_name] ||= new gem_name end |
.specify(gem_name, &block) ⇒ Object
Specify meta data about the given gem @block: A block that defines the meta data. Executed inside the DSL subclass
15 16 17 |
# File 'lib/cany/recipes/bundler/gem.rb', line 15 def self.specify(gem_name, &block) DSL.new(get(gem_name)).run &block end |