Skip to content

Commit bda7d06

Browse files
committed
Allow a Gemfile.local for development, unclutter Rakefile
1 parent 359d5e7 commit bda7d06

File tree

3 files changed

+19
-21
lines changed

3 files changed

+19
-21
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
.rvmrc
33
*.gem
44
Gemfile.lock
5+
Gemfile.local
56
gemfiles/*.lock
67
pkg/*
78
spec/support/rails*/log/*

Gemfile

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
11
source "https://rubygems.org"
22

33
gemspec
4+
5+
local_gemfile = 'Gemfile.local'
6+
7+
if File.exist?(local_gemfile)
8+
eval(File.read(local_gemfile)) # rubocop:disable Lint/Eval
9+
end

Rakefile

Lines changed: 12 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -2,28 +2,19 @@ require "bundler/gem_tasks"
22
require "rubocop/rake_task"
33
RuboCop::RakeTask.new
44

5-
begin
6-
targeted_files = ARGV.drop(1)
7-
file_pattern = targeted_files.empty? ? "spec/**/*_spec.rb" : targeted_files
5+
targeted_files = ARGV.drop(1)
6+
file_pattern = targeted_files.empty? ? "spec/**/*_spec.rb" : targeted_files
87

9-
require "rspec/core"
10-
require "rspec/core/rake_task"
8+
require "rspec/core"
9+
require "rspec/core/rake_task"
1110

12-
RSpec::Core::RakeTask.new(:spec) do |t|
13-
t.pattern = FileList[file_pattern]
14-
end
15-
16-
RSpec.configure do |config|
17-
config.color = true
18-
config.formatter = :documentation
19-
end
20-
rescue LoadError
21-
require "spec/rake/spectask"
22-
23-
puts file_pattern
11+
RSpec::Core::RakeTask.new(:spec) do |t|
12+
t.pattern = FileList[file_pattern]
13+
end
2414

25-
Spec::Rake::SpecTask.new(:spec) do |t|
26-
t.pattern = FileList[file_pattern]
27-
t.spec_opts += ["--color"]
28-
end
15+
RSpec.configure do |config|
16+
config.color = true
17+
config.formatter = :documentation
2918
end
19+
20+
task default: [:spec, :rubocop]

0 commit comments

Comments
 (0)