summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Rodríguez <deivid.rodriguez@riseup.net>2019-04-28 15:09:03 +0200
committerDavid Rodríguez <deivid.rodriguez@riseup.net>2019-04-28 15:09:03 +0200
commitd0d3f2786149cbaca6506b95e4be91be98161c15 (patch)
tree6b3db30d66be5414886604776c9c202ee68afa5a
parent2867fae68d71ab8c0e0e70fe3d128a5fe6b57278 (diff)
downloadbundler-proper_group_skip_message_for_bundle_update.tar.gz
Fix message about skipped groups for `bundle update`proper_group_skip_message_for_bundle_update
-rw-r--r--lib/bundler/cli/common.rb9
-rw-r--r--lib/bundler/cli/install.rb2
-rw-r--r--lib/bundler/cli/update.rb2
-rw-r--r--spec/commands/post_bundle_message_spec.rb6
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/commands/post_bundle_message_spec.rb b/spec/commands/post_bundle_message_spec.rb
index 1efd0b8146..4d3aa7b450 100644
--- a/spec/commands/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