<commit_before>#
# Author:: <NAME> (<EMAIL>)
# Contributor:: <NAME> (<EMAIL>)
# Cookbook Name:: iis
# Provider:: pool
#
# Copyright:: 2011, Webtrends Inc.
#
# 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.
#

require 'chef/mixin/shell_out'
require 'rexml/document'

include Chef::Mixin::ShellOut
include REXML
include Opscode::IIS::Helper

action :add do
  if !@current_resource.exists
    cmd = "#{appcmd(node)} add apppool /name:\"#{new_resource.pool_name}\""
    if new_resource.no_managed_code
      cmd << " /managedRuntimeVersion:\"#{new_resource.runtime_version}\""
    else
      cmd << " /managedRuntimeVersion:v#{new_resource.runtime_version}" if new_resource.runtime_version || !new_resource.no_managed_code
    end
    cmd << " /managedPipelineMode:#{new_resource.pipeline_mode.capitalize}" if new_resource.pipeline_mode
    cmd << " /commit:\"MACHINE/WEBROOT/APPHOST\""<commit_msg>removing extra "no_managed_code" condition as per the code review comment<commit_after>#
# Author:: <NAME> (<EMAIL>)
# Contributor:: <NAME> (<EMAIL>)
# Cookbook Name:: iis
# Provider:: pool
#
# Copyright:: 2011, Webtrends Inc.
#
# 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.
#

require 'chef/mixin/shell_out'
require 'rexml/document'

include Chef::Mixin::ShellOut
include REXML
include Opscode::IIS::Helper

action :add do
  if !@current_resource.exists
    cmd = "#{appcmd(node)} add apppool /name:\"#{new_resource.pool_name}\""
    if new_resource.no_managed_code
      cmd << " /managedRuntimeVersion:\"#{new_resource.runtime_version}\""
    else
      cmd << " /managedRuntimeVersion:v#{new_resource.runtime_version}" if new_resource.runtime_version
    end
    cmd << " /managedPipelineMode:#{new_resource.pipeline_mode.capitalize}" if new_resource.pipeline_mode
    cmd << " /commit:\"MACHINE/WEBROOT/APPHOST\""
{'fraction_non_alphanumeric': 0.11512334644261708, 'fraction_numerical': 0.00572041473006793, 'mean_word_length': 4.7690721649484535, 'pattern_counts': {'":': 0, '<': 27, '<?xml version=': 0, '>': 11, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, 'xml': 2}, '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': '2834401', 'n_tokens_mistral': 848, 'n_tokens_neox': 839, 'n_words': 269}