Object
Detect the current ruby engine.
If the current ruby engine cannot be detected, the return RubyEngine::Unknown
# File lib/launchy/detect/ruby_engine.rb, line 11 11: def self.detect( ruby_engine = RubyEngine.new ) 12: found = find_child( :is_current_engine?, ruby_engine.to_s ) 13: return found if found 14: raise NotFoundError, "#{ruby_engine_error_message( ruby_engine )} #{Launchy.bug_report_message}" 15: end
# File lib/launchy/detect/ruby_engine.rb, line 29 29: def self.is_current_engine?( ruby_engine ) 30: return ruby_engine == self.engine_name 31: end
# File lib/launchy/detect/ruby_engine.rb, line 34 34: def self.jruby?() self == Jruby; end
# File lib/launchy/detect/ruby_engine.rb, line 36 36: def self.macruby?() self == MacRuby; end
# File lib/launchy/detect/ruby_engine.rb, line 33 33: def self.mri?() self == Mri; end
# File lib/launchy/detect/ruby_engine.rb, line 40 40: def initialize( ruby_engine = Launchy.ruby_engine ) 41: if ruby_engine then 42: @ruby_engine = ruby_engine 43: else 44: @ruby_engine = defined?( RUBY_ENGINE ) ? RUBY_ENGINE : "ruby" 45: end 46: end
# File lib/launchy/detect/ruby_engine.rb, line 35 35: def self.rbx?() self == Rbx; end
# File lib/launchy/detect/ruby_engine.rb, line 17 17: def self.ruby_engine_error_message( ruby_engine ) 18: msg = "Unkonwn RUBY_ENGINE " 19: if ruby_engine then 20: msg += " '#{ruby_engine}'." 21: elsif defined?( RUBY_ENGINE ) then 22: msg += " '#{RUBY_ENGINE}'." 23: else 24: msg = "RUBY_ENGINE not defined for #{RUBY_DESCRIPTION}." 25: end 26: return msg 27: end
Disabled; run with --debug to generate this.
Generated with the Darkfish Rdoc Generator 1.1.6.