Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Issue #6: Only copy routes in MRI 1.9

  • Loading branch information...
commit 1e7717c247208985bdaa49ce92f5e4bf492878c4 1 parent c9a68ec
Brian Ploetz authored
View
4 lib/generators/versionist/copy_api_version/copy_api_version_generator.rb
@@ -35,8 +35,8 @@ def validate_old_version
def copy_routes
in_root do
- if RUBY_VERSION =~ /1.8/
- log "ERROR: Cannot copy routes as this feature relies on the Ripper library, which is only available in Ruby 1.9. You are running Ruby #{RUBY_VERSION}"
+ if RUBY_VERSION =~ /1.8/ || 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
parser = YARD::Parser::SourceParser.parse_string(File.read("config/routes.rb"))
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/
+ if RUBY_VERSION =~ /1.9/ && RUBY_ENGINE == "ruby"
assert_file "config/routes.rb"
expected = <<-CONTENTS
Test::Application.routes.draw do
Please sign in to comment.
Something went wrong with that request. Please try again.