Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
tree: 3117891c16
Fetching contributors…

Cannot retrieve contributors at this time

file 33 lines (26 sloc) 0.68 kb
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33
require 'chef/provider/package'

require 'open-uri'
require 'json'

class Chef::Provider::Package::Rbenv < ::Chef::Provider
  def initialize(new_resource, run_context)
    super

    @user = run_context.node[:rbenv][:user]
  end

  include Chef::Mixin::Command

  def load_current_resource
  end

  def action_install
    resource, user = @new_resource, @user
    execute "rbenv install #{resource.definition}" do
      command "ruby-build #{resource.definition} #{resource.prefix}"
      user user
      not_if { ::File.exist?(resource.prefix) }
    end
  end

  def action_remove
    directory @new_resource.prefix do
      recursive true
      action :delete
    end
  end
end
Something went wrong with that request. Please try again.