(#7788) Extend Puppet using rubygems

The autoloader includes rubygems in the search path when searching for
modules to load. Puppet can now load things like Faces, report
processors, and parser functions using rubygems.

Example:

    $ gem install puppetlabs-cloud_provisioner-1.0.4.gem
    ...
    Successfully installed fog-1.3.1
    Successfully installed guid-0.1.1
    Successfully installed puppetlabs-cloud_provisioner-1.0.4

    $ puppet help
    Usage: puppet <subcommand> [options] <action> [options]

    Available subcommands:
    ...
    node_aws          View and manage Amazon AWS EC2 nodes.

This patch adds a new `Puppet::Util::RubyGems#directories` method for
locating the latest gems and their load paths. This method is used in
two places:

 * When searching for subcommands
 * When auto loading plug-ins

Updated specs are included.
(#7788) Rely on Rubygems caching of directories

Previously the list of rubygem directories was kept in a thread local
cache. Instead of doing that outright we'll try relying on the rubygem
caching before we go down the path of trying to do that ourselves.
Merge branch 'ticket/3.x/7788-rubygems' into 3.x

* ticket/3.x/7788-rubygems:
  (#7788) Rely on Rubygems caching of directories
  (#7788) Extend Puppet using rubygems
Merge remote-tracking branch 'upstream/3.x'

* upstream/3.x:
  (#7788) Rely on Rubygems caching of directories
  (#7788) Extend Puppet using rubygems
(Maint) : fix the jenkins failure for setconfig

Previously, the spec tests were failing because the exit status and output was not stubbed properly.
This commit ensures that the values are stubbed properly.
Merge pull request #1064 from vrthra/ticket/3.x/8200_fix_jenkins_break

(Maint) : fix the jenkins failure for setconfig
(#7986) make solaris pkg versionable.

Changes:
  * Add :versionable and :upgradable to features
  ** Ensurable now returns version rather than present/absent
  * Enable :defaultfor solaris 5.11
  * Change update to use pkg update, and ensure that we ignore return 4
  * Update the test cases to reflect these.
(#7986) check if pkg is the default provider for opensolaris

Modified pkg_spec test case to verify that pkg is the default provider for opensolaris
Merge branch 'ticket/3.x/11004_pkg_provider' of git://github.com/vrthra/puppet into 3.x

* 'ticket/3.x/11004_pkg_provider' of git://github.com/vrthra/puppet:
  (#7986) check if pkg is the default provider for opensolaris
  (#7986) make solaris pkg versionable.
(#7788) Cache paths from older rubygem versions

Older rubygems seem to have a problem where they begin looking for files
in the wrong locations after a few calls. This showed up in the spec
tests as several failures in different failures, but with the following
one as the most directly showing the problem:

  1) Puppet::Util::Autoload when reloading files changes should be seen by changed? on the instance using the short name
     Failure/Error: @autoload.load("myfile")
     Errno::ENOENT:
       No such file or directory - /home/hudson/.rvm/gems/ruby-1.8.7-p334@noFeatures/specifications/rake-0.8.7.gemspec
     # /home/hudson/.rvm/rubies/ruby-1.8.7-p334/lib/ruby/site_ruby/1.8/rubygems.rb:490:in `read'
     # /home/hudson/.rvm/rubies/ruby-1.8.7-p334/lib/ruby/site_ruby/1.8/rubygems.rb:490:in `each_load_path'
     # /home/hudson/.rvm/rubies/ruby-1.8.7-p334/lib/ruby/site_ruby/1.8/rubygems.rb:486:in `each'
     # /home/hudson/.rvm/rubies/ruby-1.8.7-p334/lib/ruby/site_ruby/1.8/rubygems.rb:486:in `each_load_path'
     # /home/hudson/.rvm/rubies/ruby-1.8.7-p334/lib/ruby/site_ruby/1.8/rubygems.rb:640:in `latest_load_paths'
     # /home/hudson/.rvm/rubies/ruby-1.8.7-p334/lib/ruby/site_ruby/1.8/rubygems.rb:639:in `each'
     # /home/hudson/.rvm/rubies/ruby-1.8.7-p334/lib/ruby/site_ruby/1.8/rubygems.rb:639:in `latest_load_paths'
     # ./lib/puppet/util/rubygems.rb:45:in `directories'
     # ./lib/puppet/util/autoload.rb:169:in `gem_directories'
     # ./lib/puppet/util/autoload.rb:173:in `search_directories'
     # ./lib/puppet/util/autoload.rb:96:in `get_file'
     # ./lib/puppet/util/autoload.rb:64:in `load_file'
     # ./lib/puppet/util/autoload.rb:208:in `load'
     # ./spec/unit/util/autoload_spec.rb:190
     # /home/hudson/.rvm/gems/ruby-1.8.7-p334@noFeatures/gems/rspec-core-2.9.0/lib/rspec/core/example.rb:80:in `instance_eval'
     # /home/hudson/.rvm/gems/ruby-1.8.7-p334@noFeatures/gems/rspec-core-2.9.0/lib/rspec/core/example.rb:80:in `run'
     # /home/hudson/.rvm/gems/ruby-1.8.7-p334@noFeatures/gems/rspec-core-2.9.0/lib/rspec/core/example.rb:173:in `with_around_hooks'
     # /home/hudson/.rvm/gems/ruby-1.8.7-p334@noFeatures/gems/rspec-core-2.9.0/lib/rspec/core/example.rb:77:in `run'
     # /home/hudson/.rvm/gems/ruby-1.8.7-p334@noFeatures/gems/rspec-core-2.9.0/lib/rspec/core/example_group.rb:355:in `run_examples'
     # /home/hudson/.rvm/gems/ruby-1.8.7-p334@noFeatures/gems/rspec-core-2.9.0/lib/rspec/core/example_group.rb:351:in `map'
     # /home/hudson/.rvm/gems/ruby-1.8.7-p334@noFeatures/gems/rspec-core-2.9.0/lib/rspec/core/example_group.rb:351:in `run_examples'
     # /home/hudson/.rvm/gems/ruby-1.8.7-p334@noFeatures/gems/rspec-core-2.9.0/lib/rspec/core/example_group.rb:337:in `run'
     # /home/hudson/.rvm/gems/ruby-1.8.7-p334@noFeatures/gems/rspec-core-2.9.0/lib/rspec/core/example_group.rb:338:in `run'
     # /home/hudson/.rvm/gems/ruby-1.8.7-p334@noFeatures/gems/rspec-core-2.9.0/lib/rspec/core/example_group.rb:338:in `map'
     # /home/hudson/.rvm/gems/ruby-1.8.7-p334@noFeatures/gems/rspec-core-2.9.0/lib/rspec/core/example_group.rb:338:in `run'
     # /home/hudson/.rvm/gems/ruby-1.8.7-p334@noFeatures/gems/rspec-core-2.9.0/lib/rspec/core/command_line.rb:28:in `run'
     # /home/hudson/.rvm/gems/ruby-1.8.7-p334@noFeatures/gems/rspec-core-2.9.0/lib/rspec/core/command_line.rb:28:in `map'
     # /home/hudson/.rvm/gems/ruby-1.8.7-p334@noFeatures/gems/rspec-core-2.9.0/lib/rspec/core/command_line.rb:28:in `run'
     # /home/hudson/.rvm/gems/ruby-1.8.7-p334@noFeatures/gems/rspec-core-2.9.0/lib/rspec/core/reporter.rb:34:in `report'
     # /home/hudson/.rvm/gems/ruby-1.8.7-p334@noFeatures/gems/rspec-core-2.9.0/lib/rspec/core/command_line.rb:25:in `run'
     # /home/hudson/.rvm/gems/ruby-1.8.7-p334@noFeatures/gems/rspec-core-2.9.0/lib/rspec/core/runner.rb:69:in `run'
     # /home/hudson/.rvm/gems/ruby-1.8.7-p334@noFeatures/gems/rspec-core-2.9.0/lib/rspec/core/runner.rb:10:in `autorun'
     # /home/hudson/.rvm/gems/ruby-1.8.7-p334@noFeatures/bin/rspec:19

This commit caches the first call to get the paths for older rubygems.
Merge remote-tracking branch 'upstream/3.x'

* upstream/3.x:
  (#7788) Cache paths from older rubygem versions
  (#7986) check if pkg is the default provider for opensolaris
  (#7986) make solaris pkg versionable.
  (Maint) : fix the jenkins failure for setconfig
(Maint) Tighten up assertion to find the cause of a flicker

The test for the message emitted for calling an incorrect action on a
face sometimes fails because it sees "Could not run Puppet configuration
client: Not a directory - /dev/null/state/agent.pid" instead. This
changes the way the assertion is done so that the test failure will
provide more information about what else is in the log at the time of
the failure, which might help in tracking down what is going wrong.
(Maint) Remove dependency on Facter 2.0

Previously a hard dependency had been made on Facter 2.0. As the release
has neared it turns out that Facter 2.0 is not ready for a release and
Puppet really does not need any functionality that is present in that
version of Facter. This removes this dependency, which allows Puppet to
use the existing Facter 1.6.x series and thereby decouples the release
of the two systems.
Merge pull request #1068 from zaphod42/maint/3.x/puppet-3-can-use-facter-1.6

(Maint) Remove dependency on Facter 2.0
Merge remote-tracking branch 'upstream/3.x'

* upstream/3.x:
  (Maint) Remove dependency on Facter 2.0
(#14822) Re-evaluate features if they previously were false

Allow features to be re-evaluated each time they are checked, if they
previously evaluated to false.  This allows for providers by features to have
dependencies installed during a run and then for the feature state to change
from false to true.

Caching of feature results that were previously true has been kept.  Caching of
blocks used to evaluate features remains unaffected and are still run only once.
(#14822) Use feature confine for feature tests during run

Fixes two providers to use the "confine :feature" statement, allowing for the
features to be re-evaluated during a run instead of only once.
(Maint) Update version of puppet listed in gemspec

This also updates the required facter version to reflect what v3.0.0
needs
(#15966) Update packaging files for 3.0.0rc4

This bumps the version built to 3.0.0-0.1rc4 per convention.
The RH and suse spec files' facter version dependencies are also updated.
(#15966) Update README.me for correct facter version dependency

We're not requiring facter 2, just a reasonably-recent 1.6.