Sha256: 9c184791e9372a058be7afffe07fb0156f871ebd5d2adc4e4bb7d58312d5857e

Contents?: true

Size: 984 Bytes

Versions: 2

Compression:

Stored size: 984 Bytes

Contents

require 'forwardable'
require 'json'
require 'solve/errors'

# @author Jamie Winsor <reset@riotgames.com>
module Solve
  autoload :Version, 'solve/version'
  autoload :Artifact, 'solve/artifact'
  autoload :Constraint, 'solve/constraint'
  autoload :Dependency, 'solve/dependency'
  autoload :Graph, 'solve/graph'
  autoload :Demand, 'solve/demand'
  autoload :Solver, 'solve/solver'

  class << self
    # A quick solve. Given the "world" as we know it (the graph) and a list of
    # requirements (demands) which must be met. Return me the best solution of
    # artifacts and verisons that I should use.
    #
    # If a ui object is passed in, the resolution will be traced
    #
    # @param [Solve::Graph] graph
    # @param [Array<Solve::Demand>, Array<String, String>] demands
    # @param [#say, nil] ui (nil)
    #
    # @raise [NoSolutionError]
    #
    # @return [Hash]
    def it!(graph, demands, ui = nil)
      Solver.new(graph, demands, ui).resolve
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
solve-0.4.4 lib/solve.rb
solve-0.4.3 lib/solve.rb