summaryrefslogtreecommitdiff
path: root/lib/bundler/templates
diff options
context:
space:
mode:
authorAndre Arko <andre@arko.net>2015-04-13 21:23:01 -0700
committerAndre Arko <andre@arko.net>2015-04-13 22:50:16 -0700
commite41edd133a737ed95581a4e850076c7160289269 (patch)
tree896f72d91172eea039efd8052dc1362ee5a05402 /lib/bundler/templates
parent3c3d5c635c23abd43c1e2f1b72d55f6d38956119 (diff)
downloadbundler-e41edd133a737ed95581a4e850076c7160289269.tar.gz
Merge tag 'v1.9.4'
Version 1.9.4 Conflicts: lib/bundler/installer.rb lib/bundler/match_platform.rb lib/bundler/source/rubygems.rb
Diffstat (limited to 'lib/bundler/templates')
-rw-r--r--lib/bundler/templates/newgem/newgem.gemspec.tt12
1 files changed, 8 insertions, 4 deletions
diff --git a/lib/bundler/templates/newgem/newgem.gemspec.tt b/lib/bundler/templates/newgem/newgem.gemspec.tt
index 4749a9a70e..e630801026 100644
--- a/lib/bundler/templates/newgem/newgem.gemspec.tt
+++ b/lib/bundler/templates/newgem/newgem.gemspec.tt
@@ -16,6 +16,14 @@ Gem::Specification.new do |spec|
spec.license = "MIT"
<%- end -%>
+ # Prevent pushing this gem to RubyGems.org by setting 'allowed_push_host', or
+ # delete this section to allow pushing this gem to any host.
+ if spec.respond_to?(:metadata)
+ spec.metadata['allowed_push_host'] = "TODO: Set to 'http://mygemserver.com'"
+ else
+ raise "RubyGems 2.0 or newer is required to protect against public gem pushes."
+ end
+
spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
spec.bindir = "exe"
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
@@ -24,10 +32,6 @@ Gem::Specification.new do |spec|
spec.extensions = ["ext/<%=config[:underscored_name]%>/extconf.rb"]
<%- end -%>
- if spec.respond_to?(:metadata)
- spec.metadata['allowed_push_host'] = "TODO: Set to 'http://mygemserver.com' to prevent pushes to rubygems.org, or delete to allow pushes to any server."
- end
-
spec.add_development_dependency "bundler", "~> <%= config[:bundler_version] %>"
spec.add_development_dependency "rake", "~> 10.0"
<%- if config[:ext] -%>