diff --git a/Rakefile b/Rakefile index af0d076680..15257970ec 100644 --- a/Rakefile +++ b/Rakefile @@ -9,7 +9,12 @@ Dir['gem_tasks/**/*.rake'].each { |rake| load rake } require 'rubocop/rake_task' RuboCop::RakeTask.new -task :default => [:spec, :rubocop, :cucumber] +require 'cucumber/rake/task' +Cucumber::Rake::Task.new do |t| + t.profile = 'ruby' if Cucumber::RUBY +end + +default_tasks = [:spec, :rubocop, :cucumber] if ENV['TRAVIS'] ENV['SIMPLECOV'] = 'ci' @@ -18,8 +23,10 @@ if ENV['TRAVIS'] require 'coveralls/rake/task' Coveralls::RakeTask.new - task :default => [:spec, :rubocop, :cucumber, 'coveralls:push'] + default_tasks << 'coveralls:push' end +task :default => default_tasks + require 'rake/clean' CLEAN.include %w(**/*.{log,pyc,rbc,tgz} doc) diff --git a/cucumber.yml b/cucumber.yml index bab8059171..b5d32778da 100644 --- a/cucumber.yml +++ b/cucumber.yml @@ -13,9 +13,7 @@ default: <%= std_opts %> --tags 'not @jruby' jruby: <%= std_opts %> --tags 'not @wire' jruby_win: <%= std_opts %> --tags 'not @wire' CUCUMBER_FORWARD_SLASH_PATHS=true windows_mri: <%= std_opts %> --tags 'not @jruby and not @wire and not @needs-many-fonts' CUCUMBER_FORWARD_SLASH_PATHS=true -ruby_1_9: <%= std_opts %> --tags 'not @jruby' -ruby_2_0: <%= std_opts %> --tags 'not @jruby' -ruby_2_1: <%= std_opts %> --tags 'not @jruby' +ruby: <%= std_opts %> --tags 'not @jruby' wip: --wip <%= wip_opts %> features <%= cucumber_pro_opts %> none: --format pretty --format Cucumber::Pro --out /dev/null rerun: <%= rerun_opts %> --format rerun --out rerun.txt --strict --tags 'not @wip-new-core' <%= cucumber_pro_opts %> diff --git a/gem_tasks/cucumber.rake b/gem_tasks/cucumber.rake deleted file mode 100644 index 599b7373d4..0000000000 --- a/gem_tasks/cucumber.rake +++ /dev/null @@ -1,26 +0,0 @@ -# frozen_string_literal: true -require 'cucumber/rake/task' -require 'cucumber/platform' - -class Cucumber::Rake::Task - def set_profile_for_current_ruby - self.profile = if Cucumber::JRUBY - Cucumber::WINDOWS ? 'jruby_win' : 'jruby' - elsif Cucumber::WINDOWS_MRI - 'windows_mri' - elsif Cucumber::RUBY_1_9 - 'ruby_1_9' - elsif Cucumber::RUBY_2_0 - 'ruby_2_0' - elsif Cucumber::RUBY_2_1 - 'ruby_2_1' - end - end -end - -Cucumber::Rake::Task.new(:features) do |t| - t.fork = true - t.set_profile_for_current_ruby -end - -task :cucumber => :features diff --git a/lib/cucumber/platform.rb b/lib/cucumber/platform.rb index fcfe60b319..c9f08016de 100644 --- a/lib/cucumber/platform.rb +++ b/lib/cucumber/platform.rb @@ -11,9 +11,7 @@ module Cucumber LIBDIR = File.expand_path(File.dirname(__FILE__) + '/../../lib') RAILS = defined?(Rails) RUBY_BINARY = File.join(RbConfig::CONFIG['bindir'], RbConfig::CONFIG['ruby_install_name']) - RUBY_2_2 = RUBY_VERSION =~ /^2\.2/ - RUBY_2_1 = RUBY_VERSION =~ /^2\.1/ - RUBY_2_3 = RUBY_VERSION =~ /^2\.3/ + RUBY = defined? RUBY_VERSION class << self attr_accessor :use_full_backtrace