Class: PoiseRuby::Resources::BundleInstall::Resource

Inherits:
Chef::Resource
  • Object
show all
Includes:
Poise, PoiseRuby::RubyCommandMixin
Defined in:
lib/poise_ruby/resources/bundle_install.rb

Overview

Note:

This resource is not idempotent itself, it will always run bundle install.

A bundle_install resource to install a Bundler Gemfile.

Examples:

bundle_install '/opt/my_app' do
  gem_path '/usr/local/bin/gem'
end

Since:

  • 2.0.0

Provides:

  • bundle_install

Actions:

  • install

  • update

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#binstubsBoolean, String

Enable binstubs. If set to a string it is the path to generate stubs in.

Returns:

  • (Boolean, String)


59
# File 'lib/poise_ruby/resources/bundle_install.rb', line 59

attribute(:binstubs, kind_of: [TrueClass, String])

#deploymentBoolean

Enable deployment mode.

Returns:

  • (Boolean)


63
# File 'lib/poise_ruby/resources/bundle_install.rb', line 63

attribute(:deployment, equal_to: [true, false], default: false)

#jobsString, Integer

Number of parallel installations to run.

Returns:

  • (String, Integer)


67
# File 'lib/poise_ruby/resources/bundle_install.rb', line 67

attribute(:jobs, kind_of: [String, Integer])

#pathString

Path to the Gemfile or to a directory that contains a Gemfile.

Returns:

  • (String)


54
# File 'lib/poise_ruby/resources/bundle_install.rb', line 54

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

#retryString, Integer

Number of times to retry failed installations.

Returns:

  • (String, Integer)


71
# File 'lib/poise_ruby/resources/bundle_install.rb', line 71

attribute(:retry, kind_of: [String, Integer])

#userString, ...

User to run bundler as.

Returns:

  • (String, Integery, nil)


75
# File 'lib/poise_ruby/resources/bundle_install.rb', line 75

attribute(:user, kind_of: [String, Integer, NilClass])

#vendorBoolean, String

Enable local vendoring. This maps to the --path option in bundler, but that attribute name is already used.

Returns:

  • (Boolean, String)


80
# File 'lib/poise_ruby/resources/bundle_install.rb', line 80

attribute(:vendor, kind_of: [TrueClass, String])

#withoutString+

Group or groups to not install.

Returns:

  • (String, Array<String>)


84
# File 'lib/poise_ruby/resources/bundle_install.rb', line 84

attribute(:without, kind_of: [Array, String])

Instance Method Details

#bundler_binaryString

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

Examples:

execute "#{resources('bundle_install[/opt/myapp]').bundler_binary} vendor"

Returns:

  • (String)

Since:

  • 2.0.0



92
93
94
# File 'lib/poise_ruby/resources/bundle_install.rb', line 92

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

#gemfile_pathString

The path to the Gemfile for this installation. This is an output property.

Examples:

file resources('bundle_install[/opt/myapp]').gemfile_path do
  owner 'root'
end

Returns:

  • (String)

Since:

  • 2.0.0



104
105
106
# File 'lib/poise_ruby/resources/bundle_install.rb', line 104

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