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
13 14 15 16 17 |
# File 'lib/elm_install/installer.rb', line 13 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
55 56 57 58 59 60 61 |
# File 'lib/elm_install/installer.rb', line 55 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
23 24 25 26 27 28 29 30 31 32 33 34 35 |
# File 'lib/elm_install/installer.rb', line 23 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 |