<commit_before>module WatirSpec
  module Guards

    class << self
      def report
        @report ||= Hash.new { |hash, key| hash[key] = [] }
      end
    end

    def deviates_on(*impls)
      Guards.report[:deviates_on] << [caller.first, impls]
      return yield if WatirSpec.unguarded?
      yield if impls.include? WatirSpec.implementation
    end

    def not_compliant_on(*impls)
      Guards.report[:not_compliant_on] << [caller.first, impls]
      return yield if WatirSpec.unguarded?
      yield unless impls.include? WatirSpec.implementation
    end

    def compliant_on(*impls)
      Guards.report[:compliant_on] << [caller.first, impls]
      return yield if WatirSpec.unguarded?
      yield if impls.include? WatirSpec.implementation
    end

    def bug(key, *impls)
      Guards.report[:bug] << [caller.first, key, impls]
      return yield if WatirSpec.unguarded?
      yield unless impls.include? WatirSpec.implementation
    end
  end
end

Object.extend(WatirSpec::Guards)<commit_msg>Fix guard bug<commit_after>module WatirSpec
  module Guards

    class << self
      def report
        @report ||= Hash.new { |hash, key| hash[key] = [] }
      end
    end

    def deviates_on(*impls)
      Guards.report[:deviates_on] << [caller.first, impls]
      return yield if WatirSpec.unguarded?
      yield if impls.include? WatirSpec.implementation
    end

    def not_compliant_on(*impls)
      Guards.report[:not_compliant_on] << [caller.first, impls]
      return yield if WatirSpec.unguarded?
      yield unless impls.include? WatirSpec.implementation
    end

    def compliant_on(*impls)
      Guards.report[:compliant_on] << [caller.first, impls]
      return yield if WatirSpec.unguarded?
      yield if impls.include? WatirSpec.implementation
    end

    def bug(key, *impls)
      Guards.report[:bug] << [caller.first, key, impls]
      return yield if WatirSpec.unguarded?
      yield unless impls.include? WatirSpec.implementation
    end
  end
end

class Object
  include WatirSpec::Guards
end
{'fraction_non_alphanumeric': 0.096248766041461, 'fraction_numerical': 0.0, 'mean_word_length': 3.005928853754941, 'pattern_counts': {'":': 0, '<': 23, '<?xml version=': 0, '>': 3, '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': '2521892', 'n_tokens_mistral': 688, 'n_tokens_neox': 653, 'n_words': 157}