From a87d2108ea6e8b4261ca3411ff3b30b0a6714eeb Mon Sep 17 00:00:00 2001 From: Jack Nagel Date: Fri, 18 Jul 2014 15:14:42 -0500 Subject: Move bottle filename construction to a class --- Library/Homebrew/cmd/bottle.rb | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) (limited to 'Library/Homebrew/cmd') diff --git a/Library/Homebrew/cmd/bottle.rb b/Library/Homebrew/cmd/bottle.rb index c74bb1921..8bd1c4b9e 100644 --- a/Library/Homebrew/cmd/bottle.rb +++ b/Library/Homebrew/cmd/bottle.rb @@ -125,12 +125,7 @@ module Homebrew bottle_revision = max ? max + 1 : 0 end - filename = bottle_filename( - :name => f.name, - :version => f.pkg_version, - :revision => bottle_revision, - :tag => bottle_tag - ) + filename = Bottle::Filename.new(f.name, f.pkg_version, bottle_tag, bottle_revision) if bottle_filename_formula_name(filename).empty? return ofail "Add a new regex to bottle_version.rb to parse #{f.version} from #{filename}" @@ -197,7 +192,7 @@ module Homebrew puts output if ARGV.include? '--rb' - bottle_base = filename.gsub(bottle_suffix(bottle_revision), '') + bottle_base = filename.to_s.gsub(bottle_suffix(bottle_revision), '') File.open "#{bottle_base}.bottle.rb", 'w' do |file| file.write output end -- cgit v1.2.3