Skip to content

Commit

Permalink
Allow a Gemfile.local for development, unclutter Rakefile
Browse files Browse the repository at this point in the history
  • Loading branch information
dmke committed Dec 2, 2018
1 parent 359d5e7 commit bda7d06
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 21 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
.rvmrc
*.gem
Gemfile.lock
Gemfile.local
gemfiles/*.lock
pkg/*
spec/support/rails*/log/*
Expand Down
6 changes: 6 additions & 0 deletions Gemfile
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
source "https://rubygems.org"

gemspec

local_gemfile = 'Gemfile.local'

if File.exist?(local_gemfile)
eval(File.read(local_gemfile)) # rubocop:disable Lint/Eval
end
33 changes: 12 additions & 21 deletions Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,28 +2,19 @@ require "bundler/gem_tasks"
require "rubocop/rake_task"
RuboCop::RakeTask.new

begin
targeted_files = ARGV.drop(1)
file_pattern = targeted_files.empty? ? "spec/**/*_spec.rb" : targeted_files
targeted_files = ARGV.drop(1)
file_pattern = targeted_files.empty? ? "spec/**/*_spec.rb" : targeted_files

require "rspec/core"
require "rspec/core/rake_task"
require "rspec/core"
require "rspec/core/rake_task"

RSpec::Core::RakeTask.new(:spec) do |t|
t.pattern = FileList[file_pattern]
end

RSpec.configure do |config|
config.color = true
config.formatter = :documentation
end
rescue LoadError
require "spec/rake/spectask"

puts file_pattern
RSpec::Core::RakeTask.new(:spec) do |t|
t.pattern = FileList[file_pattern]
end

Spec::Rake::SpecTask.new(:spec) do |t|
t.pattern = FileList[file_pattern]
t.spec_opts += ["--color"]
end
RSpec.configure do |config|
config.color = true
config.formatter = :documentation
end

task default: [:spec, :rubocop]

0 comments on commit bda7d06

Please sign in to comment.