Suppress uninitialized instance variable warnings

This commit is contained in:
Jack Nagel 2013-03-28 17:37:29 -05:00
parent f0db242591
commit 0d45c3c0f2
3 changed files with 18 additions and 13 deletions

View File

@ -29,19 +29,21 @@ class AbstractDownloadStrategy
end end
class CurlDownloadStrategy < AbstractDownloadStrategy class CurlDownloadStrategy < AbstractDownloadStrategy
attr_reader :tarball_path, :local_bottle_path attr_reader :tarball_path
attr_writer :local_bottle_path attr_accessor :local_bottle_path
def initialize name, package def initialize name, package
super super
@mirrors = package.mirrors
@unique_token = "#{name}-#{package.version}" unless name.to_s.empty? or name == '__UNKNOWN__' if name.to_s.empty? || name == '__UNKNOWN__'
if @unique_token
@tarball_path=HOMEBREW_CACHE+(@unique_token+ext)
else
@tarball_path = HOMEBREW_CACHE + File.basename(@url) @tarball_path = HOMEBREW_CACHE + File.basename(@url)
else
@tarball_path = HOMEBREW_CACHE + "#{name}-#{package.version}#{ext}"
end end
@temporary_path=Pathname.new(@tarball_path.to_s + ".incomplete")
@mirrors = package.mirrors
@temporary_path = Pathname("#@tarball_path.incomplete")
@local_bottle_path = nil
end end
def cached_location def cached_location

View File

@ -10,6 +10,8 @@ class SoftwareSpec
@version = version @version = version
@mirrors = [] @mirrors = []
@specs = {} @specs = {}
@checksum = nil
@using = nil
end end
def download_strategy def download_strategy

View File

@ -3,6 +3,7 @@ abort if ARGV.include? "--skip-update"
require 'testing_env' require 'testing_env'
require 'formula' require 'formula'
require 'cmd/update' require 'cmd/update'
require 'yaml'
class UpdaterMock < Updater class UpdaterMock < Updater
def in_repo_expect(cmd, output = '') def in_repo_expect(cmd, output = '')
@ -36,11 +37,11 @@ class UpdaterTests < Test::Unit::TestCase
end end
def self.fixture_data def self.fixture_data
unless @fixture_data @fixture_data ||= load_fixture_data
require 'yaml'
@fixture_data = YAML.load_file(Pathname.new(ABS__FILE__).parent.realpath + 'fixtures/updater_fixture.yaml')
end end
@fixture_data
def self.load_fixture_data
YAML.load_file(Pathname.new(ABS__FILE__).parent.realpath + 'fixtures/updater_fixture.yaml')
end end
def test_update_homebrew_without_any_changes def test_update_homebrew_without_any_changes