diff --git a/lib/bundler/templates/newgem/newgem.gemspec.tt b/lib/bundler/templates/newgem/newgem.gemspec.tt index 116bb5fa626..113bf82eb2f 100644 --- a/lib/bundler/templates/newgem/newgem.gemspec.tt +++ b/lib/bundler/templates/newgem/newgem.gemspec.tt @@ -25,6 +25,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 bd7cdc170ac..3620035fe1d 100644 --- a/spec/bundler/gem_helper_spec.rb +++ b/spec/bundler/gem_helper_spec.rb @@ -77,6 +77,7 @@ def mock_build_message(name, version) 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 9f45fb665b5..4b5db87b005 100644 --- a/spec/commands/newgem_spec.rb +++ b/spec/commands/newgem_spec.rb @@ -196,7 +196,7 @@ def gem_skeleton_assertions(gem_name) 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.}")