2012-07-05 21:05:53 +00:00
|
|
|
class ruby($version = '', $deb_url = '', $configure = "--disable-install-doc", $build_path = '') {
|
2012-06-23 02:02:08 +00:00
|
|
|
gem { [ 'bundler', 'penchant' ]:
|
|
|
|
path => "${path}:${base::path}",
|
|
|
|
ensure => present
|
2012-01-31 01:28:30 +00:00
|
|
|
}
|
|
|
|
|
2012-07-05 21:05:53 +00:00
|
|
|
if ($::osfamily == 'debian') {
|
2012-06-23 02:02:08 +00:00
|
|
|
$path = '/usr/bin'
|
2012-06-13 11:58:41 +00:00
|
|
|
|
2012-06-23 02:02:08 +00:00
|
|
|
remotedeb { ruby:
|
|
|
|
url => $deb_url,
|
|
|
|
version => $version
|
2012-06-13 11:58:41 +00:00
|
|
|
}
|
|
|
|
|
2012-06-23 02:02:08 +00:00
|
|
|
Remotedeb[ruby] -> Gem['bundler', 'penchant']
|
|
|
|
} else {
|
|
|
|
$path = bin_path($name)
|
|
|
|
|
|
|
|
build_and_install { $name:
|
|
|
|
version => $version,
|
|
|
|
source => "http://ftp.ruby-lang.org/pub/ruby/1.9/ruby-<%= version %>.tar.gz",
|
|
|
|
configure => $configure,
|
|
|
|
preconfigure => "LDFLAGS='-rdynamic -Wl,-export-dynamic'",
|
2012-07-10 20:03:16 +00:00
|
|
|
path => $build_path
|
2012-06-13 11:58:41 +00:00
|
|
|
}
|
|
|
|
|
2012-06-23 02:02:08 +00:00
|
|
|
if ($osfamily == 'debian') {
|
|
|
|
$packages = [
|
|
|
|
'libyaml-dev', 'libreadline-dev', 'libssl-dev', 'libffi-dev',
|
|
|
|
'libncurses5-dev', 'libcurl4-openssl-dev', 'zlib1g-dev',
|
|
|
|
'libxml2', 'libxml2-dev', 'libxslt1.1', 'libxslt1-dev'
|
|
|
|
]
|
|
|
|
|
|
|
|
package { $packages:
|
|
|
|
ensure => installed,
|
|
|
|
before => Build_and_install[$name]
|
|
|
|
}
|
|
|
|
|
|
|
|
bash_rc_d { 'ruby':
|
|
|
|
ensure => present,
|
|
|
|
path => $base::local_path,
|
|
|
|
require => Build_and_install[$name]
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
Build_and_install[ruby] -> Gem['bundler', 'penchant']
|
2012-01-31 01:28:30 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|