Class: PoiseRuby::RubyBuild::Provider

Inherits:
PoiseRuby::RubyProviders::Base
  • Object
show all
Includes:
Chef::Mixin::ShellOut
Defined in:
lib/poise_ruby/ruby_build/provider.rb

Overview

Inversion provider for ruby_runtime to install via ruby-build.

Since:

  • 1.0.0

Provides:

  • ruby_build

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.default_inversion_options(node, resource) ⇒ Hash

Add default options for ruby-build.

Parameters:

  • node (Chef::Node)

    Node to load from.

  • resource (Chef::Resource)

    Resource to load from.

Returns:

  • (Hash)

Since:

  • 1.0.0



37
38
39
40
41
42
43
44
# File 'lib/poise_ruby/ruby_build/provider.rb', line 37

def self.default_inversion_options(node, resource)
  super.merge({
    install_doc: false,
    install_repo: 'https://github.com/sstephenson/ruby-build.git',
    install_rev: 'master',
    prefix: '/opt/ruby_build',
  })
end

Instance Method Details

#ruby_binaryString

Path to the compiled Ruby binary.

Returns:

  • (String)

Since:

  • 1.0.0



49
50
51
# File 'lib/poise_ruby/ruby_build/provider.rb', line 49

def ruby_binary
  ::File.join(options['prefix'], 'builds', new_resource.name, 'bin', 'ruby')
end