pronto-flay 0.5.0 → 0.6.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/LICENSE +1 -1
- data/lib/pronto/flay/version.rb +1 -1
- data/lib/pronto/flay.rb +13 -18
- data/pronto-flay.gemspec +4 -4
- metadata +14 -8
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 24feb98e5afbd8d7d66e90fa3b89a8b84516973d
|
4
|
+
data.tar.gz: b8d486013dcbd5b70375b5d3ca068a9987312ae5
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 88ea2eca553ee415bd04a88f0f7aef0557beb655f749e0313c6f0e82aa009888f370ad63a498596ca05c2a19819990741ab734eef10c0cf06805962e728f8dcb
|
7
|
+
data.tar.gz: 038a310a823090dd31aa7c54d2ec1f15ed72de43d9832036efeafe9ad4e091c2fd08b6eb1ca5947fa4aef0b549fdb6d39ea3e9cb034cd22d2edf1de469728c6c
|
data/LICENSE
CHANGED
data/lib/pronto/flay/version.rb
CHANGED
data/lib/pronto/flay.rb
CHANGED
@@ -3,31 +3,26 @@ require 'flay'
|
|
3
3
|
|
4
4
|
module Pronto
|
5
5
|
class Flay < Runner
|
6
|
-
def
|
7
|
-
@flay = ::Flay.new
|
8
|
-
end
|
9
|
-
|
10
|
-
def run(patches, _)
|
11
|
-
return [] unless patches
|
12
|
-
|
13
|
-
ruby_patches = patches.select { |patch| patch.additions > 0 }
|
14
|
-
.select { |patch| ruby_file?(patch.new_file_full_path) }
|
15
|
-
|
6
|
+
def run
|
16
7
|
files = ruby_patches.map(&:new_file_full_path)
|
17
8
|
files = ::Flay.filter_files(files)
|
18
9
|
|
19
10
|
if files.any?
|
20
|
-
|
21
|
-
|
22
|
-
|
11
|
+
flay.process(*files)
|
12
|
+
flay.analyze
|
13
|
+
messages
|
23
14
|
else
|
24
15
|
[]
|
25
16
|
end
|
26
17
|
end
|
27
18
|
|
28
|
-
def
|
19
|
+
def flay
|
20
|
+
@flay ||= ::Flay.new
|
21
|
+
end
|
22
|
+
|
23
|
+
def messages
|
29
24
|
nodes.map do |node|
|
30
|
-
patch = patch_for_node(
|
25
|
+
patch = patch_for_node(node)
|
31
26
|
|
32
27
|
line = patch.added_lines.find do |added_line|
|
33
28
|
added_line.new_lineno == node.line
|
@@ -37,7 +32,7 @@ module Pronto
|
|
37
32
|
end.flatten.compact
|
38
33
|
end
|
39
34
|
|
40
|
-
def patch_for_node(
|
35
|
+
def patch_for_node(node)
|
41
36
|
ruby_patches.find do |patch|
|
42
37
|
patch.new_file_full_path == node.file
|
43
38
|
end
|
@@ -46,7 +41,7 @@ module Pronto
|
|
46
41
|
def new_message(line, node)
|
47
42
|
path = line.patch.delta.new_file[:path]
|
48
43
|
hash = node.structural_hash
|
49
|
-
Message.new(path, line, level(hash), message(hash))
|
44
|
+
Message.new(path, line, level(hash), message(hash), nil, self.class)
|
50
45
|
end
|
51
46
|
|
52
47
|
def level(hash)
|
@@ -54,7 +49,7 @@ module Pronto
|
|
54
49
|
end
|
55
50
|
|
56
51
|
def same?(hash)
|
57
|
-
|
52
|
+
flay.identical[hash]
|
58
53
|
end
|
59
54
|
|
60
55
|
def message(hash)
|
data/pronto-flay.gemspec
CHANGED
@@ -32,9 +32,9 @@ Gem::Specification.new do |s|
|
|
32
32
|
s.extra_rdoc_files = ['LICENSE', 'README.md']
|
33
33
|
s.require_paths = ['lib']
|
34
34
|
|
35
|
-
s.add_dependency('pronto', '~> 0.
|
36
|
-
s.add_dependency('flay', '~> 2.6.0')
|
37
|
-
s.add_development_dependency('rake', '~>
|
38
|
-
s.add_development_dependency('rspec', '~> 3.
|
35
|
+
s.add_dependency('pronto', '~> 0.6.0')
|
36
|
+
s.add_dependency('flay', '~> 2.7', '>= 2.6.0')
|
37
|
+
s.add_development_dependency('rake', '~> 11.0')
|
38
|
+
s.add_development_dependency('rspec', '~> 3.4')
|
39
39
|
s.add_development_dependency('rspec-its', '~> 1.2')
|
40
40
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: pronto-flay
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.6.0
|
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:
|
11
|
+
date: 2016-03-13 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: pronto
|
@@ -16,19 +16,22 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - "~>"
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: 0.
|
19
|
+
version: 0.6.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: 0.
|
26
|
+
version: 0.6.0
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: flay
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
31
|
- - "~>"
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '2.7'
|
34
|
+
- - ">="
|
32
35
|
- !ruby/object:Gem::Version
|
33
36
|
version: 2.6.0
|
34
37
|
type: :runtime
|
@@ -36,6 +39,9 @@ dependencies:
|
|
36
39
|
version_requirements: !ruby/object:Gem::Requirement
|
37
40
|
requirements:
|
38
41
|
- - "~>"
|
42
|
+
- !ruby/object:Gem::Version
|
43
|
+
version: '2.7'
|
44
|
+
- - ">="
|
39
45
|
- !ruby/object:Gem::Version
|
40
46
|
version: 2.6.0
|
41
47
|
- !ruby/object:Gem::Dependency
|
@@ -44,28 +50,28 @@ dependencies:
|
|
44
50
|
requirements:
|
45
51
|
- - "~>"
|
46
52
|
- !ruby/object:Gem::Version
|
47
|
-
version: '
|
53
|
+
version: '11.0'
|
48
54
|
type: :development
|
49
55
|
prerelease: false
|
50
56
|
version_requirements: !ruby/object:Gem::Requirement
|
51
57
|
requirements:
|
52
58
|
- - "~>"
|
53
59
|
- !ruby/object:Gem::Version
|
54
|
-
version: '
|
60
|
+
version: '11.0'
|
55
61
|
- !ruby/object:Gem::Dependency
|
56
62
|
name: rspec
|
57
63
|
requirement: !ruby/object:Gem::Requirement
|
58
64
|
requirements:
|
59
65
|
- - "~>"
|
60
66
|
- !ruby/object:Gem::Version
|
61
|
-
version: '3.
|
67
|
+
version: '3.4'
|
62
68
|
type: :development
|
63
69
|
prerelease: false
|
64
70
|
version_requirements: !ruby/object:Gem::Requirement
|
65
71
|
requirements:
|
66
72
|
- - "~>"
|
67
73
|
- !ruby/object:Gem::Version
|
68
|
-
version: '3.
|
74
|
+
version: '3.4'
|
69
75
|
- !ruby/object:Gem::Dependency
|
70
76
|
name: rspec-its
|
71
77
|
requirement: !ruby/object:Gem::Requirement
|