diff options
| -rw-r--r-- | Library/Homebrew/cask/lib/hbc/artifact/abstract_artifact.rb | 3 | ||||
| -rw-r--r-- | Library/Homebrew/cask/lib/hbc/artifact/artifact.rb | 2 | ||||
| -rw-r--r-- | Library/Homebrew/cask/lib/hbc/artifact/relocated.rb | 6 | ||||
| -rw-r--r-- | Library/Homebrew/cask/lib/hbc/cask.rb | 5 | ||||
| -rw-r--r-- | Library/Homebrew/cask/lib/hbc/dsl.rb | 2 | 
5 files changed, 10 insertions, 8 deletions
| diff --git a/Library/Homebrew/cask/lib/hbc/artifact/abstract_artifact.rb b/Library/Homebrew/cask/lib/hbc/artifact/abstract_artifact.rb index f9f736662..077105468 100644 --- a/Library/Homebrew/cask/lib/hbc/artifact/abstract_artifact.rb +++ b/Library/Homebrew/cask/lib/hbc/artifact/abstract_artifact.rb @@ -95,10 +95,11 @@ module Hbc          [executable, arguments]        end -      attr_reader :cask +      attr_reader :cask, :config        def initialize(cask)          @cask = cask +        @config = cask.config        end        def to_s diff --git a/Library/Homebrew/cask/lib/hbc/artifact/artifact.rb b/Library/Homebrew/cask/lib/hbc/artifact/artifact.rb index 0f37afade..b7df4b0bd 100644 --- a/Library/Homebrew/cask/lib/hbc/artifact/artifact.rb +++ b/Library/Homebrew/cask/lib/hbc/artifact/artifact.rb @@ -25,7 +25,7 @@ module Hbc          new(cask, source_string, **target_hash)        end -      def self.resolve_target(target) +      def resolve_target(target)          Pathname(target)        end diff --git a/Library/Homebrew/cask/lib/hbc/artifact/relocated.rb b/Library/Homebrew/cask/lib/hbc/artifact/relocated.rb index 155d52c06..9195d889a 100644 --- a/Library/Homebrew/cask/lib/hbc/artifact/relocated.rb +++ b/Library/Homebrew/cask/lib/hbc/artifact/relocated.rb @@ -18,8 +18,8 @@ module Hbc          new(cask, source_string, **target_hash)        end -      def self.resolve_target(target) -        Config.global.public_send(dirmethod).join(target) +      def resolve_target(target) +        config.public_send(self.class.dirmethod).join(target)        end        attr_reader :source, :target @@ -32,7 +32,7 @@ module Hbc          source = cask.staged_path.join(source)          @source = source          target ||= source.basename -        @target = self.class.resolve_target(target) +        @target = resolve_target(target)        end        def to_a diff --git a/Library/Homebrew/cask/lib/hbc/cask.rb b/Library/Homebrew/cask/lib/hbc/cask.rb index df885371a..681130c1b 100644 --- a/Library/Homebrew/cask/lib/hbc/cask.rb +++ b/Library/Homebrew/cask/lib/hbc/cask.rb @@ -6,17 +6,18 @@ module Hbc      extend Forwardable      include Metadata -    attr_reader :token, :sourcefile_path +    attr_reader :token, :sourcefile_path, :config      def tap        return super if block_given? # Object#tap        @tap      end -    def initialize(token, sourcefile_path: nil, tap: nil, &block) +    def initialize(token, sourcefile_path: nil, tap: nil, config: Config.global, &block)        @token = token        @sourcefile_path = sourcefile_path        @tap = tap +      @config = config        @dsl = DSL.new(self)        return unless block_given?        @dsl.instance_eval(&block) diff --git a/Library/Homebrew/cask/lib/hbc/dsl.rb b/Library/Homebrew/cask/lib/hbc/dsl.rb index 969fc8680..9a88f1b62 100644 --- a/Library/Homebrew/cask/lib/hbc/dsl.rb +++ b/Library/Homebrew/cask/lib/hbc/dsl.rb @@ -292,7 +292,7 @@ module Hbc      end      def appdir -      Config.global.appdir +      cask.config.appdir      end    end  end | 
