Merge pull request #2853 from hlindberg/PUP-2885_dueling-timeouts

(PUP-2885) Remove timeout around entire plugin sync operation
(maint) Remove duplicate rest-client entry and add explantory comment
Merge branch 'master' into puppet-4
(PUP-2626) Allow module paths in file()

This modifies the file() function to accept module paths (like the
template() function) as well as fully qualified paths.

This makes it possible for modules that use the file() function
to be more portable, instead of being tied to a specific puppet
server configuration.

Example

with directory structure:

  /etc/puppet/modules/example
  ├── files
  │   └──file.ext
  ├── manifests
  │   └──init.pp
  └── templates
      └──template.erb

When the module path for files can be used instead of the absolute
path:

  file('example/file.ext') returns the same as
  file('/etc/puppet/modules/example/files/file.ext').

This is supposed to be like how template does module paths, where:

  template('example/template.erb') returns the same as
  template('/etc/puppet/modules/example/templates/template.erb')
(PUP-2626) Collapse file finding functions

The file finding function was split up in the same pattern as the
template finding function. This isn't really needed since the logic is
much simpler.
(maint) Update template to follow file methods

The template finding and file finding logic is very similar.
(maint) Clarify and correct method docs.

The method docs were a little bit wrong about what kinds of values will
be returned when. This tries to clean that up a bit and explain how the
methods work.
(PUP-2626) Update file() docs for new selector system

The docs for file() didn't use to say much about how it operated. This
updates the docs so that it makes clear what contents it will return and
how the given filenames are interpreted.
(PUP-2881) Move COM FFI to file windows/com.rb

 - This is the start of a new era, FFI / COM integration.  Run, hide!
 - Start by sliding over FFI function definitions for Win32 COM APIs
   and HRESULT macros.
 - Use a better ComInitialize function that will properly call
   CoUninitialize on application exit.
(PUP-2881) Add Windows COM code from Unknownr

 - Unknownr project at https://github.com/rpeev/Unknownr defines FFI
   bindings around COM interfaces / classes
 - Unknownr is MIT licensed, and only relevant bits have been brought
   into project
 - FFI based wrappers for COM interfaces in the form of 3 new modules
   Interface - for defining COM interfaces by GUID / FFI types
   Factory - for creating a COM object instance by CLSID GUID and
     returning a specified interface type
   Instance - for use when calling QueryInterface on an existing COM
     object to return a class of another type
 - FFI definition for GUID
 - NOTE: Had to add an FFI layout to the Factory class.  The original
   Unknownr code was using a different, older FFI version where this
   might have worked.  In newer code, inheriting from the Interface
   is not enough to pick up the layout in the FFI::Struct that is the
   Interface.
(PUP-2881) Use Windows::Error for COM call fails

 - Update error message / class type to be more consistent with other
   Puppet code
(PUP-2881) Fix Unknownr UseInstance helper

 - Existing code passes an additional unecessary GUID in the call to
   the COM function.
 - Add extra safety check to ensure FFI pointer is not pointing to a
   NULL block of memory
(PUP-2881) Refactor ITaskScheduler for FFI / COM

 - Using the magical COM binding / meta-programming techniques of
   Unknownr, define the ITaskScheduler COM interface as a special
   FFI::Struct derived type.  It uses our local mapping to make calls
   directly to the relevant methods on the interface pointer.
 - Greatly simplify the creation of the ITaskScheduler COM object
 - Properly allocate / cleanup memory with FFI pointer block form
 - No need to manually check HRESULT failure, as the COM wrappers
   will automatically throw exceptions when FAILED HRESULTs encountered
 - Define CLSID_CTask and IID_ITask in terms of the new GUID type
   instead of antiquated Ruby packing techniques
 - Change new_work_item to return the current task (otherwise, it would
   return an invalid FFI::Pointer)
 - With no more calls to CoCreateInstance, mark it as a private member
   of Puppet::Util::Windows::COM
(PUP-2881) Refactor IEnumWorkItems for FFI / COM

 - Create IEnumWorkItems interface definition, and rewrite code
   using this interface to safely clean-up memory and call Release on
   the COM interface pointer
 - Rework task name string reading to use FFI pointers safely that
   are the correct width on all platforms
 - Add new FFI::Pointer helper read_com_memory_pointer that will
   automatically call CoTaskMemFree on the pointer
 - To implement this helper, CoTaskMemFree has been copied into the
   api_types code
 - Add new alias to read_win32_long from an FFI::Pointer
(PUP-2881) Setup Taskscheduler HRESULT constants
(maint) Remove pointless test

Testing that the function exists isn't really needed since the later
tests that actually use the function will find that fairly quickly.
Merge branch 'pr/2678'

* pr/2678:
  (maint) Remove pointless test
  (PUP-2626) Update file() docs for new selector system
  (maint) Clarify and correct method docs.
  (maint) Update template to follow file methods
  (PUP-2626) Collapse file finding functions
  (PUP-2626) Allow module paths in file()

Closes #2678
(PUP-2918) Clarify missing Modulefile error

Prior to this commit, when building a module without a Modulefile or metadata.json,
the builder would blow up with a cryptic 'Unable to find module root at DIRECTORY'
It's not entirely clear what that means to an end user.
This commit clarifies that metadata.json or a Modulefile are what need to be found
at the module root. Also removes some duplicated logic for checking module root.
(doc) update acceptance_tests.md

Adding updated information and more help around getting setup properly to run
beaker locally.
Merge pull request #2865 from ferventcoder/maint/master/docs-acceptance

(doc) update acceptance_tests.md