Skip to content
This repository
Browse code

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

  • Loading branch information...
commit b69063178fcfd943717a5670dfe5cbd1fa575e38 1 parent 1e7717c
Brian Ploetz authored
2  lib/generators/versionist/copy_api_version/copy_api_version_generator.rb
@@ -35,7 +35,7 @@ def validate_old_version
35 35
36 36 def copy_routes
37 37 in_root do
38   - if RUBY_VERSION =~ /1.8/ || RUBY_ENGINE != "ruby"
  38 + if RUBY_VERSION =~ /1.8/ || !defined?(RUBY_ENGINE) || RUBY_ENGINE != "ruby"
39 39 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}."
40 40 return
41 41 end
2  spec/generators/copy_api_version_generator_spec.rb
@@ -129,7 +129,7 @@
129 129 end
130 130
131 131 it "should copy correct api_version to config/routes.rb" do
132   - if RUBY_VERSION =~ /1.9/ && RUBY_ENGINE == "ruby"
  132 + if RUBY_VERSION =~ /1.9/ && defined?(RUBY_ENGINE) && RUBY_ENGINE == "ruby"
133 133 assert_file "config/routes.rb"
134 134 expected = <<-CONTENTS
135 135 Test::Application.routes.draw do

0 comments on commit b690631

Please sign in to comment.
Something went wrong with that request. Please try again.