Class: ElmInstall::Installer
Overview
Installer class
Instance Method Summary collapse
-
#initial_solve_constraints ⇒ Array
Returns the inital constraints.
-
#initialize(options = {}) ⇒ Installer
constructor
Initializes an installer with the given options.
-
#install ⇒ Object
Installs packages.
-
#results ⇒ Array
Returns the results of solving.
Constructor Details
#initialize(options = {}) ⇒ Installer
Initializes an installer with the given options
11 12 13 14 15 |
# File 'lib/elm_install/installer.rb', line 11 def initialize( = {}) @identifier = Identifier.new Dir.new(Dir.pwd), @resolver = Resolver.new @identifier self end |
Instance Method Details
#initial_solve_constraints ⇒ Array
Returns the inital constraints
53 54 55 56 57 58 59 |
# File 'lib/elm_install/installer.rb', line 53 def initial_solve_constraints @identifier.initial_dependencies.flat_map do |dependency| dependency.constraints.map do |constraint| [dependency.name, constraint] end end end |
#install ⇒ Object
Installs packages
21 22 23 24 25 26 27 28 29 30 31 32 33 |
# File 'lib/elm_install/installer.rb', line 21 def install puts 'Resolving packages...' @graph = @resolver.resolve puts 'Solving dependencies...' (Populator.new results).populate puts 'Packages configured successfully!' nil rescue Solve::Errors::NoSolutionError => error Logger.arrow "No solution found: #{error}" Process.abort end |