Class: PoiseRuby::RubyProviders::Base
- Inherits:
-
Chef::Provider
- Object
- Chef::Provider
- PoiseRuby::RubyProviders::Base
- Defined in:
- lib/poise_ruby/ruby_providers/base.rb
Overview
Instance Method Summary collapse
-
#action_install
The
installaction for theruby_runtimeresource. -
#action_uninstall
The
uninstallaction for theruby_runtimeresource. -
#gem_binary ⇒ String
The path to the
gembinary. -
#ruby_binary ⇒ String
abstract
The path to the
rubybinary. -
#ruby_environment ⇒ Hash<String, String>
Output property for environment variables.
Instance Method Details
#action_install
This method returns an undefined value.
The install action for the ruby_runtime resource.
41 42 43 44 45 46 |
# File 'lib/poise_ruby/ruby_providers/base.rb', line 41 def action_install do install_ruby install_bundler end end |
#action_uninstall
This method returns an undefined value.
The uninstall action for the ruby_runtime resource.
51 52 53 54 55 |
# File 'lib/poise_ruby/ruby_providers/base.rb', line 51 def action_uninstall do uninstall_ruby end end |
#gem_binary ⇒ String
The path to the gem binary. Look relative to the
ruby binary for a default implementation.
77 78 79 80 81 82 83 |
# File 'lib/poise_ruby/ruby_providers/base.rb', line 77 def gem_binary dir, base = ::File.split(ruby_binary) # If this ruby is called something weird, bail out. raise NotImplementedError unless base.start_with?('ruby') # Allow for names like "ruby2.0" -> "gem2.0". ::File.join(dir, base.sub(/^ruby/, 'gem')) end |
#ruby_binary ⇒ String
This method is abstract.
The path to the ruby binary.
61 62 63 |
# File 'lib/poise_ruby/ruby_providers/base.rb', line 61 def ruby_binary raise NotImplementedError end |
#ruby_environment ⇒ Hash<String, String>
Output property for environment variables.
68 69 70 71 |
# File 'lib/poise_ruby/ruby_providers/base.rb', line 68 def ruby_environment # No environment variables needed. Rejoice. {} end |