Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Unified Diff: modules/ruby/manifests/init.pp

Issue 5194798336049152: As discussed.. (Closed)
Patch Set: Created April 30, 2015, 9:23 a.m.
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: modules/ruby/manifests/init.pp
diff --git a/modules/ruby/manifests/init.pp b/modules/ruby/manifests/init.pp
new file mode 100644
index 0000000000000000000000000000000000000000..2f28e1a2f729cd25374c5b97d6e2f086e1826731
--- /dev/null
+++ b/modules/ruby/manifests/init.pp
@@ -0,0 +1,48 @@
+# == Class: ruby
+#
+# Perform a custom Ruby installation based on the ruby-install script,
+# using /usr/local as installation prefix.
+#
+# === Parameters:
+#
+# [*version*]
+# The Ruby version to clone and build.
+#
+# === Examples:
+#
+# class {'ruby':
+# version => '2.2.0',
+# }
+#
+class ruby(
+ $version = '2.1.5',
+) {
+
+ $ruby_install_source_url = 'https://github.com/postmodern/ruby-install.git'
+ $ruby_install_source_dir = "/root/ruby-install"
+
+ Package {
+ ensure => 'installed',
+ }
+
+ Exec {
+ logoutput => true,
+ path => '/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin',
+ }
+
+ if !defined(Package['git']) {
+ package {'git': }
+ }
+
+ exec {'ruby-clone-ruby-install':
+ command => shellquote('git', 'clone', $ruby_install_source_url, $ruby_install_source_dir),
+ creates => $ruby_install_source_dir,
+ }
+ ->
+ exec {'ruby-execute-ruby-install':
+ command => shellquote("$ruby_install_source_dir/bin/ruby-install", '--system', 'ruby', $ruby_version),
+ creates => "/usr/local/bin/ruby",
+ }
+
+ Exec['ruby-clone-ruby-install'] <- Package['git']
+}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld