From 3bb6ab5545b3219b28e04d6f014c608d83e18fa6 Mon Sep 17 00:00:00 2001 From: Michael Sofaer Date: Thu, 4 Nov 2010 19:49:01 -0700 Subject: [PATCH] Harden Ruby again. This needs a serious refactor. --- chef/cookbooks/centos/recipes/main.rb | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/chef/cookbooks/centos/recipes/main.rb b/chef/cookbooks/centos/recipes/main.rb index dd04a91d2..7665d9952 100644 --- a/chef/cookbooks/centos/recipes/main.rb +++ b/chef/cookbooks/centos/recipes/main.rb @@ -1,7 +1,19 @@ -execute "say hello" do - command "echo welcome to diaspora chef" +def harden_ruby(ruby_string) + Dir.glob("/usr/local/rvm/wrappers/#{ruby_string}/*").each do |file| + link "/usr/local/bin/#{file.split('/').last}" do + to file + end + end + Dir.glob("/usr/local/rvm/gems/#{ruby_string}/bin/*").each do |file| + link "/usr/local/bin/#{file.split('/').last}" do + to file + end + end + end +harden_ruby("ruby-1.8.7-p302") + include_recipe "centos::image_magick" include_recipe "centos::mongo_db" -include_recipe "common::main" +include_recipe "common::main" \ No newline at end of file