Permalink
Browse files

Add explicity ruby 2.1 support

Various parts of the backtrace rewriting code require an explicit
version of Ruby to be set, which requires hard coding for every minor
Ruby release.

Going forward we should reverse the check in `instance_exec.rb` to
target older ruby versions not newer ones
  • Loading branch information...
1 parent c8a3257 commit 854313ae5a6713edd0de0fac20738e8dbada1421 @chrismdp chrismdp committed Feb 28, 2014
Showing with 6 additions and 1 deletion.
  1. +1 −0 cucumber.yml
  2. +3 −0 gem_tasks/cucumber.rake
  3. +1 −1 lib/cucumber/core_ext/instance_exec.rb
  4. +1 −0 lib/cucumber/platform.rb
View
@@ -13,6 +13,7 @@ jruby_win: <%= std_opts %> --tags ~@wire CUCUMBER_FORWARD_SLASH_PATHS=true
windows_mri: <%= std_opts %> --tags ~@jruby --tags ~@wire --tags ~@needs-many-fonts CUCUMBER_FORWARD_SLASH_PATHS=true
ruby_1_9: <%= std_opts %> --tags ~@jruby
ruby_2_0: <%= std_opts %> --tags ~@jruby
+ruby_2_1: <%= std_opts %> --tags ~@jruby
wip: --wip <%= wip_opts %> features
none: --format pretty
rerun: <%= rerun_opts %> --format rerun --out rerun.txt --strict --tags ~@wip --tag ~@wip-new-core
View
@@ -11,6 +11,9 @@ class Cucumber::Rake::Task
'ruby_1_9'
elsif Cucumber::RUBY_2_0
'ruby_2_0'
+ elsif Cucumber::RUBY_2_1
+ 'ruby_2_1'
+ end
end
end
end
@@ -47,7 +47,7 @@ def cucumber_run_with_backtrace_filtering(pseudo_method)
end
end
- INSTANCE_EXEC_OFFSET = (Cucumber::RUBY_2_0 || Cucumber::RUBY_1_9 || Cucumber::JRUBY) ? -3 : -4
+ INSTANCE_EXEC_OFFSET = (Cucumber::RUBY_2_1 || Cucumber::RUBY_2_0 || Cucumber::RUBY_1_9 || Cucumber::JRUBY) ? -3 : -4
def replace_instance_exec_invocation_line!(backtrace, instance_exec_invocation_line, pseudo_method)
return if Cucumber.use_full_backtrace
View
@@ -14,6 +14,7 @@ module Cucumber
WINDOWS_MRI = WINDOWS && !JRUBY && !IRONRUBY
RAILS = defined?(Rails)
RUBY_BINARY = File.join(RbConfig::CONFIG['bindir'], RbConfig::CONFIG['ruby_install_name'])
+ RUBY_2_1 = RUBY_VERSION =~ /^2\.1/
RUBY_2_0 = RUBY_VERSION =~ /^2\.0/
RUBY_1_9 = RUBY_VERSION =~ /^1\.9/

0 comments on commit 854313a

Please sign in to comment.