<commit_before>#
# Author:: <NAME> <<EMAIL>>
# Author:: <NAME> <<EMAIL>>
# Author:: <NAME> <<EMAIL>>
#
# Copyright 2010-2014, VMware, Inc.
# Copyright 2013-2014, <NAME>
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#

class Chef
  class Resource::PoiseProxy < Resource
    include Poise
    actions(:install)

    attribute('', template: true)
    attribute(:extra, template: true, default_content: '')
    attribute(:proxy_name, kind_of: String, name_attribute: true)
    attribute(:port, kind_of: [String, Integer], default: lazy { parent ? parent.port : 8080 })
    attribute(:listen_ports, kind_of: Array, default: lazy { defaults['listen_ports'] })
    attribute(:hostname, kind_of: String, default: lazy { defaults['hostname'] || node['fqdn'] })
    attribute(:ssl_enabled, equal_to: [true, false], default: lazy { ssl_cert || ssl_key || defaults['ssl_enabled'] })
    attribute(:ssl_redirect_http, equal_to: [true, false], default: lazy { defaults['ssl_redirect_http'] })
    attribute(:ssl_listen_ports, kind_of: Array, default: lazy { defaults['ssl_listen_ports'] })
    attribute(:ssl_path, kind_of: String, default: lazy { defaults['ssl_path'] || ::File.join((parent && parent.respond_to?(:path) ? parent.path : '/etc'), 'ssl') })
    attribute(:ssl_cert, kind_of: String)
    attribute(:ssl_key, kind_of: String)
    attribute(:ssl_cert_path, kind_of: String, default: lazy { defaults['ssl_cert_path'] || ::File.join(ssl_path, "certs", "#{proxy_name}.pem") })
    attribute(:ssl_key_path, kind_of: String, default: lazy { defaults['ssl_key_path'] || ::File.join(ssl_path, "private", "#{proxy_name}.key") })

    def parent(arg=nil)
      arg = run_context.resource_collection.find(arg) if arg.is_a?(String)
      set_or_return(:parent, arg, kind_of: Resource)
    end
<commit_msg>enable multiple hostnames<commit_after>#
# Author:: <NAME> <<EMAIL>>
# Author:: <NAME> <<EMAIL>>
# Author:: <NAME> <<EMAIL>>
#
# Copyright 2010-2014, VMware, Inc.
# Copyright 2013-2014, <NAME>
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#

class Chef
  class Resource::PoiseProxy < Resource
    include Poise
    actions(:install)

    attribute('', template: true)
    attribute(:extra, template: true, default_content: '')
    attribute(:proxy_name, kind_of: String, name_attribute: true)
    attribute(:port, kind_of: [String, Integer], default: lazy { parent ? parent.port : 8080 })
    attribute(:listen_ports, kind_of: Array, default: lazy { defaults['listen_ports'] })
    attribute(:hostname, kind_of: [String, Array], default: lazy { defaults['hostname'] || node['fqdn'] })
    attribute(:ssl_enabled, equal_to: [true, false], default: lazy { ssl_cert || ssl_key || defaults['ssl_enabled'] })
    attribute(:ssl_redirect_http, equal_to: [true, false], default: lazy { defaults['ssl_redirect_http'] })
    attribute(:ssl_listen_ports, kind_of: Array, default: lazy { defaults['ssl_listen_ports'] })
    attribute(:ssl_path, kind_of: String, default: lazy { defaults['ssl_path'] || ::File.join((parent && parent.respond_to?(:path) ? parent.path : '/etc'), 'ssl') })
    attribute(:ssl_cert, kind_of: String)
    attribute(:ssl_key, kind_of: String)
    attribute(:ssl_cert_path, kind_of: String, default: lazy { defaults['ssl_cert_path'] || ::File.join(ssl_path, "certs", "#{proxy_name}.pem") })
    attribute(:ssl_key_path, kind_of: String, default: lazy { defaults['ssl_key_path'] || ::File.join(ssl_path, "private", "#{proxy_name}.key") })

    def parent(arg=nil)
      arg = run_context.resource_collection.find(arg) if arg.is_a?(String)
      set_or_return(:parent, arg, kind_of: Resource)
    end

{'fraction_non_alphanumeric': 0.14378942788775287, 'fraction_numerical': 0.010441592342832281, 'mean_word_length': 5.147058823529412, 'pattern_counts': {'":': 0, '<': 25, '<?xml version=': 0, '>': 23, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, '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': '4519572', 'n_tokens_mistral': 1421, 'n_tokens_neox': 1382, 'n_words': 413}