diff options
-rw-r--r-- | lib/bundler/cli.rb | 2 | ||||
-rw-r--r-- | lib/bundler/cli/gem.rb | 3 | ||||
-rw-r--r-- | lib/bundler/env.rb | 1 | ||||
-rw-r--r-- | lib/bundler/templates/newgem/README.md.tt | 2 | ||||
-rw-r--r-- | spec/bundler/env_spec.rb | 1 | ||||
-rw-r--r-- | spec/commands/newgem_spec.rb | 29 |
6 files changed, 35 insertions, 3 deletions
diff --git a/lib/bundler/cli.rb b/lib/bundler/cli.rb index 94a630a9f1..e729cd3bb2 100644 --- a/lib/bundler/cli.rb +++ b/lib/bundler/cli.rb @@ -255,7 +255,7 @@ module Bundler "Overwrite existing binstubs if they exist" method_option "path", :type => :string, :lazy_default => "bin", :banner => "Binstub destination directory (default bin)" - method_option "standalone", :type => :array, :lazy_default => [], :banner => + method_option "standalone", :type => :boolean, :banner => "Make binstubs that can work without the Bundler runtime" def binstubs(*gems) require "bundler/cli/binstubs" diff --git a/lib/bundler/cli/gem.rb b/lib/bundler/cli/gem.rb index 27f4262e30..4dc0dbdb6b 100644 --- a/lib/bundler/cli/gem.rb +++ b/lib/bundler/cli/gem.rb @@ -44,7 +44,8 @@ module Bundler :test => options[:test], :ext => options[:ext], :exe => options[:exe], - :bundler_version => bundler_dependency_version + :bundler_version => bundler_dependency_version, + :git_user_name => git_user_name.empty? ? "[USERNAME]" : git_user_name } ensure_safe_gem_name(name, constant_array) diff --git a/lib/bundler/env.rb b/lib/bundler/env.rb index 75edbf2b88..8baf698dff 100644 --- a/lib/bundler/env.rb +++ b/lib/bundler/env.rb @@ -20,6 +20,7 @@ module Bundler out << " GEM_PATH #{ENV["GEM_PATH"]}\n" unless ENV["GEM_PATH"] == ENV["GEM_HOME"] out << " RVM #{ENV["rvm_version"]}\n" if ENV["rvm_version"] out << " Git #{git_version}\n" + out << " OpenSSL #{OpenSSL::OPENSSL_VERSION}\n" if defined?(OpenSSL::OPENSSL_VERSION) %w(rubygems-bundler open_gem).each do |name| specs = Bundler.rubygems.find_name(name) out << " #{name} (#{specs.map(&:version).join(",")})\n" unless specs.empty? diff --git a/lib/bundler/templates/newgem/README.md.tt b/lib/bundler/templates/newgem/README.md.tt index 30c7b93609..ad8d88b6e4 100644 --- a/lib/bundler/templates/newgem/README.md.tt +++ b/lib/bundler/templates/newgem/README.md.tt @@ -32,7 +32,7 @@ To install this gem onto your local machine, run `bundle exec rake install`. To ## Contributing -Bug reports and pull requests are welcome on GitHub at https://github.com/[USERNAME]/<%= config[:name] %>.<% if config[:coc] %> This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant](http://contributor-covenant.org) code of conduct.<% end %> +Bug reports and pull requests are welcome on GitHub at https://github.com/<%= config[:git_user_name] %>/<%= config[:name] %>.<% if config[:coc] %> This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant](http://contributor-covenant.org) code of conduct.<% end %> <% if config[:mit] %> ## License diff --git a/spec/bundler/env_spec.rb b/spec/bundler/env_spec.rb index 73d1f1d7df..1be6cf46bc 100644 --- a/spec/bundler/env_spec.rb +++ b/spec/bundler/env_spec.rb @@ -15,6 +15,7 @@ describe Bundler::Env do expect(out).to include(Gem::VERSION) expect(out).to include(env.send(:ruby_version)) expect(out).to include(env.send(:git_version)) + expect(out).to include(OpenSSL::OPENSSL_VERSION) end context "when there is a Gemfile and a lockfile and print_gemfile is true" do diff --git a/spec/commands/newgem_spec.rb b/spec/commands/newgem_spec.rb index cb3c48132a..6e80aa7a60 100644 --- a/spec/commands/newgem_spec.rb +++ b/spec/commands/newgem_spec.rb @@ -112,6 +112,35 @@ describe "bundle gem" do end end + context "README.md" do + let(:gem_name) { "test_gem" } + let(:generated_gem) { Bundler::GemHelper.new(bundled_app(gem_name).to_s) } + + context "git config user.name present" do + before do + execute_bundle_gem(gem_name) + end + + it "contribute URL set to git username" do + expect(bundled_app("test_gem/README.md").read).not_to include("[USERNAME]") + end + end + + context "git config user.name is absent" do + before do + `git config --unset user.name` + reset! + in_app_root + bundle "gem #{gem_name}" + remove_push_guard(gem_name) + end + + it "contribute URL set to [USERNAME]" do + expect(bundled_app("test_gem/README.md").read).to include("[USERNAME]") + end + end + end + it "generates a valid gemspec" do system_gems ["rake-10.0.2"] |