summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThe Bundler Bot <bot@bundler.io>2017-07-07 17:57:33 +0000
committerThe Bundler Bot <bot@bundler.io>2017-07-07 17:57:33 +0000
commit59190fa216210b9f236128b58dea8fd4e45f3be8 (patch)
tree366a40ce999877676cefb43783d204a9ad8726a7
parent93c48c751bb5c7d5fcb5fb0f4ba586a059008e0f (diff)
parent37ddcfcd7a36ebc6aef93a3a15cc8b7bdf80c083 (diff)
downloadbundler-59190fa216210b9f236128b58dea8fd4e45f3be8.tar.gz
Auto merge of #5834 - koic:tweak_gemspec_template_when_using_ruby_2_x, r=segiddins
Tweak gemspec template when using Ruby 2.x ### What was the end-user problem that led to this PR? There are unnecessary magic comment for currently maintained Ruby 2.2, 2.3, and 2.4. ### What was your diagnosis of the problem? The default script encoding from Ruby 2.0 is UTF-8. https://bugs.ruby-lang.org/issues/6679 Ruby 1.9 is EOL, so I think that there is not much Gem to start developed using it. ### What is your fix for the problem, implemented in this PR? This PR removes magic comment when starting Gem development (i.e. `bundle gem`) with Ruby 2.0 or higher version.
-rw-r--r--lib/bundler/templates/newgem/newgem.gemspec.tt2
1 files changed, 2 insertions, 0 deletions
diff --git a/lib/bundler/templates/newgem/newgem.gemspec.tt b/lib/bundler/templates/newgem/newgem.gemspec.tt
index a7b7e5a9ee..4b746c74a9 100644
--- a/lib/bundler/templates/newgem/newgem.gemspec.tt
+++ b/lib/bundler/templates/newgem/newgem.gemspec.tt
@@ -1,4 +1,6 @@
+<%- 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"