<commit_before>require 'chef/environment'

actions :create, :delete, :nothing
default_action :create

attribute :complete, :kind_of => [TrueClass, FalseClass]

attribute :name, :kind_of => String, :regex => Cheffish::NAME_REGEX, :name_attribute => true
attribute :description, :kind_of => String
attribute :cookbook_versions, :kind_of => Hash, :callbacks => {
  "should have valid cookbook versions" => lambda { |value| Chef::Environment.validate_cookbook_versions(value) }
}
attribute :default_attributes, :kind_of => Hash
attribute :override_attributes, :kind_of => Hash

# TODO Patchy methods: setting these will patch up attributes without deleting things (unless complete is specified)
# cookbook_version 'apache', '= 1.0.0'
# cookbook_version 'apache', :delete
# default_attribute 'ip_address', '127.0.0.1'
# default_attribute 'ip_address', :delete
# override_attribute 'ip_address', '127.0.0.1'
# override_attribute [ 'pushy', 'port' ], '8000'<commit_msg>Move control options to the bottom<commit_after>require 'chef/environment'

actions :create, :delete, :nothing
default_action :create

attribute :name, :kind_of => String, :regex => Cheffish::NAME_REGEX, :name_attribute => true
attribute :description, :kind_of => String
attribute :cookbook_versions, :kind_of => Hash, :callbacks => {
  "should have valid cookbook versions" => lambda { |value| Chef::Environment.validate_cookbook_versions(value) }
}
attribute :default_attributes, :kind_of => Hash
attribute :override_attributes, :kind_of => Hash

# TODO Patchy methods: setting these will patch up attributes without deleting things (unless complete is specified)
# cookbook_version 'apache', '= 1.0.0'
# cookbook_version 'apache', :delete
# default_attribute 'ip_address', '127.0.0.1'
# default_attribute 'ip_address', :delete
# override_attribute 'ip_address', '127.0.0.1'
# override_attribute [ 'pushy', 'port' ], '8000'

# Control options
attribute :complete, :kind_of => [TrueClass, FalseClass]
{'fraction_non_alphanumeric': 0.12888436067244013, 'fraction_numerical': 0.01935812531839022, 'mean_word_length': 6.887550200803213, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 23, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 4, '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': '6578994', 'n_tokens_mistral': 612, 'n_tokens_neox': 587, 'n_words': 168}