pronto-foodcritic 0.2.0 → 0.2.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 597ae3f64b94c516e8a72a66b180605e8f7d82d8
4
- data.tar.gz: bddf5f74f76486662da4f6b2983cf10a1ce0cb18
3
+ metadata.gz: 78bb8a5fcc9733a8355d0ab87cd9def9dc7777ad
4
+ data.tar.gz: 78cc9bd70a0b3647994dc10bee89ed2c65cd7053
5
5
  SHA512:
6
- metadata.gz: d11b2315267d6effa4ac77ae54c3f94196f4492081f9fd1fd209842fe09d8ed22df4f65ada4612206aa72b9e2c79e98c7db99ed46b5ebcb45501edc4ef1fe3ee
7
- data.tar.gz: ea77be4ef5af122c8b26014a7726c24ae8d5a16dc53d5f88ec765da2903244e215036cbff9e429305594e9f2b895b9145f7da9471edc06567f1a71887b770ce1
6
+ metadata.gz: 631e586c960b9cf990aba7ecad880657db4521617915b61a1e3725de91e8375c7152439c5eae602d711e6c42ff1d7216f441319235b4ef5034203ff5b301779d
7
+ data.tar.gz: 3bbe7991d7db482d9c9a91af97bdc27f5d7681a7223ed657b32be5d3b67b6c7dd57c3d451063df93cedff80e794ed630f2302751acfa9aad16caf939d5163516
@@ -10,26 +10,28 @@ module Pronto
10
10
  def run(patches, _)
11
11
  return [] unless patches
12
12
 
13
- patches.select { |patch| patch.additions > 0 }
14
- .select { |patch| ruby_file?(patch.new_file_full_path) }
15
- .map { |patch| inspect(patch) }
16
- .flatten.compact
17
- end
13
+ ruby_patches = patches.select { |patch| patch.additions > 0 }
14
+ .select { |patch| ruby_file?(patch.new_file_full_path) }
18
15
 
19
- def inspect(patch)
20
- path = patch.new_file_full_path.to_s
21
- path_type = if path.include?('cookbook')
22
- :cookbook_paths
23
- elsif path.include?('role')
24
- :role_paths
25
- end
16
+ inspect(ruby_patches)
17
+ end
26
18
 
27
- return if path_type.nil?
19
+ def inspect(patches)
20
+ paths = { cookbook_paths: [], role_paths: [] }
21
+ patches.each do |patch|
22
+ path = patch.new_file_full_path.to_s
23
+ if path.include?('cookbook')
24
+ paths[:cookbook_paths] << path
25
+ elsif path.include?('role')
26
+ paths[:role_paths] << path
27
+ end
28
+ end
28
29
 
29
- review = @linter.check({ path_type => path })
30
- review.warnings.map do |warning|
31
- patch.added_lines.select { |line| line.new_lineno == warning.match[:line] }
32
- .map { |line| new_message(warning, line) }
30
+ @linter.check(paths).warnings.flat_map do |warning|
31
+ patches.select { |patch| patch.new_file_full_path.to_s == warning.match[:filename] }
32
+ .flat_map(&:added_lines)
33
+ .select { |line| line.new_lineno == warning.match[:line] }
34
+ .flat_map { |line| new_message(warning, line) }
33
35
  end
34
36
  end
35
37
 
@@ -1,5 +1,5 @@
1
1
  module Pronto
2
2
  module FoodCriticVersion
3
- VERSION = '0.2.0'
3
+ VERSION = '0.2.1'
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: pronto-foodcritic
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Mindaugas Mozūras
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-05-23 00:00:00.000000000 Z
11
+ date: 2014-08-10 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: foodcritic
@@ -16,14 +16,14 @@ dependencies:
16
16
  requirements:
17
17
  - - ~>
18
18
  - !ruby/object:Gem::Version
19
- version: 3.0.0
19
+ version: 4.0.0
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - ~>
25
25
  - !ruby/object:Gem::Version
26
- version: 3.0.0
26
+ version: 4.0.0
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: pronto
29
29
  requirement: !ruby/object:Gem::Requirement
@@ -44,14 +44,14 @@ dependencies:
44
44
  requirements:
45
45
  - - ~>
46
46
  - !ruby/object:Gem::Version
47
- version: 10.1.0
47
+ version: 10.3.0
48
48
  type: :development
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
52
  - - ~>
53
53
  - !ruby/object:Gem::Version
54
- version: 10.1.0
54
+ version: 10.3.0
55
55
  description:
56
56
  email: mindaugas.mozuras@gmail.com
57
57
  executables: []
@@ -82,8 +82,9 @@ required_rubygems_version: !ruby/object:Gem::Requirement
82
82
  version: 1.3.6
83
83
  requirements: []
84
84
  rubyforge_project:
85
- rubygems_version: 2.2.2
85
+ rubygems_version: 2.3.0
86
86
  signing_key:
87
87
  specification_version: 4
88
88
  summary: Pronto runner for Food Critic, lint tool for chef
89
89
  test_files: []
90
+ has_rdoc: