(#9439) fix parsing and deleting existing rules

Previously we hadn't been able to parse existing rules that were missing
a comment field. This patch fixes that by using an MD5 hash of the iptables
raw line as the name of the property.

We have also cleaned up the way we delete arguments by adding a new
delete_args function to return valid delete_args. Instead of having to work
out the rule order we now just delete the rule based on the specification.
Merge branch 'ticket/9439-existing_rules'

* ticket/9439-existing_rules:
  (#9439) fix parsing and deleting existing rules

Reviewed-by: Ken Barber <ken@bob.sh>
(#10026) Add aliases for test,specs,tests to Rakefile and provide -T as default.

I've cleaned up the Rakefile a bit so that the aliases:

* test
* specs
* tests

Now point to "spec". The (s) versions are used by rvm but generally these are
all provided for convenience in case someone uses the wrong form.

I've also changed the default rake task to show the list of tasks (rake -T).

The description for rake spec is also a bit longer.
(#10026) Re-arrange provider and type spec files to align with Puppet.

If moved the spec files now under 'puppet' to align with how Puppet does it. This
also makes more sense as this lines up with the module/class names now.

The iptables_type_spec.rb is now just firewall_type.rb to designate it is for
the generic firewall type.

iptables_prov_spec.rb is now iptables_spec.rb. The provider part is implicit
in the path.
Merge pull request #14 from kbarber/ticket/10026-type_rspec_rake_cleanup

Ticket/10026 type rspec rake cleanup
(#10088) Provide a customised version of CONTRIBUTING.md

The goal here is to provide some clear documentation to point contributors
at when they want to submit code. This document is a copy of the facter one,
slight modified for puppetlabs-firewall.
Merge pull request #16 from kbarber/ticket/10088-contributing

(#10088) Provide a customised version of CONTRIBUTING.md
(#9362) Create action property and perform transformation for accept, drop, reject value for iptables jump parameter.

This commit introduces the new 'action' parameter which is designed to designate
the action to take when a match succeeds. This is a cross-platform parameter and
for the values 'accept','drop','reject' it will take the place of the existing
jump parameter.

The jump parameter is deemed as an iptables specific parameter so by splitting
out this parameter for common actions it allows us to extend the firewall
resource to include other providers much more easily in the future. By having
such a common parameter we will be able to compare resources between boxes that
may have different firewall implementations.

The new behaviour is to force the usage for action parameter, and using
'accept', 'drop' or 'reject' for jump will now no longer work.

Also - the default of 'accept' for jump has been removed which means you MUST
specify an action if you want your rule to do something. Without an action the
rule will match, but do nothing (so only useful for keeping counters generally).

To aid in the testing of this new property I've added new ways to test converting
iptables rules to hashes and hashes to general_args. This should simplify the
testing of new bugs as well.
Merge pull request #15 from kbarber/ticket/9362-action_property

(#9362) Create action property and perform transformation for accept, dro
(#10163) Cleanup some of the inline documentation and README file to align with general forge usage.

* The README.markdown file had a lot of property information that was
  duplicated in the type itself. The README.markdown file has more info in
  some cases, I have moved this into the type.
* The README.markdown lacked documentation on how to install the module using
  the forge which meant users accessing it via github would be inclined to
  download the development version from github instead.
* Cleaned up doc string alignments and made it consistent with all types.
Merge pull request #17 from kbarber/ticket/10163-doc_cleanup

(#10163) Cleanup some of the inline documentation and README file to alig
(#10263) Fix tests on Puppet 2.6.x

Due to the lack of Puppet::Test::LogCollector class, tests fail on puppet
2.6.x. Instead of just using the class, I'm testing its existance first
and only using it if it exists. Otherwise, I'm going to fall back to 2.6.x
methodology.

This seems to make tests work on 2.6.7 (and up) and 2.7.1 (and up) which is
sufficient for now.
Merge pull request #20 from kbarber/ticket/10263-tests_fail_on_puppet-2.6.x

(#10263) Fix tests on Puppet 2.6.x
(#10002) Change to dport and sport to handle ranges, and fix handling of name to port.

We hadn't been allowing ranges of the kind 22:1000 for ranges. This patch
fixes that. Thanks to Jason Hancock for finding this issue and providing a sample
patch.

Instead of using colon though, it was decided we would use a hyphen to specify a range
as its more agnostic. This patch does the filtering for both writing the rule and
reading the rule.

Also - the way we were doing name to port conversion had been broken. I found
this out while fixing the ranges, and have now fixed it and added tests.
Merge pull request #21 from kbarber/ticket/10002-range_of_ports

(#10002) Change to dport and sport to handle ranges, and fix handling of 
(#10295) Work around bug #4248 whereby the puppet/util paths are not being loaded correctly on the puppetmaster

This patch suggested by Dan Carley will work-around the puppet/util error
specified in bug #4248 by loading relative paths instead.

This also fixes the load errors related to running the resource in a standalone
puppet case as well.

If the load fails for some reason, we fall back to the normal load behaviour.
This order is important as we want to load libraries before sync in case the
user has disabled pluginsync in the meantime. This will ensure we attempt to
get the latest copy, but have a fall back just in case.

I believe this fix will need to be applied for some time to support older Puppet
versions.

I've updated the documentation to provide more thorough instructions for
cases where people are using environments, and to tell people to pluginsync
on the master and potentially restart their puppetmaster first just in case.
Merge pull request #22 from kbarber/ticket/10295-util_loader

(#10295) Work around bug #4248 whereby the puppet/util paths are not bein
(#10303) Release 0.0.2 - CHANGELOG and Modulefile update
Merge pull request #23 from kbarber/ticket/10303-release_0.0.2

(#10303) Release 0.0.2 - CHANGELOG and Modulefile update
(#10324) Remove extraneous whitespace from iptables rule line in spec tests

The extra spaces between port numbers were messing up the parse and
putting elements in the wrong parts of the hash during rule_to_hash.

This wasn't causing a test problem now, but was creating an issue for
other work people were doing on the module.