Skip to content

Commit

Permalink
Refactoring for Rakefile to display cucumber task by "rake -T". (#1088)
Browse files Browse the repository at this point in the history
* Refactoring for Rakefile to display cucumber task by "rake -T".
* Remove gem_tasks/cucumber.rake.
* Unify `ruby_x_y` profiles to ruby.
* Drop unsupported JRuby and Windows from the logic.
  • Loading branch information
junaruga authored Mar 12, 2017
1 parent 057c3dc commit f13313a
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 34 deletions.
11 changes: 9 additions & 2 deletions Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand All @@ -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)
4 changes: 1 addition & 3 deletions cucumber.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 %>
26 changes: 0 additions & 26 deletions gem_tasks/cucumber.rake

This file was deleted.

4 changes: 1 addition & 3 deletions lib/cucumber/platform.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit f13313a

Please sign in to comment.