<commit_before>module Fog
  module Parsers
    module Terremark
      module Shared

        class Vapp < Fog::Parsers::Base

          def reset
            @response = { 'Links' => [] }
          end

          def start_element(name, attributes)
            @value = ''
            case name
              when 'Link'
                link = {}
                until attributes.empty?
                  link[attributes.shift] = attributes.shift
                end
                @response['Links'] << link
              when 'Vapp'
                vapp = {}
                until attributes.empty?
                  if attributes.first.is_a?(Array)
                    attribute = attributes.shift
                    vapp[attribute.first] = attribute.last
                  else
                    vapp[attributes.shift] = attributes.shift
                  end
                end
                @response.merge!(vapp.reject {|key,value| !['href', 'name', 'size', 'status', 'type'].include?(key)})
            end
          end

          def end_element(name)
            case name
            when 'IpAddress'
              @response['IpAddress'] = @value
            end
          end

        end

      end
    end
  end
end
<commit_msg>[terremark] fix typo in vapp parser<commit_after>module Fog
  module Parsers
    module Terremark
      module Shared

        class Vapp < Fog::Parsers::Base

          def reset
            @response = { 'Links' => [] }
          end

          def start_element(name, attributes)
            @value = ''
            case name
              when 'Link'
                link = {}
                until attributes.empty?
                  link[attributes.shift] = attributes.shift
                end
                @response['Links'] << link
              when 'VApp'
                vapp = {}
                until attributes.empty?
                  if attributes.first.is_a?(Array)
                    attribute = attributes.shift
                    vapp[attribute.first] = attribute.last
                  else
                    vapp[attributes.shift] = attributes.shift
                  end
                end
                @response.merge!(vapp.reject {|key,value| !['href', 'name', 'size', 'status', 'type'].include?(key)})
            end
          end

          def end_element(name)
            case name
            when 'IpAddress'
              @response['IpAddress'] = @value
            end
          end

        end

      end
    end
  end
end

{'fraction_non_alphanumeric': 0.08881839809674862, 'fraction_numerical': 0.0, 'mean_word_length': 1.1060100166944908, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2965455', 'n_tokens_mistral': 637, 'n_tokens_neox': 593, 'n_words': 149}