Fix feature detection error undefined method pointer on nil:NilClass.
Ignore splay time on SIGUSR1

If the agent is configured to use splay, receiving a SIGUSR1 while
beeing in the splay loop will cause the agent to wait and instantly
run as documented.

The agent now skips the splay sleep when the signal is received.
Merge branch 'b1-systems-fix_signal_handler'

* b1-systems-fix_signal_handler:
  Ignore splay time on SIGUSR1

closes #1453
(#7165) Properties can invalidate scheduled refreshes on change

An invalidate_refreshes option can now be specified on newvalue calls inside
type definitions.  When a property is changed to a value with this option set,
it causes all currently scheduled refreshes (from notify or subscribe) to be
discarded after evaluation of the resource.

This is designed for instances where a file resource is changed and refreshes
a service resource.  The service itself would then be evaluated, the service is
started and then it would be refreshed, causing an additional restart.  This
change allows a type definition to specify that a property change to a
particular value invalidates certain needless refreshes.
(#7165) Invalidate refreshes after services are started

After a service is started (ensure transitions to :running), discard all
scheduled refreshes which would otherwise cause a restart immediately after it
had started.

This enables the pattern of a file notifying a stopped service resource, which
simply deploys the file, starts the service and leaves it running.
Merge branch 'domcleal-tickets/master/7165-invalidate-refreshes'

* domcleal-tickets/master/7165-invalidate-refreshes:
  (#7165) Invalidate refreshes after services are started
  (#7165) Properties can invalidate scheduled refreshes on change

closes #1459
(#19167) Fix skipped tests due to Tempfile.new block not being run

Tests for extlookup() key lookups were passing a block into Tempfile.new,
which it doesn't run.  The initialization of the CSV file was performed and
then extlookup() was called inside the block.  Since it isn't run, the tests
aren't executed.

This moves the tests out of the block and changes how the CSV file is created,
since the extlookup() function doesn't take an absolute path to a CSV file.
Instead a temporary directory is now created and the CSV file created inside.

An incorrect test that should have checked for a raised error has also been
fixed.
Merge branch 'domcleal-tickets/master/19167-extlookup-spec'

* domcleal-tickets/master/19167-extlookup-spec:
  (#19167) Fix skipped tests due to Tempfile.new block not being run

closes #1469
(#18494) Change version comparisons to support Ruby 2.0

Ruby version comparisons should treat Ruby 1.8 as the exception and Ruby 1.9
onwards as the norm.
(#18494) Fix Ruby version number format for Ruby 2.0.0-p-1

The additional hyphen between "p" and the patch number is now handled.
(#18494) Fix error message test for Ruby 2.0
(#18494) Remove TypeError handling code used for tests

For Ruby 1.9, commit 252c884 added code in the Puppet::Transaction::Event
class to handle strings rather than a resource object that responded to []
with symbols, for the purposes of testing.

In Ruby 2.0, the TypeError message changed a bit, so the rescue didn't work as
expected.  This is now reworked so the test passes in an object that responds
appropriately.
(#18494) Force literal strings in test to ASCII-8BIT encoding

The CA and directory service tests compare literal strings in the tests
against ASCII-8BIT data from the app.  The default file encoding changed to
UTF-8 in Ruby 2.0.0-rc2, so force file encoding to ASCII-8BIT to match the
app's expected output.
(#18494) Make ActiveRecord-based inventory service unsupported under Ruby 2

ActiveRecord 3.0 under Ruby 2.0 has spec failures both here and upstream, and
isn't supported anyhow.  Disable the ActiveRecord-based inventory service when
running under Ruby 2.

  2) Puppet::Node::Facts::InventoryActiveRecord#save should retry on ActiveRecord error
     Failure/Error: Puppet::Node::Facts.indirection.save(facts)
     NoMethodError:
       undefined method `insert_record' for #<Array:0x0000001950d3b8>
     # ./lib/puppet/indirector/facts/inventory_active_record.rb:40:in `block (2 levels) in save'
     # ./lib/puppet/indirector/facts/inventory_active_record.rb:32:in `block in save'
     # ./lib/puppet/util/retryaction.rb:21:in `retry_action'
     # ./lib/puppet/indirector/facts/inventory_active_record.rb:27:in `save'
     # ./lib/puppet/indirector/indirection.rb:266:in `save'
     # ./lib/puppet/node/facts.rb:20:in `save'
     # ./spec/unit/indirector/facts/inventory_active_record_spec.rb:43:in `block (3 levels) in <top (required)>'
(#18494) Enable Travis building on Ruby 2.0.0
(#18494) Rearrange loop to remove Ruby 2.0 warning

Ruby 2.0 warned of the complex assignments in the while loop:

  lib/puppet/file_serving/fileset.rb:139: warning: found = in conditional, should be ==

The block that shifts to the next recursion level has been removed from the
loop expression to prevent the interpreter from warning.
Merge branch 'domcleal-tickets/master/18494-ruby-2.0'

* domcleal-tickets/master/18494-ruby-2.0:
  (#18494) Rearrange loop to remove Ruby 2.0 warning
  (#18494) Enable Travis building on Ruby 2.0.0
  (#18494) Make ActiveRecord-based inventory service unsupported under Ruby 2
  (#18494) Force literal strings in test to ASCII-8BIT encoding
  (#18494) Remove TypeError handling code used for tests
  (#18494) Fix error message test for Ruby 2.0
  (#18494) Fix Ruby version number format for Ruby 2.0.0-p-1
  (#18494) Change version comparisons to support Ruby 2.0

closes #1470
(#18978) Assign HEREDOC to script variable

Previously, this test was failing trying to call a method named script
with the HEREDOC as an argument, and failing of course. Somehow I
managed to delete the equals sign between the time I last ran the test
and when I checked it in.
(#18978) Redo acceptance test

The previous test did not work when executed through the acceptance
framework due to quoting issues. I fixed it on *nix, but it fails on
Windows due to the RUBYLIB not being set correctly.

This commit just changes the test to ensure we can authenticate the
forge's SSL cert, which is the main motivation behind #18978 anyways.
But since the module tool is not yet supported (#11276), this test is
skipped on windows.
Merge pull request #1457 from gw0/fix-feature-detection-nil

Fix feature detection error undefined method pointer on nil:NilClass.