lib/solve/artifact.rb
# Return the Solve::Dependency from the collection of
# dependencies with the given name and constraint.
#
# @param [#to_s] name
# @param [String] constraint
#
# @example Adding dependencies
#   artifact.depends('nginx')
#     #=> #<Dependency nginx (>= 0.0.0)>
#   artifact.depends('ntp', '= 1.0.0')
#     #=> #<Dependency ntp (= 1.0.0)>
#
# @example Chaining dependencies
#   artifact
#     .depends('nginx')
#     .depends('ntp', '~> 1.3')
#
# @return [Solve::Artifact]
Return the Solve::Dependency from the collection of
dependencies with the given name and constraint.
Return the Solve :: Dependency from the collection of dependencies with the given name and constraint .
def depends(name, constraint = ">= 0.0.0")
      unless dependency?(name, constraint)
        set_dependency(name, constraint)
      end
      self
    end
def depends ( name , constraint = ">= 0.0.0" ) unless dependency? ( name , constraint ) set_dependency ( name , constraint ) end self end
Return the Solve::Dependency from the collection of
dependencies with the given name and constraint.
Return the Solve :: Dependency from the collection of dependencies with the given name and constraint .
None
Solve::Artifact
name
<not_specific>
constraint
<not_specific>
<not_specific>
None
example
None
example
Chaining dependencies artifact .depends('nginx') .depends('ntp', '~> 1.3')
Chaining dependencies artifact . depends ( ' nginx ' ) . depends ( ' ntp ' ' ~ > 1 . 3 ' )