Class: Cany::Recipes::Bundler::Gem

Inherits:
Object
  • Object
show all
Defined in:
lib/cany/recipes/bundler/gem.rb

Defined Under Namespace

Classes: DSL

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Attribute Details

#dependenciesObject (readonly)

Returns the value of attribute dependencies.



24
25
26
# File 'lib/cany/recipes/bundler/gem.rb', line 24

def dependencies
  @dependencies
end

#nameObject (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

.clearObject

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

Parameters:

  • gem_name (Symbol)

    The gem name

Returns:

  • Cany::recipes::Bundler::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

Parameters:

  • gem_name (Symbol)

    the gem name



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