(#18986) Write to the console using Unicode Win32 APIs

Previously, puppet on windows could not output unicode characters to the
console reliably, such as the box drawing characters used by the module
tool when displaying dependencies.

Ruby 1.8 uses the ANSI Win32 APIs, e.g. WriteConsole, to write to the
console. However, it uses the current console codepage. So if the current
codepage cannot handle the unicode character we're trying to write, e.g.
cp1252, then it displays garbage.

Ruby 1.9 uses the Unicode Win32 APIs, e.g. WriteConsoleW. As such, it can
correctly write unicode output, without being sensitive to the current
codepage.

However, because puppet writes ANSI escape sequences, we use the
win32console gem to color the output. This win32console gem redefines the
stdout and stderr streams to accomplish this, and sadly uses ANSI versions
of Win32 APIs to write to the console. So it has the same problems as ruby
1.8.

This commit overrides the win32console classes, Console and IO, to ensure
the Unicode APIs are used. This enables us to display ANSI escape
sequences and unicode characters that may not be compatible with the
current codepage.

Longer term we should think about removing win32console gem altogether and
moving to ruby 1.9, as these hacks would no longer be required. Though
doing so would mean losing color output, or taking more drastic measures
like ansicon.
Send the :links option to the file server

Previously, the server was never asked to follow links when 'links =>
follow' was used, so the server always provided the metadata for the
link itself. With this patch, the server correctly follows the link
server-side and the client can apply the catalog correctly.
(#7680) Update tests for changed behaviour after bugfix

A number of tests were broken before the bugfix:
* incorrectly checking the file mode (missing .should)
* operating on a non-existent source symlink

Enabled all of the #10315 tests which now pass, some of which needed
editing due to the expected behaviour now being different for
links => follow.
Update Puppet::FileServing::Metadata tests

Provide a stub for resource[:links] => :manage
Expect :find to be called with :links => :manage
(#7680) Add acceptance test for file links => follow
(#7680) Fixup Puppet::Resource::Catalog::StaticCompiler tests
Merge remote-tracking branch 'pr/1532' into 2.7.x
Merge branch '2.7.x' into 3.1.x

Conflicts:
	lib/puppet/type/file/source.rb
	spec/unit/indirector/catalog/static_compiler_spec.rb
	spec/unit/type/file/source_spec.rb
(#15791) isolate deterministic random function

We should not fiddle with the global seed, as other people
might still depend on Kernel.rand() not being that deterministic
as it is the idea with the fqdn_rand function.

However, as ruby < 1.9.2 does not provide such a nice solution, as
a dedicated Random class we simply call Kernel.srand() again on ruby
< 1.9.2 -> Reinitialize with a less deterministic seed.
(maint) Add vendoring support to puppet

This adds vendoring support to puppet based on the implementation in
mcollective.
(#11331) Add vendoring of rgen to puppet.

This adds the RGen gem 0.6.1 in transition to not yet released
RGen gem 0.6.2.
(maint) Exclude crontab integration specs on windows

Since windows doesn't have a functional crontab provider, it doesn't
make sense to run integration tests for cron on windows.
Improve CVE 2013 1654 SSLv2 Downgrade Master test

Previously we were only checking for the applicability of the master
(since we're testing the master), but we run the check from an agent.
This ensures the agent we run the check from has the necessary openssl
client for the test.

Signed-off-by: Justin Stoller <justin@puppetlabs.com>
(Maint) Make a CRL valid on the same second it is updated

Backport commit 15a9fb76096e1d0d3642ae2ebcfa72ea9abc367f which
eliminates time-sensitive spec failures due to the CRL not being yet
valid.

Because openSSL says that a CRL is valid only at least one second after
it was last updated, setting the last_updated field to right now causes
the CRL to be not valid for one second. This was showing up as an
intermittent failure in our test cases.

The CRL is now always made to be last_updated one second ago so that it
is immediately valid.
(#17190) Re-introduce environment for catalog compile

Commit f64e0a94c60506eec44645b07c36ff996ee2b5cd accidentally removed the
pass-through of `*args`, which removed the passing of `:environment` to
the Puppet::Node indirection. This adds a test that would have failed
and restructures the code so that the mistake would have been more
obvious.
Merge branch '2.7.x' into 3.1.x

* 2.7.x:
  (Maint) Make a CRL valid on the same second it is updated

Conflicts:
	lib/puppet/ssl/certificate_revocation_list.rb
Merge branch '3.1.x'

* 3.1.x:
  (Maint) Make a CRL valid on the same second it is updated
  (#7680) Fixup Puppet::Resource::Catalog::StaticCompiler tests
  (#7680) Add acceptance test for file links => follow
  Update Puppet::FileServing::Metadata tests
  (#7680) Update tests for changed behaviour after bugfix
  Send the :links option to the file server

Conflicts:
	lib/puppet/type/file/source.rb
	spec/unit/type/file/source_spec.rb
Merge pull request #1549 from zaphod42/maint/fix-enc-environment-regression

(#17190) Re-introduce environment for catalog compile
(maint) Refactor crontab filetype selection

The previous implementation of the crontab implementation type
determined the filetype to use at load time by calling out to Facter
before the type was loaded, which was both ugly and made it difficult to
test on alternate platforms. This commit overrides the `.filetype`
method to do the detection at runtime so the provider encapsulates all
its logic and the filetype can be stubbed out.
Merge branch 'maint-refactor_cron_filetype_selection'