(maint) Check for files by full name

Periodically this test would fail with a message about some path being a
directory. It turns out that what was happening was that that generated
name for the temp directory would end in "one" or "two". This caused the
test to detect the directory entry in the response from the search
request to be one of the files and so it would try to read the contents,
which wasn't possible because it was the directory.

This changes it to check for the files by the full path and use
"include_in_any_order" to pull together two tests into one.
(PUP-1799) Add new Function API
(maint) Change infer_set of Array to produce PTupleType

The infer_set was written before PTupleType was implemented and
used an ArrayType with a single PVariantType with the convention
that the PVariant described a sequence. This was a crutch and
not semantically correct. Only code that knew that the result came
from an infer_set could make this assumption about the PVariantType's
content.

The change is to instead use a PTupleType which correctly describes
a sequence of the types in an Array.
(maint) Add method size_range, and repeat_last_range to collections

(resolve conflict from cherry pick to stable and merge to master
back into the implementation work for PUP-1799)

For PCollectionType (PArrayType and PHashType) the method size_range
now returns a range [min, max] count of entries accepted in the
collection. A result is always given even if no size constraint has
been set.

For PTupleType, the method size_range gives the total accepted
parameter range, and the method repeat_last_range returns the range
of the last parameter. For a tuple, if the size is not constrained
the repeat_last_range is always [1,1]. For a tuple type, the
range of the last parameter is considered in the size_range.

These methods helps answering questions about these types without having
to know anything about their internal semantics.
(PUP-1799) First working version of new Function API (simple dispatch)

This adds the new function API with support for simple dispatching
and a reasonable error message, showing expected signature
and actual types.
(PUP-1799) Make Function handle dispatch directly instead of nested

This changes the API to allow direct calls to dispatch and then
nest parameter specification instead of having to nest all dispatch in
a define_dispatch call.

This also adds support for naming the parameters.
(PUP-1799) Add support for parameter names

This also contains some refactoring and documentation of methods
(PUP-1799) Make new Function API report parameter names.

This makes the function API include the names of parameters if
they are available. When names are available the signatures
show the names (for both array and tuple based signatures).

This also handles the changes made to the TupleType (size constraint
is for the entire type, not just the last entry).
(PUP-1799) Add support for multiple dispatch entries

This adds tests for multiple dispatch (overloaded signatures), and
fixes issues with error reporting for this scenario.
(PUP-1799) Add marking of optional and varargs count in error message

When an error is raised becuse of no matching signature, the 
expected signatures are printed with each parameter on the form:

Type name<count>

where count is ? for an optional {0,1} parameter, and with a range
{from, to} if from and to are not both 1 (in which case count is an 
empty string), and only a comma is shown if to is INFINITY. 

e.g. a message may show:

  foo(Integer a, String b?, String{0,}) - arg count {1,}

The trailing arg count shows required min, and allowed max as a short
hand notation.
(PUP-1799) Change default inferred param type to Object (no undef)

This changes the default inferred parameter type to Object from
Optional[Object], since this is by far more common than accepting
that values are undef. (If undef values should be expected that is
stated explicitly.
(PUP-1799) Modify how required/optional/varargs count is specified

This changes the somewhat complex setting of argument count.
If nothing is specified it is derived from the specified parameters.
If something else than exact count is wanted, the arg_count method
is called with min, max where :default is used to denote infinite.
(PUP-1799) Add support for injection of Function class attributes

This adds support to inject attributes (via defined lazy accessors
that performs the lookup). The methods attr_injected, and
attr_injecteted_producer defines the injection of a value, and of a
producer. The function logic can access these via method calls.
(PUP-1799) Add support for injection of parameters and weaving

This adds injection of parameters and weaving of them when
dispatching. The dispatching logic is also somewhat refactored
from using anonymous arrays to a Dispatch object.

The methods injected_param, injected_producer_param specifies
that additional parameters should be injected when a call is made.
Their position defines where they are injected and the ruby method
signature should be matched to handle them.

The injection of parameters works for both regular and polymorphic
dispatch.

This makes use of injection more declarative, and it is easy to
test a Function class' methods.
(PUP-1799) Yardoc and dead code removal in Function API
(maint) Fix package acceptance test failure caused by gem provider changes.

The gem provider recently had the install_options feature implemented.
The provider was appending a nil value to the command arguments if there
are no install_options specified. This gets converted to an empty string
before the Kernel.exec call and causes gem to treat the empty string
as a gem name. The result is a failure when trying to install gems in
the acceptance test.

The fix is to append install_options only if specified on the resource.
(maint) Update gem provider spec for recent change.

The spec had an example which was expecting a nil
install_options by checking the 6th element in an array.
With the change to not append the install_options
unless specified, the example was passing but the
functionality no longer matched the example.

Changing the example to ensure 5 elements were
passed to execute instead of the previous 6.
(packaging) Update PUPPETVERSION to 3.5.0-rc2
Merge tag '3.5.0-rc2' into stable

3.5.0-rc2
Merge branch 'stable'