Sha256: 32c9047c7602d0f7453c538d6110771e44a13ece0901421fb936e739a4d9bee0

Contents?: true

Size: 799 Bytes

Versions: 16

Compression:

Stored size: 799 Bytes

Contents

module Cany::Mixins::DependMixin
  # @overload depend(dep)
  #   @param depend[Cany::Dependency] A complete Dependency object
  # @overload depend(default, opts)
  #   Creates a new dependency object
  #   @param depend[Symbol] The default
  #   @param opts[Hash] Options influencing the create Dependency object.
  #   @option opts[Symbol, Array<Symbol>] :situation For which situations
  #     is this dependency. Default is :runtime
  #   @option opts[Symbol] :version The default version
  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
end

Version data entries

16 entries across 16 versions & 1 rubygems

Version Path
cany-0.5.7 lib/cany/mixins/depend_mixin.rb
cany-0.5.6 lib/cany/mixins/depend_mixin.rb
cany-0.5.5 lib/cany/mixins/depend_mixin.rb
cany-0.5.4 lib/cany/mixins/depend_mixin.rb
cany-0.5.3 lib/cany/mixins/depend_mixin.rb
cany-0.5.2 lib/cany/mixins/depend_mixin.rb
cany-0.5.1 lib/cany/mixins/depend_mixin.rb
cany-0.5.0 lib/cany/mixins/depend_mixin.rb
cany-0.4.0 lib/cany/mixins/depend_mixin.rb
cany-0.3.0 lib/cany/mixins/depend_mixin.rb
cany-0.2.1 lib/cany/mixins/depend_mixin.rb
cany-0.2.0 lib/cany/mixins/depend_mixin.rb
cany-0.1.3 lib/cany/mixins/depend_mixin.rb
cany-0.1.2 lib/cany/mixins/depend_mixin.rb
cany-0.1.1 lib/cany/mixins/depend_mixin.rb
cany-0.1.0 lib/cany/mixins/depend_mixin.rb