Skip to content
This repository has been archived by the owner on Jun 18, 2019. It is now read-only.

Commit

Permalink
Update code and readme for the latest packages.
Browse files Browse the repository at this point in the history
  • Loading branch information
coderanger committed Jan 6, 2014
1 parent 4a729a3 commit 9007ad9
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 9 deletions.
5 changes: 2 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ to your `$PATH` for commands and init scripts.
```ruby
gem_package 'bundler' do
gem_binary '/opt/ruby-210/bin/gem'
options '--bindir /opt/ruby-210/bin'
end

execute '/opt/ruby-210/bin/bundle install' do
Expand Down Expand Up @@ -71,8 +70,8 @@ So maybe Chef isn't your cup of tea? No problem.
For Debian-related distributions:

```bash
$ echo 'deb [arch=amd64] http://ruby.poise.io precise main' | sudo tee /etc/apt/sources.list.d/poise-ruby.list
$ apt-key adv --keyserver hkp://pgp.mit.edu --recv 594F6D7656399B5C
$ sudo apt-add-repository http://ruby.poise.io
$ sudo apt-key adv --keyserver hkp://pgp.mit.edu --recv 594F6D7656399B5C
$ sudo apt-get update
$ sudo apt-get install ruby-210
```
Expand Down
14 changes: 8 additions & 6 deletions libraries/poise_ruby.rb
Original file line number Diff line number Diff line change
Expand Up @@ -21,15 +21,19 @@ class Resource::PoiseRuby < Resource
include Poise
actions(:upgrade, :install, :remove)

attribute(:package_name, name_attribute: true)
attribute(:flavor, name_attribute: true)
attribute(:version, kind_of: String)

def package_name
"poise-#{flavor}"
end
end

class Provider::PoiseRuby < Provider
include Poise

def action_upgrade
converge_by("upgrade #{new_resource.package_name} from ruby.poise.io") do
converge_by("upgrade #{new_resource.flavor} from ruby.poise.io") do
notifying_block do
install_repository
upgrade_package
Expand All @@ -38,7 +42,7 @@ def action_upgrade
end

def action_install
converge_by("install #{new_resource.package_name} from ruby.poise.io") do
converge_by("install #{new_resource.flavor} from ruby.poise.io") do
notifying_block do
install_repository
install_package
Expand All @@ -47,7 +51,7 @@ def action_install
end

def action_remove
converge_by("remove #{new_resource.package_name} from ruby.poise.io") do
converge_by("remove #{new_resource.flavor} from ruby.poise.io") do
notifying_block do
remove_repository
remove_package
Expand All @@ -72,7 +76,6 @@ def install_yum_repository
end

def install_apt_repository
raise "32-bit packages are not supported" unless node['kernel']['machine'] == 'x86_64'
codename = if node['lsb']['codename']
node['lsb']['codename']
elsif node['platform'] == 'debian' && node['platform_version'].start_with?('6.')
Expand All @@ -83,7 +86,6 @@ def install_apt_repository
uri 'http://ruby.poise.io'
distribution codename
components ['main']
arch 'amd64'
keyserver 'hkp://pgp.mit.edu'
key '594F6D7656399B5C'
end
Expand Down

0 comments on commit 9007ad9

Please sign in to comment.