Permalink
Browse files

Issue #6: Need to check if RUBY_ENGINE is defined for 1.8.7

  • Loading branch information...
1 parent 1e7717c commit b69063178fcfd943717a5670dfe5cbd1fa575e38 Brian Ploetz committed Apr 20, 2012
View
2 lib/generators/versionist/copy_api_version/copy_api_version_generator.rb
@@ -35,7 +35,7 @@ def validate_old_version
def copy_routes
in_root do
- if RUBY_VERSION =~ /1.8/ || RUBY_ENGINE != "ruby"
+ if RUBY_VERSION =~ /1.8/ || !defined?(RUBY_ENGINE) || RUBY_ENGINE != "ruby"
log "ERROR: Cannot copy routes as this feature relies on the Ripper library, which is only available in MRI 1.9. You are running #{RUBY_ENGINE} #{RUBY_VERSION}."
return
end
View
2 spec/generators/copy_api_version_generator_spec.rb
@@ -129,7 +129,7 @@
end
it "should copy correct api_version to config/routes.rb" do
- if RUBY_VERSION =~ /1.9/ && RUBY_ENGINE == "ruby"
+ if RUBY_VERSION =~ /1.9/ && defined?(RUBY_ENGINE) && RUBY_ENGINE == "ruby"
assert_file "config/routes.rb"
expected = <<-CONTENTS
Test::Application.routes.draw do

0 comments on commit b690631

Please sign in to comment.