tablexi/chef-stackdriver — pull request #7 by estahn (2013-12-29 23:29:53+00:00)
Title: Rubocop checks

I added rubocop checks to avoid syntax errors like missing newline.

BEFORE:
```bash
[estahn:~/Projects/chef-stackdriver] rubocop_checks(+1/-2) ± bundle exec strainer test
# Straining 'stackdriver (v0.3.3)'
rubocop | bundle exec rubocop stackdriver
rubocop | Warning: unrecognized cop BracesAroundHashParameters found in /private/Users/estahn/Projects/stackdriver/.rubocop.yml
rubocop | == stackdriver/attributes/plugins.rb ==
rubocop | C: 1: Prefer single-quoted strings when you don't need string interpolation or special symbols.
rubocop | C: 9: Prefer single-quoted strings when you don't need string interpolation or special symbols.
rubocop | C: 12: Prefer single-quoted strings when you don't need string interpolation or special symbols.
rubocop | C: 17: Prefer single-quoted strings when you don't need string interpolation or special symbols.
rubocop | C: 18: Prefer single-quoted strings when you don't need string interpolation or special symbols.
rubocop | C: 19: Prefer single-quoted strings when you don't need string interpolation or special symbols.
rubocop | C: 23: Prefer single-quoted strings when you don't need string interpolation or special symbols.
rubocop | C: 24: Prefer single-quoted strings when you don't need string interpolation or special symbols.
rubocop | == stackdriver/metadata.rb ==
rubocop | C: 1: Prefer single-quoted strings when you don't need string interpolation or special symbols.
rubocop | C: 2: Prefer single-quoted strings when you don't need string interpolation or special symbols.
rubocop | C: 3: Prefer single-quoted strings when you don't need string interpolation or special symbols.
rubocop | C: 4: Prefer single-quoted strings when you don't need string interpolation or special symbols.
rubocop | C: 5: Prefer single-quoted strings when you don't need string interpolation or special symbols.
rubocop | C: 7: Prefer single-quoted strings when you don't need string interpolation or special symbols.
rubocop | C: 9: Prefer single-quoted strings when you don't need string interpolation or special symbols.
rubocop | C: 10: Prefer single-quoted strings when you don't need string interpolation or special symbols.
rubocop | C: 11: Prefer single-quoted strings when you don't need string interpolation or special symbols.
rubocop | C: 12: Prefer single-quoted strings when you don't need string interpolation or special symbols.
rubocop | C: 14: Prefer single-quoted strings when you don't need string interpolation or special symbols.
rubocop | C: 15: Prefer single-quoted strings when you don't need string interpolation or special symbols.
rubocop | == stackdriver/recipes/default.rb ==
rubocop | C: 25: Prefer single-quoted strings when you don't need string interpolation or special symbols.
rubocop | == stackdriver/recipes/plugins.rb ==
rubocop | C: 45: Prefer single-quoted strings when you don't need string interpolation or special symbols.
rubocop | == stackdriver/spec/plugins_spec.rb ==
rubocop | C: 5: Trailing whitespace detected.
rubocop | 7 files inspected, 23 offences detected
rubocop | Terminated with a non-zero exit status. Strainer assumes this is a failure.
rubocop | FAILURE!
foodcritic | bundle exec foodcritic stackdriver
foodcritic | FC024: Consider adding platform equivalents: stackdriver/attributes/default.rb:9
foodcritic | FC024: Consider adding platform equivalents: stackdriver/recipes/default.rb:24
foodcritic | SUCCESS!
chefspec | bundle exec rspec /Users/estahn/Projects/stackdriver
chefspec | ...*.........................................
chefspec | Pending:
chefspec | stackdriver::default ubuntu platform create apt repo
chefspec | # apt_repository resource has no spec matcher
chefspec | # /Users/estahn/Projects/stackdriver/spec/default_spec.rb:27
chefspec | Finished in 1.51 seconds
chefspec | 45 examples, 0 failures, 1 pending
chefspec | SUCCESS!
Strainer marked build as failure
```

AFTER:
```bash
[estahn:~/Projects/chef-stackdriver] rubocop_checks ± bundle exec strainer test
# Straining 'stackdriver (v0.3.3)'
rubocop | bundle exec rubocop stackdriver
rubocop | Warning: unrecognized cop BracesAroundHashParameters found in /private/Users/estahn/Projects/stackdriver/.rubocop.yml
rubocop | 7 files inspected, no offences detected
rubocop | SUCCESS!
foodcritic | bundle exec foodcritic stackdriver
foodcritic | FC024: Consider adding platform equivalents: stackdriver/attributes/default.rb:9
foodcritic | FC024: Consider adding platform equivalents: stackdriver/recipes/default.rb:24
foodcritic | SUCCESS!
chefspec | bundle exec rspec /Users/estahn/Projects/stackdriver
chefspec | ...*.........................................
chefspec | Pending:
chefspec | stackdriver::default ubuntu platform create apt repo
chefspec | # apt_repository resource has no spec matcher
chefspec | # /Users/estahn/Projects/stackdriver/spec/default_spec.rb:27
chefspec | Finished in 1.49 seconds
chefspec | 45 examples, 0 failures, 1 pending
chefspec | SUCCESS!
Strainer marked build OK
```

The warning shown by rubocop is due to an old version of the rubocop gem. With the current used chef gem it can't use the latest rubocop gem due to version incompatibility of one of the dependencies:
```
Bundler could not find compatible versions for gem "slop":
In Gemfile:
rubocop (~> 0.15) ruby depends on
slop (>= 3.4.5, ~> 3.4) ruby

chef (>= 0) ruby depends on
slop (2.4.4)
```