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, 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



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

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



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

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



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_binaryString

This method is abstract.

The path to the ruby binary.

Returns:

  • (String)

Raises:

  • (NotImplementedError)

Since:

  • 2.0.0



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

def ruby_binary
  raise NotImplementedError
end

#ruby_environmentHash<String, String>

Output property for environment variables.

Returns:

  • (Hash<String, String>)

Since:

  • 2.0.0



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

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