# class Chef::Resource::ChefGem

### Public Class Methods

new(name, run_context=nil) click to toggle source
Calls superclass method

    # File lib/chef/resource/chef_gem.rb, line 28
    def initialize(name, run_context=nil)
      super
      @resource_name = :chef_gem
      @provider = Chef::Provider::Package::Rubygems
    end

### Public Instance Methods

after_created() click to toggle source

    # File lib/chef/resource/chef_gem.rb, line 43
    def after_created
      # Chef::Resource.run_action: Caveat: this skips Chef::Runner.run_action, where notifications are handled
      # Action could be an array of symbols, but probably won't (think install + enable for a package)
      Array(@action).each do |action|
        self.run_action(action)
      end
      Gem.clear_paths
    end

gem_binary(arg=nil) click to toggle source

The chef_gem resources is for installing gems to the current gem environment only for use by Chef cookbooks.

    # File lib/chef/resource/chef_gem.rb, line 35
    def gem_binary(arg=nil)
      if arg
        raise ArgumentError, "The chef_gem resource is restricted to the current gem environment, use gem_package to install to other environments."
      end

      nil
    end