helper for checking the current ruby runtime/engine/version
Ruby
Latest commit 23058e5 Jun 29, 2010 @phoet bump version
Failed to load latest commit information.
examples
lib add scopes Jun 29, 2010
test add scopes Jun 29, 2010
.gems add method_missing Jun 29, 2010
.rvmrc add method_missing Jun 29, 2010
rakefile.rb add gemspec and add minor doc Apr 21, 2010
readme.textile add scopes Jun 29, 2010
which_ruby.gemspec bump version Jun 29, 2010

readme.textile

About

which_ruby is a simple helper for checking running Ruby engines.

Usage

include WhichRuby in irb:

rvm use jruby
gem install which_ruby
irb
 > require 'which_ruby'
=> true 
 > include WhichRuby
=> Object

access the API:

 > ruby_type
=> :jruby
 > rt
=> :jruby
 > is_ruby_type? :jruby
=> true 
 > r? :jruby
=> true 
 > jruby?
=> true

define execution scopes:

 > ruby_scope(:jruby){"foo"}
=> "foo"
 > ruby_scope(:rbx){"foo"}
=> nil

Examples

Run the examples with different runtimes, jruby for example:

rvm use jruby
ruby examples/ex.rb

TODO

  • improve me!
  • more docs
  • more todos