diff options
author | The Bundler Bot <bot@bundler.io> | 2017-07-31 21:26:49 +0000 |
---|---|---|
committer | The Bundler Bot <bot@bundler.io> | 2017-07-31 21:26:49 +0000 |
commit | d3624686666273bc0d46b3af6a6c5a8c18459dd9 (patch) | |
tree | e6de67d498d1e689fe23a90e267fa56aec62992f | |
parent | 248d74a0ce66176d7ec74871e5d1d01428648e8e (diff) | |
parent | a35be68e6fc99af42beda2d57227f8dec7d67442 (diff) | |
download | bundler-d3624686666273bc0d46b3af6a6c5a8c18459dd9.tar.gz |
Auto merge of #5907 - roberts1000:fix-magic-comment-style-for-gemspec-template, r=colby-swandale
Add new line after newgem gemspec template
### What was the end-user problem that led to this PR?
When using `bundle gem` to create a new gem, the created gemspec file starts with
```
# coding: utf-8
lib = File.expand_path('../lib', __FILE__)
```
Rubocop recommends having a blank line after magic comments (like `# coding: utf-8`).
### What was your diagnosis of the problem?
The rubocop style guide recommends having a blank line after "magic comments" ([see link](https://github.com/bbatsov/ruby-style-guide#separate-magic-comments-from-code)). The main bundler.gemspec follows this recommendation, but the .gemspec, that is created for new gems, does not.
### What is your fix for the problem, implemented in this PR?
Update the template file to have a blank line after the magic comment.
### Why did you choose this fix out of the possible options?
It's what rubocop wants.
-rw-r--r-- | lib/bundler/templates/newgem/newgem.gemspec.tt | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/lib/bundler/templates/newgem/newgem.gemspec.tt b/lib/bundler/templates/newgem/newgem.gemspec.tt index 4b746c74a9..9a87a1374a 100644 --- a/lib/bundler/templates/newgem/newgem.gemspec.tt +++ b/lib/bundler/templates/newgem/newgem.gemspec.tt @@ -1,6 +1,7 @@ <%- if RUBY_VERSION < "2.0.0" -%> # coding: utf-8 <%- end -%> + lib = File.expand_path("../lib", __FILE__) $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib) require "<%= config[:namespaced_path] %>/version" |