diff --git a/.travis.yml b/.travis.yml index bf922125..6b91070e 100644 --- a/.travis.yml +++ b/.travis.yml @@ -17,7 +17,7 @@ install: - bundle install --retry=3 script: - - env CAPTURE_STDERR=false bundle exec rake + - env CAPTURE_STDERR=false bundle exec rake ci env: - "RAILS_VERSION=4.0" diff --git a/Rakefile b/Rakefile index 64408ab4..58a49598 100644 --- a/Rakefile +++ b/Rakefile @@ -11,19 +11,27 @@ begin rescue LoadError else Rake::Task[:rubocop].clear if Rake::Task.task_defined?(:rubocop) - if !defined?(::Rubinius) + require 'rbconfig' + # https://github.com/bundler/bundler/blob/1b3eb2465a/lib/bundler/constants.rb#L2 + windows_platforms = /(msdos|mswin|djgpp|mingw)/ + if RbConfig::CONFIG['host_os'] =~ windows_platforms + desc 'No-op rubocop on Windows-- unsupported platform' + task :rubocop do + puts 'Skipping rubocop on Windows' + end + elsif defined?(::Rubinius) + desc 'No-op rubocop to avoid rbx segfault' + task :rubocop do + puts 'Skipping rubocop on rbx due to segfault' + puts 'https://github.com/rubinius/rubinius/issues/3499' + end + else Rake::Task[:rubocop].clear if Rake::Task.task_defined?(:rubocop) desc 'Execute rubocop' RuboCop::RakeTask.new(:rubocop) do |task| task.options = ['--rails', '--display-cop-names', '--display-style-guide'] task.fail_on_error = true end - else - desc 'No-op rubocop to avoid rbx segfault' - task :rubocop do - puts 'Skipping rubocop on rbx due to segfault' - puts 'https://github.com/rubinius/rubinius/issues/3499' - end end end @@ -37,3 +45,6 @@ Rake::TestTask.new do |t| end task default: [:test, :rubocop] + +desc 'CI test task' +task :ci => [:default] diff --git a/appveyor.yml b/appveyor.yml index 771ff243..28c08a40 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -21,6 +21,6 @@ install: - bundle install --retry=3 test_script: - - bundle exec rake test + - bundle exec rake ci build: off