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

Class Method Details

.all_core_dirObject



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

.bindirObject



17
18
19
# File 'lib/ocran/host_config_helper.rb', line 17

def bindir
  @bindir ||= Pathname.new(RbConfig::CONFIG["bindir"])
end

.exe_extnameObject



37
38
39
# File 'lib/ocran/host_config_helper.rb', line 37

def exe_extname
  RbConfig::CONFIG["EXEEXT"] || ".exe"
end

.exec_prefixObject



9
10
11
# File 'lib/ocran/host_config_helper.rb', line 9

def exec_prefix
  @exec_prefix ||= Pathname.new(RbConfig::CONFIG["exec_prefix"])
end

.libdirObject



21
22
23
# File 'lib/ocran/host_config_helper.rb', line 21

def libdir
  @libdir ||= Pathname.new(RbConfig::CONFIG["libdir"])
end

.libruby_aliasesObject



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_soObject



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_exeObject



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_exeObject



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

.sitelibdirObject



13
14
15
# File 'lib/ocran/host_config_helper.rb', line 13

def sitelibdir
  @sitelibdir ||= Pathname.new(RbConfig::CONFIG["sitelibdir"])
end