lib/itamae/plugin/recipe/rbenv.rb in itamae-plugin-recipe-rbenv-0.1.2 vs lib/itamae/plugin/recipe/rbenv.rb in itamae-plugin-recipe-rbenv-0.2.0
- old
+ new
@@ -1,10 +1,21 @@
\ No newline at end of file
+def rbenv_root
+ node[:rbenv] && node[:rbenv][:rbenv_root] ? node[:rbenv][:rbenv_root] : "/usr/local/rbenv"
+end
+
+def rbenv_init
+ <<-EOS
+ export RBENV_ROOT=#{rbenv_root}
+ export PATH="#{rbenv_root}/bin:${PATH}"
+ eval "$(rbenv init --no-rehash -)"
+ EOS
+end