summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--README.md4
-rw-r--r--manifests/install.pp13
2 files changed, 12 insertions, 5 deletions
diff --git a/README.md b/README.md
index a792b86..f0b8c53 100644
--- a/README.md
+++ b/README.md
@@ -18,12 +18,12 @@ https://github.com/evanstachowiak/puppet-bundler bundler)
By default this will install bundler with RVM, if you wish to use another
method, you can pass any puppet package provider to the class as
- 'install_method', or just use '' if you wish the puppet parser to
+ 'install_method', or just use undef if you wish the puppet parser to
automatically chose the best method for your platform.
Examples: class { 'bundler::install': install_method => 'fink' };
class { 'bundler::install': install_method => 'gem' };
- class { 'bundler::install': install_method => '' }
+ class { 'bundler::install': install_method => undef }
3. Set whatever config variables are necessary:
bundler::config { 'linecache19':
diff --git a/manifests/install.pp b/manifests/install.pp
index 73ceb59..4111d52 100644
--- a/manifests/install.pp
+++ b/manifests/install.pp
@@ -20,10 +20,17 @@
class bundler::install (
$ruby_version = undef,
$ensure = 'present',
- $install_method = $bundler::params::install_method,
+ $install_method = 'rvm',
) inherits bundler::params {
- if $install_method == 'rvm' {
+ if $install_method == undef {
+ $provider_method = undef
+ }
+ else {
+ $provider_method = $bundler::params::install_method
+ }
+
+ if $provider_method == 'rvm' {
if $ruby_version == undef {
fail('When using rvm, you must pass a ruby_version')
}
@@ -38,7 +45,7 @@ class bundler::install (
else {
package { 'bundler':
ensure => $ensure,
- provider => $install_method,
+ provider => $provider_method,
}
}