Module: Cany::Mixins::DependMixin

Included in:
Recipe, Recipes::Bundler::Gem::DSL, Specification::DSL
Defined in:
lib/cany/mixins/depend_mixin.rb

Instance Method Summary collapse

Instance Method Details

#depend(dep) ⇒ Object #depend(default, opts) ⇒ Object

Overloads:

  • #depend(dep) ⇒ Object

    Parameters:

  • #depend(default, opts) ⇒ Object

    Creates a new dependency object

    Parameters:

    • depend (Symbol)

      The default

    • opts (Hash)

      Options influencing the create Dependency object.



11
12
13
14
15
16
17
18
19
20
21
# File 'lib/cany/mixins/depend_mixin.rb', line 11

def create_dep(depend, opts={})
  if depend.kind_of? Cany::Dependency
    depend
  else
    opts = { situation: :runtime, version: nil }.merge opts
    dep = Cany::Dependency.new
    dep.define_default depend, opts[:version]
    dep.situations = opts[:situation]
    dep
  end
end