From 0802ad734f20c4e8507a1423513ef08301ea19d0 Mon Sep 17 00:00:00 2001 From: Markus Reiter Date: Fri, 3 Feb 2017 22:00:28 +0100 Subject: Simplify `CaskLoader`. --- Library/Homebrew/cask/lib/hbc/cask_loader.rb | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) (limited to 'Library/Homebrew/cask') diff --git a/Library/Homebrew/cask/lib/hbc/cask_loader.rb b/Library/Homebrew/cask/lib/hbc/cask_loader.rb index 63660fcd0..3fe02d7e1 100644 --- a/Library/Homebrew/cask/lib/hbc/cask_loader.rb +++ b/Library/Homebrew/cask/lib/hbc/cask_loader.rb @@ -32,17 +32,12 @@ module Hbc end def cask(header_token, &block) - @klass = Cask - build_cask(header_token, &block) - end - - def build_cask(header_token, &block) raise CaskTokenDoesNotMatchError.new(@token, header_token) unless @token == header_token if @path.nil? - @klass.new(@token, &block) + Cask.new(@token, &block) else - @klass.new(@token, sourcefile_path: @path, &block) + Cask.new(@token, sourcefile_path: @path, &block) end end end -- cgit v1.2.3