(#17183) Pass on parameters to recursive children in static_compiler

Pass on parameters from the top level resource to recursive children in
the static compiler.
The list of parameters to exclude is taken from the file type
implementation.
(maint) Don't try to invoke a constant as a method

While methods on constants can be invoked with the scope resolution
operator, EG `SemVer::valid?`, the reverse isn't true for retrieving
constants. This fixes the lookup of the SemVer::MIN constant.
(#21272) Refactor created directory from 'puppet module generate'

Currently the created directory is 'username-modulename'.
This patch changes this to 'modulename' because that's mostly used.
(#21376) Sequence BlockExpressions without nesting

When merging Puppet::Resource::Type instances the code attribute was merged in
a way that caused a deep tree of BlockExpressions. This could cause stack
overflows when evaluating this tree, since evaluation is recursive. This
changes the merge method so that they are sequenced as a flat array.
Merge pull request #1717 from pcarlisle/ticket/21376-stack-overflow

(#21376) Sequence BlockExpressions without nesting
Merge branch 'stable'

* stable:
  (#21376) Sequence BlockExpressions without nesting
(Maint) Run tests from installed packages

This creates the basic structure for running tests from packages. It
includes a Rakefile for fetching the appropriate artifacts and executing
systest, the setup steps for installing the repos and packages, and a
basic test that makes sure that puppet is installed.

  bundle install
  bundle exec rake test SHA=COMMITISH

where COMMITISH corresponds to the SHA of a package built via the
puppetlabs-packaging job.
Merge pull request #1720 from joshcooper/maint/master/testing-against-packages

(Maint) Run tests from installed packages
(#21320) Use sleep in the daemon loop instead of select

This fixes a bug on Ruby < 2.0 where the daemon might sleep for a very long
period after being interrupted with a signal. The implementation of select on
these ruby versions has an improper cast which resulted in a corrupted value
given to select on 64 bit systems. It is patched in Ruby 2.0 in
https://github.com/ruby/ruby/commit/b10c3136b0163536a679b10fecbc2992f3b5fa64 .

Sleep does not attempt to restart after being interrupted and does not have this bug.
(Maint) Cleanup specs

This cleans up the specs to make them a little more expressive of the
behavior of the fqdn_rand function's real functionality. One surprising
result that came out of this was that the tests tried to assert that the
fqdn_rand function was callable without any arguments. However the test
for this passed simply because it asserted that a particular error was
*not* raised, when in fact a different exception that expressed what it
was trying to catch (ArgumentError vs. Puppet::ParserError). The docs
indicate that calling with no arguments is not actually supported and so
that test has been removed.
(#21264) Update rgen dependency to 0.6.5

There is an error in rgen < 0.6.5 that causes it to incorrectly handle
Array#to_str via its monkey patching of Array#method_missing. This adds
a check for this incorrect behavior and updated our Gemfile dependency
on rgen. The package dependencies are already specified in a manner that
will pick up 0.6.5 once it is packaged.
Deprecate sending YAML over the network

I'm not sure if this covers all the corners. I didn't want to do it in the
Format itself because that can be used in other places.
(#21043) Use ruby.exe instead of rubyw.exe

Previously, if you set a custom runinterval setting in puppet.conf, puppet
running on ruby 1.9 would ignore it, whereas it would work in ruby 1.8.

The root cause is due to http://bugs.ruby-lang.org/issues/7239. In ruby 1.9,
rubyw.exe is unable to read the stdout of any child process using ruby's
built-in process methods, e.g. %x. This affects us, because the windows
service, running as rubyw.exe, executes:

    `%x{ puppet agent --configprint runinterval}`

to obtain the current runinterval setting.

The bug is fixed in ruby 2.0, so for now, we just switch to using
`ruby.exe` instead of `rubyw.exe`.
Merge pull request #1725 from joshcooper/ticket/stable/21043-runinterval-broken

(#21043) Use ruby.exe instead of rubyw.exe
(#21427) Send facts to master as pson

This changes the format of facts being sent to the master from
b64_zlib_yaml (base 64 encoded compressed yaml) to pson, in preparation
for deprecating all YAML sent over the network. This should be backwards
compatible as facts are tagged with the format and the master already
supports pson.
Merge pull request #1724 from zaphod42/issue/stable/21264-implicit-array-conversions-break-because-of-rgen

(#21264) Update rgen dependency to 0.6.5
Merge branch 'stable'

* stable:
  (#21043) Use ruby.exe instead of rubyw.exe
  (#21264) Update rgen dependency to 0.6.5
  (Maint) Cleanup specs
  (#21320) Use sleep in the daemon loop instead of select
(packaging) Use the packaging loader for tasks

The packaging repo now uses an explicit loader which handles loading the
various rake tasks in packaging. This commit updates the puppet Rakefile to use
the loader instead of a blind glob of the ext/packaging/tasks directory. We
move this load into the rescue LoadError block because the packaging repo won't
always be there, and define RAKE_ROOT and use it since its used in more than
one place in the Rakefile.

Signed-off-by: Moses Mendoza <moses@puppetlabs.com>
(#21427) Issue deprecation warning for b64_zlib_yaml
(#21427) Improve deprecation warning for yaml params

Previously we were not informed what parameter and value was being
transmitted as YAML, which made debugging and correcting the problem
nearly impossible. This outputs the offending request parameter and
value as a debug message to aid in fixing the issue.