(PUP-1619) Add support for Struct in Type Parser
(PUP-1619) Add tests and fix issues in type parser

The type Optional had no tests in type parser. Tests also
added for the new types Tuple and Struct.

Also fix issues with Optional type handling in type calculator and type
factory.
(maint) Fix regexp with unescaped { causing warning when running tests
(PUP-1619) Fix problems with Ruby 1.8.7 Range min/max & Infinity

Billions of blue blistering boiled and barbecued barnacles, the
Ruby 1.8.7 implementation of Range min/max is based on Enumeration.
This does not work well when the range has +/- Infinity at one of
the ends. There is probably a "break" when it reaches Infinity...

*sign*

This commit changes the implementation from using a Range to using
an Array instead of a Range.
Merge pull request #2345 from hlindberg/pup-1619_add-struct-tuple

(PUP-1619) add struct and tuple types to type system
(PUP-649) Use class instance variable

Accessing a class variable from the class produces a warning on ruby
1.9.3. We can instead just use the instance variable, which is also on
the class, but is safer to use.
(PUP-649) Loosen checks for crontab provider

The tests for the crontab provider exhibited an order dependent failure.
If the spec/integration/provider/cron tests were run before the
spec/unit/provider/cron tests then the global counter that is used by
the crontab provider would not be at the expected value. This isn't
really a problem in practice, but the expectations in the tests were for
a specific count. This updates the checks so that they are resilient to
the exact numbers chosen.
Merge branch 'pr/2024'

* pr/2024:
  (PUP-649) Loosen checks for crontab provider
  (PUP-649) Use class instance variable
  (#3220) uniquify implicit record names
  (#3220) save overhead in cron type unit test and add cleanup
  (#3220) make the unit test "generating cron resources" match the new behaviour
  (#3220) fix a cron testing quirk with potential benefits for normale operation
  (#3220) make sure that generated cron resources belong to the correct user
  (#3220) crontab: allow purging unmanaged resources

Closes GH-2024
(PUP-1327) add the file attributes owner, group and mode to nagios types

It's desirable to make it possible to write manifests such as

nagios_host { "hostname":
  ... # nagios properties
  group => "nagios",
  mode  => 640,
}

instead of the workaround of

nagios_host { "hostname":
  target => "/etc/nagios/hostname.cfg",
  ...
}
file { "/etc/nagios/hostname.cfg": ... }

To make this possible in a simple fashion, just add the file properties
owner, group and mode to each nagios type as parameters. If either of them
is specified, the nagios resource generates an additional file resource
and passes the parameters as should-values of the respective properties.
(PUP-1327) simple unit test for the new nagios parameters

For now, only test for the presence of the parameters. Their function should
be tested in an integration spec.
(PUP-1327) integration spec for the nagios type

This is a very rough draft for a spec test wrt. the "mode" parameter.
Testing group and owner is difficult since unprivileged rspec users
cannot use chown or chgrp.

This is open for discussion and should be revised before merging.
Merge branch 'pr/2060'

* pr/2060:
  (PUP-1327) integration spec for the nagios type
  (PUP-1327) simple unit test for the new nagios parameters
  (PUP-1327) add the file attributes owner, group and mode to nagios types

Closes GH-2060
(maint) Switch from an .each to a .last so we don't repeat ourselves.
(PUP-1670) Add validate_cmd parameter to file type

If this parameter is set, then this file will only be written if
the command specified returns 0.

Also adds a validate_replacement parameter to allow specifying some
other string to use for specifying temporary file name instead of the
default of '%'.
(PUP-713) cron: forbid the mixing of special and numeric schedules

The BSD special schedules such as @reboot or @midnight and regular schedules
comprising one or more time fields such as minute or hour are mutually
exclusive. Until now it was valid to specify a special schedule alongside
numeric fields, though.

Add validation logic to the crontype to ensure that a cron resource does not
try to manage these incompatible fields together. It is acceptable to
declare should-values for the respective properties, but only with the
following limitation:

If the 'special' property is declard but not :absent,
any declared numeric schedule field must be :absent.

Raise an ArgumentError type exception that includes a concrete reference
to the special property as well as the title of the offensive numeric
schedule property.
Merge pull request #2328 from dalen/msgpack_store

Add Msgpack terminii
(PUP-713) Add tests for the special property of the cron type
Merge branch 'issue/master/pup-713-disambiguate-cron-schedules'

* issue/master/pup-713-disambiguate-cron-schedules:
  (PUP-713) Add tests for the special property of the cron type
  (PUP-713) cron: forbid the mixing of special and numeric schedules
(PUP-1451) (PUP-1120) Merge branch 'relaxed_permissions'
(PUP-1588) Constrain new msgpack specs to only run with msgpack lib

When msgpack lib is not present (extra group gems not installed), they
will be ignored.