aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Homebrew/cmd/update.rb
diff options
context:
space:
mode:
authorMax Howell2011-08-26 13:04:08 +0100
committerMax Howell2011-08-26 13:26:46 +0100
commit5e5bbd8f4ba548a47450baeb7fe7e61e3f84954d (patch)
treef7f9aa1a72d2b0cb0a752dac69b2e9f5d2f86429 /Library/Homebrew/cmd/update.rb
parent82d735c50ade65ce853b0d3eac73a7b50e408b54 (diff)
downloadhomebrew-5e5bbd8f4ba548a47450baeb7fe7e61e3f84954d.tar.bz2
Feature new/removed internal commands
Removed updated external commands, like seriously, who cares? We could add it back as if --verbose is set I guess but in all honesty, if nobody complains then nobody cared. # We removed many redundant comments Removed many redundant comments. Fixes #7191; though it could be fixed better.
Diffstat (limited to 'Library/Homebrew/cmd/update.rb')
-rw-r--r--Library/Homebrew/cmd/update.rb39
1 files changed, 21 insertions, 18 deletions
diff --git a/Library/Homebrew/cmd/update.rb b/Library/Homebrew/cmd/update.rb
index be1176a77..9d826be95 100644
--- a/Library/Homebrew/cmd/update.rb
+++ b/Library/Homebrew/cmd/update.rb
@@ -17,12 +17,12 @@ class RefreshBrew
EXAMPLE_DIR = 'Library/Contributions/examples/'
attr_reader :added_formulae, :updated_formulae, :deleted_formulae, :installed_formulae
- attr_reader :added_examples, :updated_examples, :deleted_examples
+ attr_reader :added_examples, :deleted_examples
attr_reader :initial_revision, :current_revision
def initialize
@added_formulae, @updated_formulae, @deleted_formulae, @installed_formulae = [], [], [], []
- @added_examples, @updated_examples, @deleted_examples = [], [], []
+ @added_examples, @deleted_examples = [], [], []
@initial_revision, @current_revision = nil
end
@@ -73,7 +73,8 @@ class RefreshBrew
@updated_formulae = changed_items('M', FORMULA_DIR)
@added_examples = changed_items('A', EXAMPLE_DIR)
@deleted_examples = changed_items('D', EXAMPLE_DIR)
- @updated_examples = changed_items('M', EXAMPLE_DIR)
+ @added_internal_commands = changed_items('A', "Library/Homebrew/cmd")
+ @deleted_internal_commands = changed_items('M', "Library/Homebrew/cmd")
@installed_formulae = HOMEBREW_CELLAR.children.
select{ |pn| pn.directory? }.
@@ -116,36 +117,38 @@ class RefreshBrew
def report
puts "Updated Homebrew from #{initial_revision[0,8]} to #{current_revision[0,8]}."
- ## New Formulae
if pending_new_formulae?
- ohai "The following formulae are new:"
+ ohai "New formulae"
puts_columns added_formulae
end
- ## Deleted Formulae
if deleted_formulae?
- ohai "The following formulae were removed:"
+ ohai "Removed formulae"
puts_columns deleted_formulae, installed_formulae
end
- ## Updated Formulae
if pending_formulae_changes?
- ohai "The following formulae were updated:"
+ ohai "Updated formulae"
puts_columns updated_formulae, installed_formulae
end
- ## New examples
+
+ unless @added_internal_commands.empty?
+ ohai "New commands"
+ puts_columns @added_internal_commands
+ end
+ unless @deleted_internal_commands.empty?
+ ohai "Removed commands"
+ puts_columns @deleted_internal_commands
+ end
+
+ # external commands aren't generally documented but the distinction
+ # is loose. They are less "supported" and more "playful".
if pending_new_examples?
- ohai "The following external commands are new:"
+ ohai "New external commands"
puts_columns added_examples
end
- ## Deleted examples
if deleted_examples?
- ohai "The following external commands were removed:"
+ ohai "Removed external commands"
puts_columns deleted_examples
end
- ## Updated Formulae
- if pending_examples_changes?
- ohai "The following external commands were updated:"
- puts_columns updated_examples
- end
end
private