diff options
-rw-r--r-- | lib/bundler/templates/newgem/newgem.gemspec.tt | 4 | ||||
-rw-r--r-- | spec/bundler/gem_helper_spec.rb | 1 | ||||
-rw-r--r-- | spec/commands/newgem_spec.rb | 2 |
3 files changed, 6 insertions, 1 deletions
diff --git a/lib/bundler/templates/newgem/newgem.gemspec.tt b/lib/bundler/templates/newgem/newgem.gemspec.tt index cb5d1ae3e6..faf6f7bbc5 100644 --- a/lib/bundler/templates/newgem/newgem.gemspec.tt +++ b/lib/bundler/templates/newgem/newgem.gemspec.tt @@ -23,6 +23,10 @@ Gem::Specification.new do |spec| # to allow pushing to a single host or delete this section to allow pushing to any host. if spec.respond_to?(:metadata) spec.metadata["allowed_push_host"] = "TODO: Set to 'http://mygemserver.com'" + + spec.metadata["homepage_uri"] = spec.homepage + spec.metadata["source_code_uri"] = "TODO: Put your gem's public repo URL here." + spec.metadata["changelog_uri"] = "TODO: Put your gem's CHANGELOG.md URL here." else raise "RubyGems 2.0 or newer is required to protect against " \ "public gem pushes." diff --git a/spec/bundler/gem_helper_spec.rb b/spec/bundler/gem_helper_spec.rb index c36204c542..a627129fe3 100644 --- a/spec/bundler/gem_helper_spec.rb +++ b/spec/bundler/gem_helper_spec.rb @@ -77,6 +77,7 @@ RSpec.describe Bundler::GemHelper do before(:each) do content = app_gemspec_content.gsub("TODO: ", "") content.sub!(/homepage\s+= ".*"/, 'homepage = ""') + content.gsub!(/spec\.metadata.+\n/, "") File.open(app_gemspec_path, "w") {|file| file << content } end diff --git a/spec/commands/newgem_spec.rb b/spec/commands/newgem_spec.rb index 1a3e8236b6..97605bf526 100644 --- a/spec/commands/newgem_spec.rb +++ b/spec/commands/newgem_spec.rb @@ -196,7 +196,7 @@ RSpec.describe "bundle gem" do process_file(bundled_app("newgem", "newgem.gemspec")) do |line| # Simulate replacing TODOs with real values case line - when /spec\.metadata\['allowed_push_host'\]/, /spec\.homepage/ + when /spec\.metadata\["(?:allowed_push_host|homepage_uri|source_code_uri|changelog_uri)"\]/, /spec\.homepage/ line.gsub(/\=.*$/, "= 'http://example.org'") when /spec\.summary/ line.gsub(/\=.*$/, "= %q{A short summary of my new gem.}") |