Sha256: 2046c5585b71a8a85b0d2097f842e053d8723c711ba2019498e37da71c5e7a57

Contents?: true

Size: 1.07 KB

Versions: 8

Compression:

Stored size: 1.07 KB

Contents

class Chef
  class Provider
    class Package
      class Rubygems < Chef::Provider::Package

        def install_via_gem_command(name, version)
          src = []
          if new_resource.source.is_a?(String) && new_resource.source =~ /\.gem$/i
            name = new_resource.source
          else
            src << "--clear-sources" if new_resource.clear_sources
            src += gem_sources.map { |s| "--source=#{s}" }
          end
          src_str = src.empty? ? "" : " #{src.join(" ")}"
          cmd = if !version.nil? && !version.empty?
            "#{gem_binary_path} install #{name} -q --no-rdoc --no-ri -v \"#{version}\"#{src_str}#{opts}"
          else
            "#{gem_binary_path} install \"#{name}\" -q --no-rdoc --no-ri #{src_str}#{opts}"
          end

          begin
            shell_out_with_timeout!(cmd, env: nil)
          rescue StandardError => e
            if cmd.match(/--no-rdoc|--no-ri/)
              cmd.gsub!(/--no-rdoc --no-ri/, "--no-document")
              retry
            end
            raise e
          end
        end

      end
    end
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
cloud-mu-3.4.0 cookbooks/mu-tools/libraries/monkey.rb
cloud-mu-3.3.2 cookbooks/mu-tools/libraries/monkey.rb
cloud-mu-3.3.1 cookbooks/mu-tools/libraries/monkey.rb
cloud-mu-3.3.0 cookbooks/mu-tools/libraries/monkey.rb
cloud-mu-3.2.0 cookbooks/mu-tools/libraries/monkey.rb
cloud-mu-3.1.6 cookbooks/mu-tools/libraries/monkey.rb
cloud-mu-3.1.5 cookbooks/mu-tools/libraries/monkey.rb
cloud-mu-3.1.4 cookbooks/mu-tools/libraries/monkey.rb