Class: PoiseRuby::Resources::RubyRuntime::Resource

Inherits:
Chef::Resource
  • Object
show all
Defined in:
lib/poise_ruby/resources/ruby_runtime.rb

Overview

A ruby_runtime resource to manage Ruby installations.

Examples:

ruby_runtime '2.1.2'

Since:

  • 2.0.0

Provides:

  • ruby_runtime

Actions:

  • install

  • uninstall

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#bundler_versionString, Boolean

Note:

Disabling the Bundler install may result in other resources being non-functional.

Version of Bundler to install. It set to true, the latest available version will be used. If set to false, Bundler will not be installed.

Returns:

  • (String, Boolean)


49
# File 'lib/poise_ruby/resources/ruby_runtime.rb', line 49

attribute(:bundler_version, kind_of: [String, TrueClass, FalseClass], default: true)

#versionString

Version of Ruby to install.

Returns:

  • (String)


41
# File 'lib/poise_ruby/resources/ruby_runtime.rb', line 41

attribute(:version, kind_of: String, name_attribute: true)

Instance Method Details

#gem_binaryString

The path to the gem binary for this Ruby installation. This is an output property.

Examples:

execute "#{resources('ruby_runtime[2.2.2]').gem_binary} install myapp"

Returns:

  • (String)

Since:

  • 2.0.0



79
80
81
# File 'lib/poise_ruby/resources/ruby_runtime.rb', line 79

def gem_binary
  @gem_binary ||= provider_for_action(:gem_binary).gem_binary
end

#ruby_binaryString

The path to the ruby binary for this Ruby installation. This is an output property.

Examples:

execute "#{resources('ruby_runtime[2.2.2]').ruby_binary} myapp.rb"

Returns:

  • (String)

Since:

  • 2.0.0



57
58
59
# File 'lib/poise_ruby/resources/ruby_runtime.rb', line 57

def ruby_binary
  @ruby_binary ||= provider_for_action(:ruby_binary).ruby_binary
end

#ruby_environmentHash<String, String>

The environment variables for this Ruby installation. This is an output property.

Examples:

execute '/opt/myapp.py' do
  environment resources('ruby_runtime[2.2.2]').ruby_environment
end

Returns:

  • (Hash<String, String>)

Since:

  • 2.0.0



69
70
71
# File 'lib/poise_ruby/resources/ruby_runtime.rb', line 69

def ruby_environment
  @ruby_environment ||= provider_for_action(:ruby_environment).ruby_environment
end