Module: Ocran::HostConfigHelper
- Included in:
- Direction
- Defined in:
- lib/ocran/host_config_helper.rb
Overview
Variables describing the host’s build environment.
Class Method Summary collapse
- .all_core_dir ⇒ Object
- .bindir ⇒ Object
- .exe_extname ⇒ Object
- .exec_prefix ⇒ Object
- .libdir ⇒ Object
- .libruby_aliases ⇒ Object
- .libruby_so ⇒ Object
- .ruby_exe ⇒ Object
- .rubyw_exe ⇒ Object
- .sitelibdir ⇒ Object
Class Method Details
.all_core_dir ⇒ Object
50 51 52 53 54 55 |
# File 'lib/ocran/host_config_helper.rb', line 50 def all_core_dir RbConfig::CONFIG .slice("rubylibdir", "sitelibdir", "vendorlibdir") .values .map { |path| Pathname.new(path) } end |
.bindir ⇒ Object
17 18 19 |
# File 'lib/ocran/host_config_helper.rb', line 17 def bindir @bindir ||= Pathname.new(RbConfig::CONFIG["bindir"]) end |
.exe_extname ⇒ Object
37 38 39 |
# File 'lib/ocran/host_config_helper.rb', line 37 def exe_extname RbConfig::CONFIG["EXEEXT"] || ".exe" end |
.exec_prefix ⇒ Object
9 10 11 |
# File 'lib/ocran/host_config_helper.rb', line 9 def exec_prefix @exec_prefix ||= Pathname.new(RbConfig::CONFIG["exec_prefix"]) end |
.libdir ⇒ Object
21 22 23 |
# File 'lib/ocran/host_config_helper.rb', line 21 def libdir @libdir ||= Pathname.new(RbConfig::CONFIG["libdir"]) end |
.libruby_aliases ⇒ Object
31 32 33 34 35 |
# File 'lib/ocran/host_config_helper.rb', line 31 def libruby_aliases aliases = RbConfig::CONFIG["LIBRUBY_ALIASES"] return [] if aliases.nil? || aliases.empty? aliases.split.map { |name| Pathname.new(name) } end |
.libruby_so ⇒ Object
25 26 27 28 29 |
# File 'lib/ocran/host_config_helper.rb', line 25 def libruby_so name = RbConfig::CONFIG["LIBRUBY_SO"] return nil if name.nil? || name.empty? @libruby_so ||= Pathname.new(name) end |
.ruby_exe ⇒ Object
46 47 48 |
# File 'lib/ocran/host_config_helper.rb', line 46 def ruby_exe @ruby_exe ||= (RbConfig::CONFIG["ruby_install_name"] || "ruby") + exe_extname end |
.rubyw_exe ⇒ Object
41 42 43 44 |
# File 'lib/ocran/host_config_helper.rb', line 41 def rubyw_exe return nil unless Gem.win_platform? @rubyw_exe ||= (RbConfig::CONFIG["rubyw_install_name"] || "rubyw") + exe_extname end |
.sitelibdir ⇒ Object
13 14 15 |
# File 'lib/ocran/host_config_helper.rb', line 13 def sitelibdir @sitelibdir ||= Pathname.new(RbConfig::CONFIG["sitelibdir"]) end |