Class: RbSys::Mkmf::Config
- Inherits:
-
Object
- Object
- RbSys::Mkmf::Config
- Defined in:
- lib/rb_sys/mkmf/config.rb
Overview
Config that delegates to CargoBuilder if needded
Instance Attribute Summary collapse
-
#auto_install_rust_toolchain ⇒ Object
Returns the value of attribute auto_install_rust_toolchain.
-
#clean_after_install ⇒ Object
Returns the value of attribute clean_after_install.
-
#force_install_rust_toolchain ⇒ Object
Returns the value of attribute force_install_rust_toolchain.
-
#target_dir ⇒ Object
Returns the value of attribute target_dir.
Instance Method Summary collapse
- #cross_compiling? ⇒ Boolean
-
#initialize(builder) ⇒ Config
constructor
A new instance of Config.
- #method_missing(name, *args, &blk) ⇒ Object
- #respond_to_missing?(name, include_private = false) ⇒ Boolean
-
#rubygems_invoked? ⇒ Boolean
Seems to be the only way to reliably know if we were invoked by Rubygems.
Constructor Details
#initialize(builder) ⇒ Config
Returns a new instance of Config.
9 10 11 12 13 14 |
# File 'lib/rb_sys/mkmf/config.rb', line 9 def initialize(builder) @builder = builder @force_install_rust_toolchain = false @auto_install_rust_toolchain = true @clean_after_install = rubygems_invoked? end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(name, *args, &blk) ⇒ Object
20 21 22 |
# File 'lib/rb_sys/mkmf/config.rb', line 20 def method_missing(name, *args, &blk) @builder.send(name, *args, &blk) end |
Instance Attribute Details
#auto_install_rust_toolchain ⇒ Object
Returns the value of attribute auto_install_rust_toolchain.
7 8 9 |
# File 'lib/rb_sys/mkmf/config.rb', line 7 def auto_install_rust_toolchain @auto_install_rust_toolchain end |
#clean_after_install ⇒ Object
Returns the value of attribute clean_after_install.
7 8 9 |
# File 'lib/rb_sys/mkmf/config.rb', line 7 def clean_after_install @clean_after_install end |
#force_install_rust_toolchain ⇒ Object
Returns the value of attribute force_install_rust_toolchain.
7 8 9 |
# File 'lib/rb_sys/mkmf/config.rb', line 7 def force_install_rust_toolchain @force_install_rust_toolchain end |
#target_dir ⇒ Object
Returns the value of attribute target_dir.
7 8 9 |
# File 'lib/rb_sys/mkmf/config.rb', line 7 def target_dir @target_dir end |
Instance Method Details
#cross_compiling? ⇒ Boolean
16 17 18 |
# File 'lib/rb_sys/mkmf/config.rb', line 16 def cross_compiling? RbConfig::CONFIG["CROSS_COMPILING"] == "yes" end |
#respond_to_missing?(name, include_private = false) ⇒ Boolean
24 25 26 |
# File 'lib/rb_sys/mkmf/config.rb', line 24 def respond_to_missing?(name, include_private = false) @builder.respond_to?(name) || super end |
#rubygems_invoked? ⇒ Boolean
Seems to be the only way to reliably know if we were invoked by Rubygems. We want to know this so we can cleanup the target directory after an install, to remove bloat.
31 32 33 |
# File 'lib/rb_sys/mkmf/config.rb', line 31 def rubygems_invoked? ENV.key?("SOURCE_DATE_EPOCH") end |