diff options
-rw-r--r-- | CHANGELOG.md | 26 | ||||
-rw-r--r-- | bundler.gemspec | 4 | ||||
-rwxr-xr-x | exe/bundle | 6 | ||||
-rw-r--r-- | lib/bundler/definition.rb | 2 | ||||
-rw-r--r-- | lib/bundler/dependency.rb | 6 | ||||
-rw-r--r-- | lib/bundler/gem_helper.rb | 9 | ||||
-rw-r--r-- | lib/bundler/source/git/git_proxy.rb | 52 | ||||
-rw-r--r-- | lib/bundler/ui/shell.rb | 4 | ||||
-rw-r--r-- | spec/bundler/dsl_spec.rb | 4 | ||||
-rw-r--r-- | spec/bundler/fetcher/compact_index_spec.rb | 2 | ||||
-rw-r--r-- | spec/bundler/gem_helper_spec.rb | 28 | ||||
-rw-r--r-- | spec/bundler/source_spec.rb | 36 | ||||
-rw-r--r-- | spec/commands/clean_spec.rb | 26 | ||||
-rw-r--r-- | spec/commands/newgem_spec.rb | 14 | ||||
-rw-r--r-- | spec/runtime/executable_spec.rb | 2 | ||||
-rw-r--r-- | spec/spec_helper.rb | 1 | ||||
-rw-r--r-- | spec/support/helpers.rb | 16 | ||||
-rw-r--r-- | task/bundler_3.rake (renamed from task/bundler_2.rake) | 4 |
18 files changed, 160 insertions, 82 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md index 7eafe43317..2392844047 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,29 @@ +## 2.0.2 (2019-06-13) + +Changes: + + - Fixes for Bundler integration with ruby-src ([#6941](https://github.com/bundler/bundler/pull/6941), [#6973](https://github.com/bundler/bundler/pull/6973), [#6977](https://github.com/bundler/bundler/pull/6977), [#6315](https://github.com/bundler/bundler/pull/6315), [#7061](https://github.com/bundler/bundler/pull/7061)) + - Use `__dir__` instead of `__FILE__` when generating a gem with `bundle gem` ([#6503](https://github.com/bundler/bundler/pull/6503)) + - Use `https` on externals links in the Bundler gemspec ([#6721](https://github.com/bundler/bundler/pull/6721)) + - Removed duplicate gem names from the suggested `did you mean` list for gem typos ([#6739](https://github.com/bundler/bundler/pull/6739)) + - Removed Ruby 1.x compatibility code ([#6764](https://github.com/bundler/bundler/pull/6764), [#6806](https://github.com/bundler/bundler/pull/6806)) + - Fixed an issue where `bundle remove` would crash with certain Gemfiles ([#6768](https://github.com/bundler/bundler/pull/6769)) + - Fixed indentation in the Bundler executable template ([#6773](https://github.com/bundler/bundler/pull/6773)) + - Fixed an issue where plugins could register for the same Bundler hook multiple times ([#6775](https://github.com/bundler/bundler/pull/6775)) + - Changed the "multiple sources" message in `bundle install` to be a warning instead of an error ([#6790](https://github.com/bundler/bundler/pull/6790)) + - Fixed a bug where path gems would break when using `only_update_to_newer_versions` ([#6774](https://github.com/bundler/bundler/pull/6774)) + - Fixed a bug where installing plugins with the `--deployment` setting would fail ([#6805](https://github.com/bundler/bundler/pull/6805)) + - Fixed an issue where `bundle update` couldn't update & install a gem when `no_install` was set (a `bundle package` config) ([#7078](https://github.com/bundler/bundler/pull/7078)) + - Fixed an issue where users could not run `bundle exec` on default gems ([#6963](https://github.com/bundler/bundler/pull/6963)) + - Updated vendor libraries to their latest version ([#7076](https://github.com/bundler/bundler/pull/7067), [#7068](https://github.com/bundler/bundler/pull/7068)) + - Fixed an issue where the `github` source was not using `https` by default that we mentioned in the 2.0 release ([#7182](https://github.com/bundler/bundler/pull/7182)) + - Fixed an issue where `rake release` was not outputting the message to users asking for a 2fa token ([#7199](https://github.com/bundler/bundler/pull/7199)) + +Documentation: + + - Fix incorrect documented `BUNDLE_PATH_RELATIVE_TO_CWD` env var ([#6751](https://github.com/bundler/bundler/pull/6751)) + - Update URLs in Bundler's documentation to use `https` ([#6935](https://github.com/bundler/bundler/pull/6935)) + ## 2.0.1 (2019-01-04) Changes: diff --git a/bundler.gemspec b/bundler.gemspec index 6ce881e51a..5e80c9edee 100644 --- a/bundler.gemspec +++ b/bundler.gemspec @@ -38,8 +38,8 @@ Gem::Specification.new do |s| s.add_development_dependency "rake", "~> 12.0" s.add_development_dependency "ronn", "~> 0.7.3" s.add_development_dependency "rspec", "~> 3.6" - s.add_development_dependency "rubocop", "= 0.68.1" - s.add_development_dependency "rubocop-performance", "~> 1.1" + s.add_development_dependency "rubocop", "= 0.71.0" + s.add_development_dependency "rubocop-performance", "= 1.4.0" s.files = Dir.glob("{lib,exe}/**/*", File::FNM_DOTMATCH).reject {|f| File.directory?(f) } diff --git a/exe/bundle b/exe/bundle index fccece038b..aaf773745d 100755 --- a/exe/bundle +++ b/exe/bundle @@ -7,7 +7,7 @@ Signal.trap("INT") do exit 1 end -require_relative "../lib/bundler" +require "bundler" # Check if an older version of bundler is installed $LOAD_PATH.each do |path| next unless path =~ %r{/bundler-0\.(\d+)} && $1.to_i < 9 @@ -18,9 +18,9 @@ $LOAD_PATH.each do |path| abort(err) end -require_relative "../lib/bundler/friendly_errors" +require "bundler/friendly_errors" Bundler.with_friendly_errors do - require_relative "../lib/bundler/cli" + require "bundler/cli" # Allow any command to use --help flag to show help for that command help_flags = %w[--help -h] diff --git a/lib/bundler/definition.rb b/lib/bundler/definition.rb index 76950ff96a..4664eec24d 100644 --- a/lib/bundler/definition.rb +++ b/lib/bundler/definition.rb @@ -317,7 +317,7 @@ module Bundler end def spec_git_paths - sources.git_sources.map {|s| s.path.to_s } + sources.git_sources.map {|s| File.realpath(s.path) } end def groups diff --git a/lib/bundler/dependency.rb b/lib/bundler/dependency.rb index 0d588bc892..55ffea02b6 100644 --- a/lib/bundler/dependency.rb +++ b/lib/bundler/dependency.rb @@ -19,6 +19,7 @@ module Bundler :ruby_23 => Gem::Platform::RUBY, :ruby_24 => Gem::Platform::RUBY, :ruby_25 => Gem::Platform::RUBY, + :ruby_26 => Gem::Platform::RUBY, :mri => Gem::Platform::RUBY, :mri_18 => Gem::Platform::RUBY, :mri_19 => Gem::Platform::RUBY, @@ -28,6 +29,7 @@ module Bundler :mri_23 => Gem::Platform::RUBY, :mri_24 => Gem::Platform::RUBY, :mri_25 => Gem::Platform::RUBY, + :mri_26 => Gem::Platform::RUBY, :rbx => Gem::Platform::RUBY, :truffleruby => Gem::Platform::RUBY, :jruby => Gem::Platform::JAVA, @@ -42,6 +44,7 @@ module Bundler :mswin_23 => Gem::Platform::MSWIN, :mswin_24 => Gem::Platform::MSWIN, :mswin_25 => Gem::Platform::MSWIN, + :mswin_26 => Gem::Platform::MSWIN, :mswin64 => Gem::Platform::MSWIN64, :mswin64_19 => Gem::Platform::MSWIN64, :mswin64_20 => Gem::Platform::MSWIN64, @@ -50,6 +53,7 @@ module Bundler :mswin64_23 => Gem::Platform::MSWIN64, :mswin64_24 => Gem::Platform::MSWIN64, :mswin64_25 => Gem::Platform::MSWIN64, + :mswin64_26 => Gem::Platform::MSWIN64, :mingw => Gem::Platform::MINGW, :mingw_18 => Gem::Platform::MINGW, :mingw_19 => Gem::Platform::MINGW, @@ -59,6 +63,7 @@ module Bundler :mingw_23 => Gem::Platform::MINGW, :mingw_24 => Gem::Platform::MINGW, :mingw_25 => Gem::Platform::MINGW, + :mingw_26 => Gem::Platform::MINGW, :x64_mingw => Gem::Platform::X64_MINGW, :x64_mingw_20 => Gem::Platform::X64_MINGW, :x64_mingw_21 => Gem::Platform::X64_MINGW, @@ -66,6 +71,7 @@ module Bundler :x64_mingw_23 => Gem::Platform::X64_MINGW, :x64_mingw_24 => Gem::Platform::X64_MINGW, :x64_mingw_25 => Gem::Platform::X64_MINGW, + :x64_mingw_26 => Gem::Platform::X64_MINGW, }.freeze REVERSE_PLATFORM_MAP = {}.tap do |reverse_platform_map| diff --git a/lib/bundler/gem_helper.rb b/lib/bundler/gem_helper.rb index 33f1d51592..68f5e636ff 100644 --- a/lib/bundler/gem_helper.rb +++ b/lib/bundler/gem_helper.rb @@ -106,7 +106,7 @@ module Bundler unless allowed_push_host || Bundler.user_home.join(".gem/credentials").file? raise "Your rubygems.org credentials aren't set. Run `gem push` to set them." end - sh(gem_command) + sh_with_input(gem_command) Bundler.ui.confirm "Pushed #{name} #{version} to #{gem_push_host}" end @@ -180,6 +180,13 @@ module Bundler gemspec.name end + def sh_with_input(cmd) + Bundler.ui.debug(cmd) + SharedHelpers.chdir(base) do + abort unless Kernel.system(*cmd) + end + end + def sh(cmd, &block) out, status = sh_with_status(cmd, &block) unless status.success? diff --git a/lib/bundler/source/git/git_proxy.rb b/lib/bundler/source/git/git_proxy.rb index 3db31f0237..f5af10f206 100644 --- a/lib/bundler/source/git/git_proxy.rb +++ b/lib/bundler/source/git/git_proxy.rb @@ -1,5 +1,6 @@ # frozen_string_literal: true +require "open3" require "shellwords" require "tempfile" module Bundler @@ -77,8 +78,8 @@ module Bundler def contains?(commit) allowed_in_path do - result = git_null("branch --contains #{commit}") - $? == 0 && result =~ /^\* (.*)$/ + result, status = git_null("branch --contains #{commit}") + status.success? && result =~ /^\* (.*)$/ end end @@ -148,13 +149,15 @@ module Bundler private - # TODO: Do not rely on /dev/null. - # Given that open3 is not cross platform until Ruby 1.9.3, - # the best solution is to pipe to /dev/null if it exists. - # If it doesn't, everything will work fine, but the user - # will get the $stderr messages as well. def git_null(command) - git("#{command} 2>#{Bundler::NULL}", false) + command_with_no_credentials = URICredentialsFilter.credential_filtered_string(command, uri) + raise GitNotAllowedError.new(command_with_no_credentials) unless allow? + + out, status = SharedHelpers.with_clean_git_env do + capture_and_ignore_stderr("git #{command}") + end + + [URICredentialsFilter.credential_filtered_string(out, uri), status] end def git_retry(command) @@ -167,12 +170,12 @@ module Bundler command_with_no_credentials = URICredentialsFilter.credential_filtered_string(command, uri) raise GitNotAllowedError.new(command_with_no_credentials) unless allow? - out = SharedHelpers.with_clean_git_env do - capture_and_filter_stderr(uri) { `git #{command}` } + out, status = SharedHelpers.with_clean_git_env do + capture_and_filter_stderr(uri, "git #{command}") end stdout_with_no_credentials = URICredentialsFilter.credential_filtered_string(out, uri) - raise GitCommandError.new(command_with_no_credentials, path, error_msg) if check_errors && !$?.success? + raise GitCommandError.new(command_with_no_credentials, path, error_msg) if check_errors && !status.success? stdout_with_no_credentials end @@ -235,26 +238,15 @@ module Bundler raise GitError, "The git source #{uri} is not yet checked out. Please run `bundle install` before trying to start your application" end - # TODO: Replace this with Open3 when upgrading to bundler 2 - # Similar to #git_null, as Open3 is not cross-platform, - # a temporary way is to use Tempfile to capture the stderr. - # When replacing this using Open3, make sure git_null is - # also replaced by Open3, so stdout and stderr all got handled properly. - def capture_and_filter_stderr(uri) - return_value, captured_err = "" - backup_stderr = STDERR.dup - begin - Tempfile.open("captured_stderr") do |f| - STDERR.reopen(f) - return_value = yield - f.rewind - captured_err = f.read - end - ensure - STDERR.reopen backup_stderr - end + def capture_and_filter_stderr(uri, cmd) + return_value, captured_err, status = Open3.capture3(cmd) Bundler.ui.warn URICredentialsFilter.credential_filtered_string(captured_err, uri) if uri && !captured_err.empty? - return_value + [return_value, status] + end + + def capture_and_ignore_stderr(cmd) + return_value, _, status = Open3.capture3(cmd) + [return_value, status] end end end diff --git a/lib/bundler/ui/shell.rb b/lib/bundler/ui/shell.rb index 8e49fa5885..92476be7d2 100644 --- a/lib/bundler/ui/shell.rb +++ b/lib/bundler/ui/shell.rb @@ -10,9 +10,7 @@ module Bundler attr_writer :shell def initialize(options = {}) - if options["no-color"] || !$stdout.tty? - Thor::Base.shell = Thor::Shell::Basic - end + Thor::Base.shell = options["no-color"] ? Thor::Shell::Basic : nil @shell = Thor::Base.shell.new @level = ENV["DEBUG"] ? "debug" : "info" @warning_history = [] diff --git a/spec/bundler/dsl_spec.rb b/spec/bundler/dsl_spec.rb index 214d159d05..69e4107408 100644 --- a/spec/bundler/dsl_spec.rb +++ b/spec/bundler/dsl_spec.rb @@ -98,8 +98,8 @@ RSpec.describe Bundler::Dsl do end describe "#gem" do - [:ruby, :ruby_18, :ruby_19, :ruby_20, :ruby_21, :ruby_22, :ruby_23, :ruby_24, :ruby_25, :mri, :mri_18, :mri_19, - :mri_20, :mri_21, :mri_22, :mri_23, :mri_24, :mri_25, :jruby, :rbx, :truffleruby].each do |platform| + [:ruby, :ruby_18, :ruby_19, :ruby_20, :ruby_21, :ruby_22, :ruby_23, :ruby_24, :ruby_25, :ruby_26, :mri, :mri_18, :mri_19, + :mri_20, :mri_21, :mri_22, :mri_23, :mri_24, :mri_25, :mri_26, :jruby, :rbx, :truffleruby].each do |platform| it "allows #{platform} as a valid platform" do subject.gem("foo", :platform => platform) end diff --git a/spec/bundler/fetcher/compact_index_spec.rb b/spec/bundler/fetcher/compact_index_spec.rb index 2f622f6653..f5ae6f4d77 100644 --- a/spec/bundler/fetcher/compact_index_spec.rb +++ b/spec/bundler/fetcher/compact_index_spec.rb @@ -22,7 +22,7 @@ RSpec.describe Bundler::Fetcher::CompactIndex do end it "calls worker#stop during the run" do - expect_any_instance_of(Bundler::Worker).to receive(:stop).at_least(:once) + expect_any_instance_of(Bundler::Worker).to receive(:stop).at_least(:once).and_call_original compact_index.specs_for_names(["lskdjf"]) end diff --git a/spec/bundler/gem_helper_spec.rb b/spec/bundler/gem_helper_spec.rb index daf76048ee..a21fd4c835 100644 --- a/spec/bundler/gem_helper_spec.rb +++ b/spec/bundler/gem_helper_spec.rb @@ -11,6 +11,7 @@ RSpec.describe Bundler::GemHelper do before(:each) do global_config "BUNDLE_GEM__MIT" => "false", "BUNDLE_GEM__TEST" => "false", "BUNDLE_GEM__COC" => "false" bundle "gem #{app_name}" + prepare_gemspec(app_gemspec_path) end context "determining gemspec" do @@ -218,15 +219,26 @@ RSpec.describe Bundler::GemHelper do end end - it "on releasing" do - mock_build_message app_name, app_version - mock_confirm_message "Tagged v#{app_version}." - mock_confirm_message "Pushed git commits and tags." - expect(subject).to receive(:rubygem_push).with(app_gem_path.to_s) + context "on releasing" do + before do + mock_build_message app_name, app_version + mock_confirm_message "Tagged v#{app_version}." + mock_confirm_message "Pushed git commits and tags." - Dir.chdir(app_path) { sys_exec("git push -u origin master") } + Dir.chdir(app_path) { sys_exec("git push -u origin master") } + end - Rake.application["release"].invoke + it "calls rubygem_push with proper arguments" do + expect(subject).to receive(:rubygem_push).with(app_gem_path.to_s) + + Rake.application["release"].invoke + end + + it "uses Kernel.system" do + expect(Kernel).to receive(:system).with("gem", "push", app_gem_path.to_s, "--host", "http://example.org").and_return(true) + + Rake.application["release"].invoke + end end it "even if tag already exists" do @@ -249,7 +261,7 @@ RSpec.describe Bundler::GemHelper do before(:each) do Rake.application = Rake::Application.new subject.install - allow(subject).to receive(:sh) + allow(subject).to receive(:sh_with_input) end after(:each) do diff --git a/spec/bundler/source_spec.rb b/spec/bundler/source_spec.rb index d70fd7e549..9ae6b3e3eb 100644 --- a/spec/bundler/source_spec.rb +++ b/spec/bundler/source_spec.rb @@ -56,19 +56,17 @@ RSpec.describe Bundler::Source do context "with a different version" do let(:locked_gem) { double(:locked_gem, :name => "nokogiri", :version => "< 1.5") } - context "with color" do + context "with color", :non_windows do before { Bundler.ui = Bundler::UI::Shell.new } it "should return a string with the spec name and version and locked spec version" do - if Bundler.ui.instance_variable_get(:@shell).is_a?(Bundler::Thor::Shell::Basic) - skip "tty color is not supported with Thor::Shell::Basic environment." - end - expect(subject.version_message(spec)).to eq("nokogiri >= 1.6\e[32m (was < 1.5)\e[0m") end end context "without color" do + before { Bundler.ui = Bundler::UI::Shell.new("no-color" => true) } + it "should return a string with the spec name and version and locked spec version" do expect(subject.version_message(spec)).to eq("nokogiri >= 1.6 (was < 1.5)") end @@ -79,34 +77,42 @@ RSpec.describe Bundler::Source do let(:spec) { double(:spec, :name => "nokogiri", :version => "1.6.1", :platform => rb) } let(:locked_gem) { double(:locked_gem, :name => "nokogiri", :version => "1.7.0") } - context "with color" do + context "with color", :non_windows do before { Bundler.ui = Bundler::UI::Shell.new } it "should return a string with the locked spec version in yellow" do - if Bundler.ui.instance_variable_get(:@shell).is_a?(Bundler::Thor::Shell::Basic) - skip "tty color is not supported with Thor::Shell::Basic environment." - end - expect(subject.version_message(spec)).to eq("nokogiri 1.6.1\e[33m (was 1.7.0)\e[0m") end end + + context "without color" do + before { Bundler.ui = Bundler::UI::Shell.new("no-color" => true) } + + it "should return a string with the locked spec version in yellow" do + expect(subject.version_message(spec)).to eq("nokogiri 1.6.1 (was 1.7.0)") + end + end end context "with an older version" do let(:spec) { double(:spec, :name => "nokogiri", :version => "1.7.1", :platform => rb) } let(:locked_gem) { double(:locked_gem, :name => "nokogiri", :version => "1.7.0") } - context "with color" do + context "with color", :non_windows do before { Bundler.ui = Bundler::UI::Shell.new } it "should return a string with the locked spec version in green" do - if Bundler.ui.instance_variable_get(:@shell).is_a?(Bundler::Thor::Shell::Basic) - skip "tty color is not supported with Thor::Shell::Basic environment." - end - expect(subject.version_message(spec)).to eq("nokogiri 1.7.1\e[32m (was 1.7.0)\e[0m") end end + + context "without color" do + before { Bundler.ui = Bundler::UI::Shell.new("no-color" => true) } + + it "should return a string with the locked spec version in yellow" do + expect(subject.version_message(spec)).to eq("nokogiri 1.7.1 (was 1.7.0)") + end + end end end diff --git a/spec/commands/clean_spec.rb b/spec/commands/clean_spec.rb index 69a5d1e6b0..17a533ef19 100644 --- a/spec/commands/clean_spec.rb +++ b/spec/commands/clean_spec.rb @@ -183,6 +183,32 @@ RSpec.describe "bundle clean" do expect(vendored_gems("bin/rackup")).to exist end + it "keeps used git gems even if installed to a symlinked location" do + build_git "foo", :path => lib_path("foo") + git_path = lib_path("foo") + revision = revision_for(git_path) + + gemfile <<-G + source "file://#{gem_repo1}" + + gem "rack", "1.0.0" + git "#{git_path}", :ref => "#{revision}" do + gem "foo" + end + G + + FileUtils.mkdir_p(bundled_app("real-path")) + FileUtils.ln_sf(bundled_app("real-path"), bundled_app("symlink-path")) + + bundle "install", forgotten_command_line_options(:path => bundled_app("symlink-path")) + + bundle :clean + + expect(out).not_to include("Removing foo (#{revision[0..11]})") + + expect(bundled_app("symlink-path/#{Bundler.ruby_scope}/bundler/gems/foo-#{revision[0..11]}")).to exist + end + it "removes old git gems" do build_git "foo-bar", :path => lib_path("foo-bar") revision = revision_for(lib_path("foo-bar")) diff --git a/spec/commands/newgem_spec.rb b/spec/commands/newgem_spec.rb index 203b474877..222e6ce2d4 100644 --- a/spec/commands/newgem_spec.rb +++ b/spec/commands/newgem_spec.rb @@ -177,19 +177,7 @@ RSpec.describe "bundle gem" do in_app_root bundle! "gem newgem --bin" - process_file(bundled_app("newgem", "newgem.gemspec")) do |line| - # Simulate replacing TODOs with real values - case line - 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.}") - when /spec\.description/ - line.gsub(/\=.*$/, "= %q{A longer description of my new gem.}") - else - line - end - end + prepare_gemspec(bundled_app("newgem", "newgem.gemspec")) Dir.chdir(bundled_app("newgem")) do gems = ["rake-12.3.2", :bundler] diff --git a/spec/runtime/executable_spec.rb b/spec/runtime/executable_spec.rb index 9b0b8ea81f..e293958f82 100644 --- a/spec/runtime/executable_spec.rb +++ b/spec/runtime/executable_spec.rb @@ -143,7 +143,7 @@ RSpec.describe "Running bin/* commands" do end it "use BUNDLE_GEMFILE gemfile for binstub" do - # context with bin/bunlder w/ default Gemfile + # context with bin/bundler w/ default Gemfile bundle! "binstubs bundler" # generate other Gemfile with executable gem diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index d3de1ff784..444f3a3cf3 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -74,6 +74,7 @@ RSpec.configure do |config| config.filter_run_excluding :rubygems_master => (ENV["RGV"] != "master") config.filter_run_excluding :bundler => RequirementChecker.against(Bundler::VERSION.split(".")[0]) config.filter_run_excluding :ruby_repo => !(ENV["BUNDLE_RUBY"] && ENV["BUNDLE_GEM"]).nil? + config.filter_run_excluding :non_windows => Gem.win_platform? config.filter_run_when_matching :focus unless ENV["CI"] diff --git a/spec/support/helpers.rb b/spec/support/helpers.rb index fc43b2642f..922555ff60 100644 --- a/spec/support/helpers.rb +++ b/spec/support/helpers.rb @@ -539,6 +539,22 @@ module Spec Dir[pattern].each(&chmod[0o755, 0o644]) end + # Simulate replacing TODOs with real values + def prepare_gemspec(pathname) + process_file(pathname) do |line| + case line + 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.}") + when /spec\.description/ + line.gsub(/\=.*$/, "= %q{A longer description of my new gem.}") + else + line + end + end + end + def process_file(pathname) changed_lines = pathname.readlines.map do |line| yield line diff --git a/task/bundler_2.rake b/task/bundler_3.rake index 4b0be8d3a9..f40837017c 100644 --- a/task/bundler_2.rake +++ b/task/bundler_3.rake @@ -1,8 +1,8 @@ # frozen_string_literal: true -namespace :bundler_2 do +namespace :bundler_3 do task :install do - ENV["BUNDLER_SPEC_SUB_VERSION"] = "2.0.0.dev" + ENV["BUNDLER_SPEC_SUB_VERSION"] = "3.0.0.dev" Rake::Task["override_version"].invoke Rake::Task["install"].invoke sh("git", "checkout", "--", "lib/bundler/version.rb") |