Skip to content

Commit

Permalink
remove ree
Browse files Browse the repository at this point in the history
  • Loading branch information
phoet committed Jun 29, 2010
1 parent 143092b commit 48a7c65
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 10 deletions.
5 changes: 3 additions & 2 deletions examples/ex.rb
Expand Up @@ -4,9 +4,10 @@

include WhichRuby

%w{jruby ruby ree rubinius}.each do |ru|
puts "running on #{ruby_type} #{ruby_description}"
%w{jruby ruby rubinius}.each do |ru|
puts "checking #{ru}?"
check = send(:"#{ru}?")
puts " #{ru} is #{check}"
puts " with version #{version}" if check
puts " with version #{ruby_version}" if check
end
6 changes: 3 additions & 3 deletions lib/which_ruby.rb
@@ -1,10 +1,10 @@
module WhichRuby

@@mappings = {
:rbx => :rubinious,
:rubinius => :rbx,
}

@@rubies = [:ruby, :jruby, :rubinius, :ree]
@@rubies = [:ruby, :jruby, :rbx]

def ruby_type
return :"#{ruby_engine.downcase}" unless ruby_engine.nil?
Expand Down Expand Up @@ -73,7 +73,7 @@ def strip_sym(sym)
end

def contains_ruby_type?(name)
@@rubies.include? name
@@rubies.include?(@@mappings[name] || name)
end

end
4 changes: 2 additions & 2 deletions readme.textile
@@ -1,10 +1,10 @@
h2. About

*which_ruby* is a simple helper for checking running Ruby engine.
*which_ruby* is a simple helper for checking running Ruby engines.

h2. Usage

include WhichRuby:
include WhichRuby in irb:
<pre>
rvm use jruby
gem install which_ruby
Expand Down
7 changes: 6 additions & 1 deletion test/test_which_ruby.rb
Expand Up @@ -16,7 +16,7 @@ def test_r_type_from_engine

def test_r_type_from_description
@helper.stubs(:ruby_engine).returns(nil)
@helper.stubs(:ruby_description).returns("ruby 1.8.7 (2010-01-10 patchlevel 249) [i686-darwin10.2.0]")
@helper.stubs(:ruby_description).returns("ruby 1.8.7 (2010-04-19 patchlevel 253) [i686-darwin10.4.0], MBARI 0x6770, Ruby Enterprise Edition 2010.02")

assert_equal(:ruby, @helper.ruby_type)
end
Expand All @@ -30,6 +30,11 @@ def test_which_r?
assert_equal(true, @helper.r?(:ruby))
end

def test_which_r_with_mapping?
@helper.stubs(:ruby_engine).returns("rbx")
assert_equal(true, @helper.r?(:rubinius))
end

def test_respond_to?
@helper.stubs(:ruby_engine).returns("jruby")
assert_equal(true, @helper.respond_to?(:jruby?))
Expand Down
4 changes: 2 additions & 2 deletions which_ruby.gemspec
@@ -1,13 +1,13 @@
Gem::Specification.new do |s|
s.name = 'which_ruby'
s.version = '0.0.1'
s.version = '0.0.2'
s.rubyforge_project = 'none'

s.author = 'Peter Schröder'
s.description = 'which_ruby is a simple helper for checking running Ruby engine'
s.email = 'phoetmail@googlemail.com'
s.homepage = 'http://github.com/phoet/which_ruby'
s.summary = 'include which_ruby module and use is_ruby_type? or ruby_type'
s.summary = 'include which_ruby module and use is_ruby_type? or ruby_type or jruby?'

s.has_rdoc = true
s.rdoc_options = ['-a', '--inline-source', '--charset=UTF-8']
Expand Down

0 comments on commit 48a7c65

Please sign in to comment.