diff options
author | Bundlerbot <bot@bundler.io> | 2019-07-06 15:01:34 +0000 |
---|---|---|
committer | Bundlerbot <bot@bundler.io> | 2019-07-06 15:01:34 +0000 |
commit | 7ecc54af67b5b15a7467c296b0712df1acddfeb2 (patch) | |
tree | b750fd90b3b4a6a89246e16d8548efa20f82f739 /lib | |
parent | 6ea383f8e2de364e72c3ac2c8be5cf688880e070 (diff) | |
parent | f8584fb864fc2e7e2527d5ba2c50907a38328c92 (diff) | |
download | bundler-7ecc54af67b5b15a7467c296b0712df1acddfeb2.tar.gz |
Merge #7222
7222: Remove `add_development_dependency` from new gems r=deivid-rodriguez a=deivid-rodriguez
### What was the end-user problem that led to this PR?
The problem was that a lot of gems in the wild use `add_development_dependency` for their development dependencies, but using `Gemfile`'s for that is more useful.
### What was your diagnosis of the problem?
My diagnosis was that the current situation is due to the fact that bundler generates a gem skeleton that uses `add_development_dependency` by default.
### What is your fix for the problem, implemented in this PR?
My fix is to stop using `add_development_dependency` in generated gems, and instead use the Gemfile.
### Why did you choose this fix out of the possible options?
I chose this fix because it encourages better practices.
Co-authored-by: David RodrÃguez <deivid.rodriguez@riseup.net>
Diffstat (limited to 'lib')
-rw-r--r-- | lib/bundler/templates/newgem/Gemfile.tt | 8 | ||||
-rw-r--r-- | lib/bundler/templates/newgem/newgem.gemspec.tt | 9 |
2 files changed, 8 insertions, 9 deletions
diff --git a/lib/bundler/templates/newgem/Gemfile.tt b/lib/bundler/templates/newgem/Gemfile.tt index 4cd2e40f4f..83878ec7f8 100644 --- a/lib/bundler/templates/newgem/Gemfile.tt +++ b/lib/bundler/templates/newgem/Gemfile.tt @@ -2,3 +2,11 @@ source "https://rubygems.org" # Specify your gem's dependencies in <%= config[:name] %>.gemspec gemspec + +gem "rake", "~> 12.0" +<%- if config[:ext] -%> +gem "rake-compiler" +<%- end -%> +<%- if config[:test] -%> +gem "<%= config[:test] %>", "~> <%= config[:test_framework_version] %>" +<%- end -%> diff --git a/lib/bundler/templates/newgem/newgem.gemspec.tt b/lib/bundler/templates/newgem/newgem.gemspec.tt index 7feae6b18c..9bb3d0ff50 100644 --- a/lib/bundler/templates/newgem/newgem.gemspec.tt +++ b/lib/bundler/templates/newgem/newgem.gemspec.tt @@ -31,13 +31,4 @@ Gem::Specification.new do |spec| <%- if config[:ext] -%> spec.extensions = ["ext/<%= config[:underscored_name] %>/extconf.rb"] <%- end -%> - - spec.add_development_dependency "bundler", "~> <%= config[:bundler_version] %>" - spec.add_development_dependency "rake", "~> 12.0" -<%- if config[:ext] -%> - spec.add_development_dependency "rake-compiler" -<%- end -%> -<%- if config[:test] -%> - spec.add_development_dependency "<%= config[:test] %>", "~> <%= config[:test_framework_version] %>" -<%- end -%> end |