<commit_before># lib/puppet/type/firewall_rule.rb
Puppet::Type.newtype(:firewall_rule) do
  @doc = "Define Windows advanced firewall rules."

  newparam(:name) do
    desc "Name."
	isnamevar
  end

  newparam(:enabled) do
    if value
      if @resource.provider and @resource.provider.respond_to?(:create)
          @resource.provider.create
      else
          @resource.create
      end
      nil
    end
  end

  newproperty(:rule_hash) do
    desc "Apply firewall rule hash from Hiera."

    validation_hash = Hash.new()
	validation_hash['ensure'] = /^(present|absent)$/i
    validation_hash['protocol'] = /^(ICMPv4|IGMP|TCP|UDP|IPv6|IPv6Route|IPv6Frag|GRE|ICMPv6|IPv6NoNxt|IPv6Opts|VRRP|PGM|L2TP|1|2|6|17|41|43|44|47|58|59|60|112|113|115)$/i
    validation_hash['direction'] = /^(In|Out|1|2)$/i
    validation_hash['interface_types'] = /^(((Wireless|Lan|RemoteAccess)(,(?!$))?(?!\3)){1,2}|All)$/i<commit_msg>Testing custom type 'firewall_rule'<commit_after># lib/puppet/type/firewall_rule.rb
Puppet::Type.newtype(:firewall_rule) do
  @doc = "Define Windows advanced firewall rules."

  newparam(:name) do
    desc "Name."
	isnamevar
  end

  newparam(:enabled) do |value|
    if value
      if @resource.provider and @resource.provider.respond_to?(:create)
          @resource.provider.create
      else
          @resource.create
      end
      nil
    end
  end

  newproperty(:rule_hash) do
    desc "Apply firewall rule hash from Hiera."

    validation_hash = Hash.new()
	validation_hash['ensure'] = /^(present|absent)$/i
    validation_hash['protocol'] = /^(ICMPv4|IGMP|TCP|UDP|IPv6|IPv6Route|IPv6Frag|GRE|ICMPv6|IPv6NoNxt|IPv6Opts|VRRP|PGM|L2TP|1|2|6|17|41|43|44|47|58|59|60|112|113|115)$/i
    validation_hash['direction'] = /^(In|Out|1|2)$/i
    validation_hash['interface_types'] = /^(((Wireless|Lan|RemoteAccess)(,(?!$))?(?!\3)){1,2}|All)$/i
{'fraction_non_alphanumeric': 0.16451612903225807, 'fraction_numerical': 0.04408602150537634, 'mean_word_length': 4.301994301994302, 'pattern_counts': {'":': 0, '<': 3, '<?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': '1664039', 'n_tokens_mistral': 752, 'n_tokens_neox': 699, 'n_words': 103}