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 Homebrew/homebrew#7191; though it could be fixed better.
This commit is contained in:
parent
0d6aff5e1b
commit
7c5073fff2
@ -17,12 +17,12 @@ class RefreshBrew
|
|||||||
EXAMPLE_DIR = 'Library/Contributions/examples/'
|
EXAMPLE_DIR = 'Library/Contributions/examples/'
|
||||||
|
|
||||||
attr_reader :added_formulae, :updated_formulae, :deleted_formulae, :installed_formulae
|
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
|
attr_reader :initial_revision, :current_revision
|
||||||
|
|
||||||
def initialize
|
def initialize
|
||||||
@added_formulae, @updated_formulae, @deleted_formulae, @installed_formulae = [], [], [], []
|
@added_formulae, @updated_formulae, @deleted_formulae, @installed_formulae = [], [], [], []
|
||||||
@added_examples, @updated_examples, @deleted_examples = [], [], []
|
@added_examples, @deleted_examples = [], [], []
|
||||||
@initial_revision, @current_revision = nil
|
@initial_revision, @current_revision = nil
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -73,7 +73,8 @@ class RefreshBrew
|
|||||||
@updated_formulae = changed_items('M', FORMULA_DIR)
|
@updated_formulae = changed_items('M', FORMULA_DIR)
|
||||||
@added_examples = changed_items('A', EXAMPLE_DIR)
|
@added_examples = changed_items('A', EXAMPLE_DIR)
|
||||||
@deleted_examples = changed_items('D', 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.
|
@installed_formulae = HOMEBREW_CELLAR.children.
|
||||||
select{ |pn| pn.directory? }.
|
select{ |pn| pn.directory? }.
|
||||||
@ -116,36 +117,38 @@ class RefreshBrew
|
|||||||
|
|
||||||
def report
|
def report
|
||||||
puts "Updated Homebrew from #{initial_revision[0,8]} to #{current_revision[0,8]}."
|
puts "Updated Homebrew from #{initial_revision[0,8]} to #{current_revision[0,8]}."
|
||||||
## New Formulae
|
|
||||||
if pending_new_formulae?
|
if pending_new_formulae?
|
||||||
ohai "The following formulae are new:"
|
ohai "New formulae"
|
||||||
puts_columns added_formulae
|
puts_columns added_formulae
|
||||||
end
|
end
|
||||||
## Deleted Formulae
|
|
||||||
if deleted_formulae?
|
if deleted_formulae?
|
||||||
ohai "The following formulae were removed:"
|
ohai "Removed formulae"
|
||||||
puts_columns deleted_formulae, installed_formulae
|
puts_columns deleted_formulae, installed_formulae
|
||||||
end
|
end
|
||||||
## Updated Formulae
|
|
||||||
if pending_formulae_changes?
|
if pending_formulae_changes?
|
||||||
ohai "The following formulae were updated:"
|
ohai "Updated formulae"
|
||||||
puts_columns updated_formulae, installed_formulae
|
puts_columns updated_formulae, installed_formulae
|
||||||
end
|
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?
|
if pending_new_examples?
|
||||||
ohai "The following external commands are new:"
|
ohai "New external commands"
|
||||||
puts_columns added_examples
|
puts_columns added_examples
|
||||||
end
|
end
|
||||||
## Deleted examples
|
|
||||||
if deleted_examples?
|
if deleted_examples?
|
||||||
ohai "The following external commands were removed:"
|
ohai "Removed external commands"
|
||||||
puts_columns deleted_examples
|
puts_columns deleted_examples
|
||||||
end
|
end
|
||||||
## Updated Formulae
|
|
||||||
if pending_examples_changes?
|
|
||||||
ohai "The following external commands were updated:"
|
|
||||||
puts_columns updated_examples
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
|
|
||||||
private
|
private
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user