From 34f1d63495f5730f278f3e5968aa23a06d80ea61 Mon Sep 17 00:00:00 2001 From: Andrew Vit Date: Sun, 14 Oct 2012 01:17:00 -0700 Subject: [PATCH] Initial commit --- README.md | 14 +++++++++++ files/default/gemrc | 8 +++++++ metadata.rb | 6 +++++ recipes/default.rb | 20 ++++++++++++++++ recipes/ruby.rb | 58 +++++++++++++++++++++++++++++++++++++++++++++ 5 files changed, 106 insertions(+) create mode 100644 README.md create mode 100644 files/default/gemrc create mode 100644 metadata.rb create mode 100644 recipes/default.rb create mode 100644 recipes/ruby.rb diff --git a/README.md b/README.md new file mode 100644 index 0000000..374802b --- /dev/null +++ b/README.md @@ -0,0 +1,14 @@ +Description +=========== +Install latest ruby 1.9.3 from brightbox PPA + +Requirements +============ +Ubuntu + +Attributes +========== + +Usage +===== +`recipe[brightbox::ruby]` diff --git a/files/default/gemrc b/files/default/gemrc new file mode 100644 index 0000000..2f1f39a --- /dev/null +++ b/files/default/gemrc @@ -0,0 +1,8 @@ +--- +:backtrace: false +:benchmark: false +:update_sources: true +:bulk_threshold: 1000 +:verbose: true +install: --no-ri --no-rdoc +update: --no-ri --no-rdoc diff --git a/metadata.rb b/metadata.rb new file mode 100644 index 0000000..3c8ac49 --- /dev/null +++ b/metadata.rb @@ -0,0 +1,6 @@ +maintainer "Andrew Vit" +maintainer_email "andrew@avit.ca" +license "Apache 2.0" +description "Installs latest ruby patch version" +long_description IO.read(File.join(File.dirname(__FILE__), 'README.md')) +version "0.1.0" diff --git a/recipes/default.rb b/recipes/default.rb new file mode 100644 index 0000000..1d83a8a --- /dev/null +++ b/recipes/default.rb @@ -0,0 +1,20 @@ +# +# Cookbook Name:: brightbox +# Recipe:: default +# +# Copyright 2012, Andrew Vit +# +# 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. +# + +include_recipe "brightbox::ruby" diff --git a/recipes/ruby.rb b/recipes/ruby.rb new file mode 100644 index 0000000..734e6ab --- /dev/null +++ b/recipes/ruby.rb @@ -0,0 +1,58 @@ +# +# Cookbook Name:: brightbox +# Recipe:: ruby +# +# Copyright 2012, Andrew Vit +# +# 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. +# + +apt_repository "brightbox-ruby-ng" do + action :add + uri "http://ppa.launchpad.net/brightbox/ruby-ng-experimental/ubuntu" + distribution node['lsb']['codename'] + components ["main"] + keyserver "keyserver.ubuntu.com" + key "C3173AA6" +end + +apt_package "build-essential" +apt_package "libreadline-dev" +apt_package "libsqlite3-dev" +apt_package "libmysqlclient-dev" +apt_package "libssl-dev" +apt_package "libxml2-dev" +apt_package "libxslt-dev" +apt_package "libyaml-dev" +apt_package "openssl" +apt_package "sqlite3" +apt_package "zlib1g" + +apt_package "ruby" +apt_package "ruby1.9.3" + +execute "update-alternatives ruby" do + command "update-alternatives --set ruby /usr/bin/ruby1.9.1" +end + +cookbook_file "/etc/gemrc" do + action :create_if_missing + source "gemrc" + mode "0644" +end + +["bundler", "rake", "rubygems-bundler"].each do |gem| + gem_package gem do + action :install + end +end