Skip to content

Instantly share code, notes, and snippets.

@mjgiarlo
Created September 29, 2017 22:54
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mjgiarlo/ee079cd476b94066886f6f541e624a5b to your computer and use it in GitHub Desktop.
Save mjgiarlo/ee079cd476b94066886f6f541e624a5b to your computer and use it in GitHub Desktop.
diff --git a/Rakefile b/Rakefile
old mode 100644
new mode 100755
index a0ec74f..e5f6985
--- a/Rakefile
+++ b/Rakefile
@@ -9,22 +9,16 @@ Sulbib::Application.load_tasks
task default: [:ci]
desc 'Continuous integration task run on travis'
-task ci: [:environment, :rubocop] do
- if Rails.env.test?
- Rake::Task['db:setup'].invoke # not db:migrate, use the dang schema!
- Rake::Task['spec'].invoke
- else
- system 'rake ci RAILS_ENV=test'
- end
+task ci: [:rubocop] do
+ Rake::Task['spec'].invoke
end
begin
require 'rspec/core/rake_task'
- RSpec::Core::RakeTask.new
- namespace :spec do
- desc 'run only data-integration tests against live ScienceWire (excluded by default)'
- RSpec::Core::RakeTask.new('data-integration') { |t| t.rspec_opts = '--tag data-integration' }
- end
+ RSpec::Core::RakeTask.new(:spec)
+
+ desc 'run only data-integration tests against live ScienceWire (excluded by default)'
+ RSpec::Core::RakeTask.new(:spec_with_data_integration) { |t| t.rspec_opts = '--tag data-integration' }
rescue LoadError
puts 'Unable to load RSpec.'
end
@@ -33,15 +27,8 @@ desc 'Run rubocop on ruby files in a patch on master'
task :rubocop do
begin
require 'rubocop/rake_task'
- RuboCop::RakeTask.new
+ RuboCop::RakeTask.new(:rubocop)
rescue LoadError
puts 'Unable to load RuboCop.'
end
end
-
-desc 'Run rubocop on ruby files in a patch on master'
-task :rubocop_patch do
- if Rails.env.test? || Rails.env.development?
- system "git diff --name-only HEAD..master | grep -E -i 'rake|*.rb|*.erb' | xargs bundle exec rubocop"
- end
-end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment