<commit_before>#
# Cookbook Name:: perl
# Recipe:: default
#
# Copyright 2009, Opscode, 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.
#

package "perl" do
  action :upgrade
end

if %w{redhat centos fedora scientific oracle amazon}.include?(node['platform'])
  package "perl-CPAN" do
    action :upgrade
  end
end

libwww_perl = case node[:platform]
  when "redhat","centos","fedora","scientific","oracle","amazon"
    "perl-libwww-perl"
  when "arch"
    "perl-libwww"
  when "debian","ubuntu","mint"
    "libwww-perl"
  else
    raise "unsupported operating system"
  end

package libwww_perl do
  action :upgrade
end

libperl_dev = case node[:platform]
  when "redhat","centos","fedora","scientific","oracle","amazon"
    "perl-devel"
  when "ubuntu","debian","mint" 
    "libperl-dev"
  when "arch"
    nil
  else
    raise "unsupported operating system"
  end

package libperl_dev do
  action :upgrade
end unless libperl_dev.nil?

directory "/root/.cpan" do
  owner "root"
  group "root"
  mode 0750
end

cookbook_file "CPAN-Config.pm" do
  path case node[:platform]
    when "redhat","centos","scientific","oracle"
      if node[:platform_version].to_f >= 6
        "/usr/share/perl5/CPAN/Config.pm"
      else
        "/usr/lib/perl5/#{node[:languages][:perl][:version]}/CPAN/Config.pm"
      end
    when "amazon","fedora"
      # FIXME: need platform_version tests for fedora and amazon
      "/usr/share/perl5/CPAN/Config.pm"
    when "arch"
      "/usr/share/perl5/core_perl/CPAN/Config.pm"
    when "debian","ubuntu","mint"
      "/etc/perl/CPAN/Config.pm"
    else
      raise "unsupported operating system"
    end
  source "Config-#{node[:languages][:perl][:version]}.pm"
  owner "root"
  group "root"
  mode 0644
end
<commit_msg>remove raise litter<commit_after>#
# Cookbook Name:: perl
# Recipe:: default
#
# Copyright 2009, Opscode, 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.
#

package "perl" do
  action :upgrade
end

if %w{redhat centos fedora scientific oracle amazon}.include?(node['platform'])
  package "perl-CPAN" do
    action :upgrade
  end
end

libwww_perl = case node[:platform]
  when "redhat","centos","fedora","scientific","oracle","amazon"
    "perl-libwww-perl"
  when "arch"
    "perl-libwww"
  when "debian","ubuntu","mint"
    "libwww-perl"
  end

package libwww_perl do
  action :upgrade
end

libperl_dev = case node[:platform]
  when "redhat","centos","fedora","scientific","oracle","amazon"
    "perl-devel"
  when "ubuntu","debian","mint" 
    "libperl-dev"
  when "arch"
    nil
  end

package libperl_dev do
  action :upgrade
end unless libperl_dev.nil?

directory "/root/.cpan" do
  owner "root"
  group "root"
  mode 0750
end

cookbook_file "CPAN-Config.pm" do
  path case node[:platform]
    when "redhat","centos","scientific","oracle"
      if node[:platform_version].to_f >= 6
        "/usr/share/perl5/CPAN/Config.pm"
      else
        "/usr/lib/perl5/#{node[:languages][:perl][:version]}/CPAN/Config.pm"
      end
    when "amazon","fedora"
      # FIXME: need platform_version tests for fedora and amazon
      "/usr/share/perl5/CPAN/Config.pm"
    when "arch"
      "/usr/share/perl5/core_perl/CPAN/Config.pm"
    when "debian","ubuntu","mint"
      "/etc/perl/CPAN/Config.pm"
    end
  source "Config-#{node[:languages][:perl][:version]}.pm"
  owner "root"
  group "root"
  mode 0644
end

{'fraction_non_alphanumeric': 0.12764003673094582, 'fraction_numerical': 0.009641873278236915, 'mean_word_length': 3.705183585313175, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 12, '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': '3697426', 'n_tokens_mistral': 1517, 'n_tokens_neox': 1406, 'n_words': 417}