Method: Object#ruby_exe_options

Defined in:
lib/extensions/mspec/mspec/helpers/ruby_exe.rb

#ruby_exe_options(option) ⇒ Object



69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
# File 'lib/extensions/mspec/mspec/helpers/ruby_exe.rb', line 69

def ruby_exe_options(option)
  case option
  when :env
    ENV['RUBY_EXE']
  when :engine
    case RUBY_NAME
    when 'rbx'
      if SpecGuard.ruby_version < "1.9"
        "bin/rbx"
      else
        "bin/rbx -X19"
      end
    when 'jruby'
      "bin/jruby"
    when 'maglev'
      "maglev-ruby"
    when 'ironruby'
      "ir"
    end
  when :name
    bin = RUBY_NAME + (RbConfig::CONFIG['EXEEXT'] || RbConfig::CONFIG['exeext'] || '')
    File.join(".", bin)
  when :install_name
    bin = RbConfig::CONFIG["RUBY_INSTALL_NAME"] || RbConfig::CONFIG["ruby_install_name"]
    bin << (RbConfig::CONFIG['EXEEXT'] || RbConfig::CONFIG['exeext'] || '')
    File.join(RbConfig::CONFIG['bindir'], bin)
  end
end