Sha256: d1ca69a5302a9d82d0c6924abc8ddb313756b43d5f6980f37c27cc795d682f39

Contents?: true

Size: 573 Bytes

Versions: 3

Compression:

Stored size: 573 Bytes

Contents

require 'rbconfig'

module RbConfig
  cmd = File.join(CONFIG['bindir'], CONFIG['ruby_install_name'])
  CONFIG['ruby_command'] = cmd.sub(/.*\s.*/m, '"\&"')

  def program_name
    return (defined?(ExerbRuntime) && ExerbRuntime.filepath) || $0
  end

  def self_invoke_command
    cmd = File.expand_path(program_name)
    cmd.sub(/.*\s.*/m, '"\&"')
    ext = Config::CONFIG['EXEEXT']
    unless ext.length != 0 && program_name =~ /#{ext}$/
      cmd = CONFIG['ruby_command'] + ' ' + cmd
    end
    return cmd
  end

  module_function :program_name, :self_invoke_command
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
gnn-rblibs-0.0.4 lib/rbconfig/command.rb
gnn-rblibs-0.0.3 lib/rbconfig/command.rb
gnn-rblibs-0.0.1 lib/rbconfig/command.rb