<commit_before>#
# Cookbook Name:: rvm
# Recipe:: system
#
# Copyright 2010, 2011 <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.
#

# thanks to:
# - http://www.agileweboperations.com/chef-rvm-ruby-enterprise-edition-as-default-ruby/
# - http://github.com/denimboy/xprdev/blob/master/rvm/recipes/default.rb

script_flags = ""
if node[:rvm][:version]
  script_flags += " --version #{node[:rvm][:version]}"
end
if node[:rvm][:branch]
  script_flags += " --branch #{node[:rvm][:branch]}"
end

pkgs = %w{ sed grep tar gzip bzip2 bash curl }
case node[:platform]
  when "centos","redhat","fedora"
    pkgs << "git"
  when "debian","ubuntu","suse"
    pkgs << "git-core"
end

pkgs.each do |pkg|
  package pkg
end

#group "rvm" do
#  members node[:rvm][:group_users]
#  append  true
#end

execute "install system-wide RVM" do
  user      "root"
  command   <<-CODE
    bash -c "bash <( curl -LB #{node[:rvm][:installer_url]} )#{script_flags}"
  CODE
  not_if    rvm_wrap_cmd(%{type rvm | head -1 | grep -q '^rvm is a function$'})
end

template  "/etc/rvmrc" do
  source  "rvmrc.erb"
  owner   "root"
  group   "rvm"
  mode    "0644"
end

execute "upgrade RVM to #{node[:rvm][:upgrade]}" do
  user      "root"
  command   rvm_wrap_cmd(%{rvm get #{node[:rvm][:upgrade]}})
  only_if do
    %{ latest head }.include? node[:rvm][:upgrade]
  end
end<commit_msg>Remove commented out block.<commit_after>#
# Cookbook Name:: rvm
# Recipe:: system
#
# Copyright 2010, 2011 <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.
#

# thanks to:
# - http://www.agileweboperations.com/chef-rvm-ruby-enterprise-edition-as-default-ruby/
# - http://github.com/denimboy/xprdev/blob/master/rvm/recipes/default.rb

script_flags = ""
if node[:rvm][:version]
  script_flags += " --version #{node[:rvm][:version]}"
end
if node[:rvm][:branch]
  script_flags += " --branch #{node[:rvm][:branch]}"
end

pkgs = %w{ sed grep tar gzip bzip2 bash curl }
case node[:platform]
  when "centos","redhat","fedora"
    pkgs << "git"
  when "debian","ubuntu","suse"
    pkgs << "git-core"
end

pkgs.each do |pkg|
  package pkg
end

execute "install system-wide RVM" do
  user      "root"
  command   <<-CODE
    bash -c "bash <( curl -LB #{node[:rvm][:installer_url]} )#{script_flags}"
  CODE
  not_if    rvm_wrap_cmd(%{type rvm | head -1 | grep -q '^rvm is a function$'})
end

template  "/etc/rvmrc" do
  source  "rvmrc.erb"
  owner   "root"
  group   "rvm"
  mode    "0644"
end

execute "upgrade RVM to #{node[:rvm][:upgrade]}" do
  user      "root"
  command   rvm_wrap_cmd(%{rvm get #{node[:rvm][:upgrade]}})
  only_if do
    %{ latest head }.include? node[:rvm][:upgrade]
  end
end
{'fraction_non_alphanumeric': 0.14344487109160725, 'fraction_numerical': 0.009873834339001646, 'mean_word_length': 3.8304635761589405, 'pattern_counts': {'":': 0, '<': 19, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 4, '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': '2437854', 'n_tokens_mistral': 1328, 'n_tokens_neox': 1269, 'n_words': 394}