diff options
-rw-r--r-- | lib/bundler/cli/common.rb | 9 | ||||
-rw-r--r-- | lib/bundler/cli/install.rb | 2 | ||||
-rw-r--r-- | lib/bundler/cli/update.rb | 2 | ||||
-rw-r--r-- | spec/commands/post_bundle_message_spec.rb (renamed from spec/install/post_bundle_message_spec.rb) | 6 |
4 files changed, 10 insertions, 9 deletions
diff --git a/lib/bundler/cli/common.rb b/lib/bundler/cli/common.rb index 5ec541f722..cec7bcadb4 100644 --- a/lib/bundler/cli/common.rb +++ b/lib/bundler/cli/common.rb @@ -14,17 +14,18 @@ module Bundler Bundler.ui.info msg end - def self.output_without_groups_message + def self.output_without_groups_message(command) return if Bundler.settings[:without].empty? - Bundler.ui.confirm without_groups_message + Bundler.ui.confirm without_groups_message(command) end - def self.without_groups_message + def self.without_groups_message(command) + command_in_past_tense = command == :install ? "installed" : "updated" groups = Bundler.settings[:without] group_list = [groups[0...-1].join(", "), groups[-1..-1]]. reject {|s| s.to_s.empty? }.join(" and ") group_str = groups.size == 1 ? "group" : "groups" - "Gems in the #{group_str} #{group_list} were not installed." + "Gems in the #{group_str} #{group_list} were not #{command_in_past_tense}." end def self.select_spec(name, regex_match = nil) diff --git a/lib/bundler/cli/install.rb b/lib/bundler/cli/install.rb index cf0c71d766..d823fb632f 100644 --- a/lib/bundler/cli/install.rb +++ b/lib/bundler/cli/install.rb @@ -66,7 +66,7 @@ module Bundler Bundler.load.cache if Bundler.app_cache.exist? && !options["no-cache"] && !Bundler.frozen_bundle? Bundler.ui.confirm "Bundle complete! #{dependencies_count_for(definition)}, #{gems_installed_for(definition)}." - Bundler::CLI::Common.output_without_groups_message + Bundler::CLI::Common.output_without_groups_message(:install) if Bundler.use_system_gems? Bundler.ui.confirm "Use `bundle info [gemname]` to see where a bundled gem is installed." diff --git a/lib/bundler/cli/update.rb b/lib/bundler/cli/update.rb index 45d0374eef..60ea1c2a80 100644 --- a/lib/bundler/cli/update.rb +++ b/lib/bundler/cli/update.rb @@ -95,7 +95,7 @@ module Bundler end Bundler.ui.confirm "Bundle updated!" - Bundler::CLI::Common.output_without_groups_message + Bundler::CLI::Common.output_without_groups_message(:update) Bundler::CLI::Common.output_post_install_messages installer.post_install_messages end end diff --git a/spec/install/post_bundle_message_spec.rb b/spec/commands/post_bundle_message_spec.rb index 1efd0b8146..4d3aa7b450 100644 --- a/spec/install/post_bundle_message_spec.rb +++ b/spec/commands/post_bundle_message_spec.rb @@ -185,21 +185,21 @@ The source does not contain any versions of 'not-a-gem' it "with --without one group" do bundle! :install, forgotten_command_line_options(:without => "emo") bundle! :update, :all => true - expect(out).to include("Gems in the group emo were not installed") + expect(out).to include("Gems in the group emo were not updated") expect(out).to include(bundle_updated_message) end it "with --without two groups" do bundle! :install, forgotten_command_line_options(:without => "emo test") bundle! :update, :all => true - expect(out).to include("Gems in the groups emo and test were not installed") + expect(out).to include("Gems in the groups emo and test were not updated") expect(out).to include(bundle_updated_message) end it "with --without more groups" do bundle! :install, forgotten_command_line_options(:without => "emo obama test") bundle! :update, :all => true - expect(out).to include("Gems in the groups emo, obama and test were not installed") + expect(out).to include("Gems in the groups emo, obama and test were not updated") expect(out).to include(bundle_updated_message) end end |