Class: RubyInstaller::Build::ComponentsInstaller
- Inherits:
-
Rake::Application
- Object
- Rake::Application
- RubyInstaller::Build::ComponentsInstaller
- Defined in:
- lib/ruby_installer/build/components_installer.rb
Instance Attribute Summary collapse
-
#installable_components ⇒ Object
readonly
Returns the value of attribute installable_components.
-
#msys ⇒ Object
Returns the value of attribute msys.
-
#pacman_args ⇒ Object
Returns the value of attribute pacman_args.
Instance Method Summary collapse
-
#initialize(msys: nil, pacman_args: ["--needed", "--noconfirm"], builtin_packages_dir: File.join(RbConfig::TOPDIR, "packages")) ⇒ ComponentsInstaller
constructor
A new instance of ComponentsInstaller.
- #install(component_names) ⇒ Object
- #reload ⇒ Object
Constructor Details
#initialize(msys: nil, pacman_args: ["--needed", "--noconfirm"], builtin_packages_dir: File.join(RbConfig::TOPDIR, "packages")) ⇒ ComponentsInstaller
Returns a new instance of ComponentsInstaller.
10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 |
# File 'lib/ruby_installer/build/components_installer.rb', line 10 def initialize(msys: nil, pacman_args: ["--needed", "--noconfirm"], builtin_packages_dir: File.join(RbConfig::TOPDIR, "packages")) super() @msys = msys @pacman_args = pacman_args @builtin_packages_dir = builtin_packages_dir @task_consts = Dir[File.("../components/??_*.rb", __FILE__)].sort.map do |comppath| require comppath idx, tname = File.basename(comppath, ".rb").split("_", 2) const_name = tname.sub(/^[a-z\d]*/) { |match| match.capitalize } .gsub(/(?:_|(\/))([a-z\d]*)/i) { "#{$1}#{$2.capitalize}" } [idx.to_i, tname, Components.const_get(const_name)] end define_tasks end |
Instance Attribute Details
#installable_components ⇒ Object (readonly)
Returns the value of attribute installable_components.
6 7 8 |
# File 'lib/ruby_installer/build/components_installer.rb', line 6 def installable_components @installable_components end |
#msys ⇒ Object
Returns the value of attribute msys.
7 8 9 |
# File 'lib/ruby_installer/build/components_installer.rb', line 7 def msys @msys end |
#pacman_args ⇒ Object
Returns the value of attribute pacman_args.
8 9 10 |
# File 'lib/ruby_installer/build/components_installer.rb', line 8 def pacman_args @pacman_args end |
Instance Method Details
#install(component_names) ⇒ Object
33 34 35 36 |
# File 'lib/ruby_installer/build/components_installer.rb', line 33 def install(component_names) collect_command_line_tasks(component_names) top_level end |
#reload ⇒ Object
28 29 30 31 |
# File 'lib/ruby_installer/build/components_installer.rb', line 28 def reload clear define_tasks end |