Class: PoiseRuby::RubyProviders::Base

Inherits:
Chef::Provider
  • Object
show all
Defined in:
lib/poise_ruby/ruby_providers/base.rb

Overview

Since:

  • 2.0.0

Direct Known Subclasses

ChefRuby, Dummy, Scl, System

Instance Method Summary collapse

Instance Method Details

#action_install

This method returns an undefined value.

The install action for the ruby_runtime resource.

Since:

  • 2.0.0



42
43
44
45
46
47
# File 'lib/poise_ruby/ruby_providers/base.rb', line 42

def action_install
  notifying_block do
    install_ruby
    install_bundler
  end
end

#action_uninstall

This method returns an undefined value.

The uninstall action for the ruby_runtime resource.

Since:

  • 2.0.0



52
53
54
55
56
# File 'lib/poise_ruby/ruby_providers/base.rb', line 52

def action_uninstall
  notifying_block do
    uninstall_ruby
  end
end

#gem_binaryString

The path to the gem binary. Look relative to the ruby binary for a default implementation.

Returns:

  • (String)

Raises:

  • (NotImplementedError)

Since:

  • 2.0.0



78
79
80
81
82
83
84
# File 'lib/poise_ruby/ruby_providers/base.rb', line 78

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_binaryString

This method is abstract.

The path to the ruby binary.

Returns:

  • (String)

Raises:

  • (NotImplementedError)

Since:

  • 2.0.0



62
63
64
# File 'lib/poise_ruby/ruby_providers/base.rb', line 62

def ruby_binary
  raise NotImplementedError
end

#ruby_environmentHash<String, String>

Output property for environment variables.

Returns:

  • (Hash<String, String>)

Since:

  • 2.0.0



69
70
71
72
# File 'lib/poise_ruby/ruby_providers/base.rb', line 69

def ruby_environment
  # No environment variables needed. Rejoice.
  {}
end