lib/homebrew_automation/bottle.rb
def parse_for_tarball_path(json_str)
      begin
        json = JSON.parse(json_str)
        focus = json
        [fully_qualified_formula_name, 'bottle', 'tags', @os_name].each do |key|
          focus = focus[key]
          if focus.nil?
            raise Error.new(
              "unexpected JSON structure, couldn't find key: #{key}",
              original: json)
          end
        end
        # https://github.com/Homebrew/brew/pull/4612
        minus_minus, filename = focus['local_filename'], focus['filename']
        if minus_minus.nil? || filename.nil?
          raise Error.new(
            "unexpected JSON structure, couldn't find both `local_filename` and `filename` keys: #{minus_minus.inspect}, #{filename.inspect}",
            original: json)
        end
        [minus_minus, filename]
      rescue JSON::ParserError => e
        raise Error.new(
          "error parsing JSON: #{e}",
          original: json_str)
      end
    end
# pure-ish; raises exception
#
# @return [Tuple<String, String>] +[minus_minus, filename]+
pure-ish; raises exception
pure - ish ; raises exception
def parse_for_tarball_path(json_str)
      begin
        json = JSON.parse(json_str)
        focus = json
        [fully_qualified_formula_name, 'bottle', 'tags', @os_name].each do |key|
          focus = focus[key]
          if focus.nil?
            raise Error.new(
              "unexpected JSON structure, couldn't find key: #{key}",
              original: json)
          end
        end
        minus_minus, filename = focus['local_filename'], focus['filename']
        if minus_minus.nil? || filename.nil?
          raise Error.new(
            "unexpected JSON structure, couldn't find both `local_filename` and `filename` keys: #{minus_minus.inspect}, #{filename.inspect}",
            original: json)
        end
        [minus_minus, filename]
      rescue JSON::ParserError => e
        raise Error.new(
          "error parsing JSON: #{e}",
          original: json_str)
      end
    end
def parse_for_tarball_path ( json_str ) begin json = JSON . parse ( json_str ) focus = json [ fully_qualified_formula_name , 'bottle' , 'tags' , @os_name ] . each do | key | focus = focus [ key ] if focus . nil? raise Error . new ( "unexpected JSON structure, couldn't find key: #{key}" , original : json ) end end minus_minus , filename = focus [ 'local_filename' ] , focus [ 'filename' ] if minus_minus . nil? || filename . nil? raise Error . new ( "unexpected JSON structure, couldn't find both `local_filename` and `filename` keys: #{minus_minus.inspect}, #{filename.inspect}" , original : json ) end [ minus_minus , filename ] rescue JSON :: ParserError => e raise Error . new ( "error parsing JSON: #{e}" , original : json_str ) end end
pure-ish; raises exception
pure - ish ; raises exception
# https://github.com/Homebrew/brew/pull/4612
None
Tuple<String, String>
json_str