Move data into updater class

This commit is contained in:
Adam Vandenberg 2010-05-31 14:15:26 -07:00
parent 14d84be78e
commit 40c8af111f
2 changed files with 3 additions and 3 deletions

View File

@ -11,10 +11,11 @@ class RefreshBrew
UPDATED_FORMULA = %r{^\s+#{formula_regexp}\s} UPDATED_FORMULA = %r{^\s+#{formula_regexp}\s}
DELETED_FORMULA = %r{^\s+delete mode \d+ #{formula_regexp}$} DELETED_FORMULA = %r{^\s+delete mode \d+ #{formula_regexp}$}
attr_reader :added_formulae, :updated_formulae, :deleted_formulae attr_reader :added_formulae, :updated_formulae, :deleted_formulae, :initial_revision
def initialize def initialize
@added_formulae, @updated_formulae, @deleted_formulae = [], [], [] @added_formulae, @updated_formulae, @deleted_formulae = [], [], []
@initial_revision = self.current_revision
end end
# Performs an update of the homebrew source. Returns +true+ if a newer # Performs an update of the homebrew source. Returns +true+ if a newer

View File

@ -163,11 +163,10 @@ begin
require 'update' require 'update'
updater = RefreshBrew.new updater = RefreshBrew.new
old_revision = updater.current_revision
unless updater.update_from_masterbrew! unless updater.update_from_masterbrew!
puts "Already up-to-date." puts "Already up-to-date."
else else
puts "Updated Homebrew from #{old_revision[0,8]} to #{updater.current_revision[0,8]}." puts "Updated Homebrew from #{updater.initial_revision[0,8]} to #{updater.current_revision[0,8]}."
## New Formulae ## New Formulae
if updater.pending_new_formulae? if updater.pending_new_formulae?
ohai "The following formulae are new:" ohai "The following formulae are new:"