(PUP-2909) rubocop - Lint/UnreachableCode
(PUP-2909) rubocop - Lint/ConditionPosition - unnecessary elseif

This is a trivial bug without any side effects. The correction has the
same behavior as the original.
(PUP-2909) rubocop - Lint/ConditionPosition - replace elseif

    elsif => else
      new_key = mapping[key][:key]
      new_value = method(mapping[key][:method]).call(value)

Here, if the mapping[key][:key] was nil, then new_value would not
have been assigned. However, the behavior is still the same as old
because the method checks for new_key before returning a value.
(PUP-2909) rubocop - Lint/UselessComparison - bug in sort

    files_by_name.keys.sort { |a,b| b <=> b }.each do |path|

comparison b <=> b is invalid, and should be a <=> b
(PUP-2909) rubocop - when _: is no longer valid syntax

Replaces when _: with when _ <\n>
(PUP-2909) rubocop - meth{|my[opt]|} is no longer valid syntax in 1.9

replace meth{|my[opt]|} with meth{|o| my[opt] = o}
(PUP-2909) rubocop - enabled rubocop

The added cops are in .rubocop.yml : All but a few very useful cops have been
disabled.

The rubocop may be invoked using
```
rake rubocop
```
(PUP-2909) rubocop - Lint/LiteralInInterpolation

catch unnecessary interpolations
(PUP-2909) rubocop - disable Style/Encoding
(PUP-2909) rubocop - add to Gemfile
(PUP-2909) rubocop - should require directories to contain files in the sorted order
(PUP-2909) rubocop - disable in ruby 1.8

rubocop is not supported < 1.9.2
(PUP-2909) rubocop - disable rubocop for generated files
(PUP-2909) rubocop - disable hashrocket enforcement
Merge pull request #2855 from vrthra/fix/puppet-4/rubocop

(PUP-2909) enable static checking with rubocop