Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions Manifest.txt
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,7 @@ bundler/lib/bundler/templates/newgem/lib/newgem.rb.tt
bundler/lib/bundler/templates/newgem/lib/newgem/version.rb.tt
bundler/lib/bundler/templates/newgem/newgem.gemspec.tt
bundler/lib/bundler/templates/newgem/rspec.tt
bundler/lib/bundler/templates/newgem/rubocop.yml.tt
bundler/lib/bundler/templates/newgem/spec/newgem_spec.rb.tt
bundler/lib/bundler/templates/newgem/spec/spec_helper.rb.tt
bundler/lib/bundler/templates/newgem/test/minitest/newgem_test.rb.tt
Expand Down
1 change: 1 addition & 0 deletions bundler/lib/bundler/cli/gem.rb
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,7 @@ def run
"and the Ruby Style Guides (https://github.com/rubocop-hq/ruby-style-guide).")
config[:rubocop] = true
Bundler.ui.info "RuboCop enabled in config"
templates.merge!("rubocop.yml.tt" => ".rubocop.yml")
end

templates.merge!("exe/newgem.tt" => "exe/#{name}") if config[:exe]
Expand Down
7 changes: 7 additions & 0 deletions bundler/lib/bundler/templates/newgem/rubocop.yml.tt
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
Style/StringLiterals:
Enabled: true
EnforcedStyle: double_quotes

Style/StringLiteralsInInterpolation:
Enabled: true
EnforcedStyle: double_quotes
8 changes: 8 additions & 0 deletions bundler/spec/commands/newgem_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -169,6 +169,10 @@ def gem_skeleton_assertions
rubocop_dep = builder.dependencies.find {|d| d.name == "rubocop" }
expect(rubocop_dep).not_to be_nil
end

it "generates a default .rubocop.yml" do
expect(bundled_app("#{gem_name}/.rubocop.yml")).to exist
end
end

shared_examples_for "--no-rubocop flag" do
Expand All @@ -192,6 +196,10 @@ def gem_skeleton_assertions
rubocop_dep = builder.dependencies.find {|d| d.name == "rubocop" }
expect(rubocop_dep).to be_nil
end

it "doesn't generate a default .rubocop.yml" do
expect(bundled_app("#{gem_name}/.rubocop.yml")).to_not exist
end
end

shared_examples_for "CI config is absent" do
Expand Down