foodcritic 1.6.0 → 1.6.1

Sign up to get free protection for your applications and to get access to all the features.
@@ -402,13 +402,14 @@ end
402
402
 
403
403
  rule "FC030", "Cookbook contains debugger breakpoints" do
404
404
  tags %w{annoyances}
405
- recipe do |ast|
405
+ def pry_bindings(ast)
406
406
  ast.xpath('//call[(vcall|var_ref)/ident/@value="binding"]
407
407
  [ident/@value="pry"]')
408
408
  end
409
- library{recipe}
410
- metadata{recipe}
411
- template{recipe}
409
+ recipe{|ast| pry_bindings(ast)}
410
+ library{|ast| pry_bindings(ast)}
411
+ metadata{|ast| pry_bindings(ast)}
412
+ template{|ast| pry_bindings(ast)}
412
413
  end
413
414
 
414
415
  rule "FC031", "Cookbook without metadata file" do
@@ -478,7 +479,11 @@ rule "FC037", "Invalid notification action" do
478
479
  recipe do |ast|
479
480
  find_resources(ast).select do |resource|
480
481
  notifications(resource).any? do |n|
481
- ! resource_action?(n[:resource_type], n[:action])
482
+ type = case n[:type]
483
+ when :notifies then n[:resource_type]
484
+ when :subscribes then resource_type(resource).to_sym
485
+ end
486
+ ! resource_action?(type, n[:action])
482
487
  end
483
488
  end
484
489
  end
@@ -1,4 +1,4 @@
1
1
  module FoodCritic
2
2
  # The current version of foodcritic
3
- VERSION = '1.6.0'
3
+ VERSION = '1.6.1'
4
4
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: foodcritic
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.6.0
4
+ version: 1.6.1
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-08-28 00:00:00.000000000 Z
12
+ date: 2012-08-30 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: gherkin
@@ -187,12 +187,12 @@ required_rubygems_version: !ruby/object:Gem::Requirement
187
187
  version: '0'
188
188
  segments:
189
189
  - 0
190
- hash: -4002614929241564583
190
+ hash: -2527542643292755100
191
191
  requirements: []
192
192
  rubyforge_project:
193
193
  rubygems_version: 1.8.19
194
194
  signing_key:
195
195
  specification_version: 3
196
- summary: foodcritic-1.6.0
196
+ summary: foodcritic-1.6.1
197
197
  test_files: []
198
198
  has_rdoc: