pronto-flay 0.4.0 → 0.4.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/pronto/flay/version.rb +1 -1
- data/lib/pronto/flay.rb +6 -5
- metadata +3 -4
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: b01591138c720cdf6fe98d3d7693e1d912c4470b
|
|
4
|
+
data.tar.gz: 079f9f61e54694c7e140810a463188da0afd11a7
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: d4161f215a175b219aacf54fe127b7a69e954203ce5d70584f34414917468d662a03eb4cce093c72cd863d2fb6d56a68285886073760641e3a2d9a37c1cb7ac2
|
|
7
|
+
data.tar.gz: 25ce93a6c56ba5eba295dfa8abc54548979d685388c9aa2a3ba2372aea672dfae932a23ee39af336beeda9752bdc4f4fb99657aa17839d584b5d987ccc807e32
|
data/lib/pronto/flay/version.rb
CHANGED
data/lib/pronto/flay.rb
CHANGED
|
@@ -11,9 +11,9 @@ module Pronto
|
|
|
11
11
|
return [] unless patches
|
|
12
12
|
|
|
13
13
|
ruby_patches = patches.select { |patch| patch.additions > 0 }
|
|
14
|
-
|
|
14
|
+
.select { |patch| ruby_file?(patch.new_file_full_path) }
|
|
15
15
|
|
|
16
|
-
files = ruby_patches.map
|
|
16
|
+
files = ruby_patches.map(&:new_file_full_path)
|
|
17
17
|
|
|
18
18
|
if files.any?
|
|
19
19
|
@flay.process(*files)
|
|
@@ -38,13 +38,14 @@ module Pronto
|
|
|
38
38
|
|
|
39
39
|
def patch_for_node(ruby_patches, node)
|
|
40
40
|
ruby_patches.find do |patch|
|
|
41
|
-
patch.new_file_full_path
|
|
41
|
+
patch.new_file_full_path == node.file
|
|
42
42
|
end
|
|
43
43
|
end
|
|
44
44
|
|
|
45
45
|
def new_message(line, node)
|
|
46
|
+
path = line.patch.delta.new_file[:path]
|
|
46
47
|
hash = node.structural_hash
|
|
47
|
-
Message.new(
|
|
48
|
+
Message.new(path, line, level(hash), message(hash))
|
|
48
49
|
end
|
|
49
50
|
|
|
50
51
|
def level(hash)
|
|
@@ -58,7 +59,7 @@ module Pronto
|
|
|
58
59
|
def message(hash)
|
|
59
60
|
match = same?(hash) ? 'Identical' : 'Similar'
|
|
60
61
|
location = nodes_for(hash).map do |node|
|
|
61
|
-
"#{File.basename(node.file
|
|
62
|
+
"#{File.basename(node.file)}:#{node.line}"
|
|
62
63
|
end
|
|
63
64
|
|
|
64
65
|
"#{match} code found in #{location.join(', ')}"
|
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.
|
|
4
|
+
version: 0.4.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: 2015-01
|
|
11
|
+
date: 2015-06-01 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: pronto
|
|
@@ -110,9 +110,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
110
110
|
version: 1.3.6
|
|
111
111
|
requirements: []
|
|
112
112
|
rubyforge_project:
|
|
113
|
-
rubygems_version: 2.
|
|
113
|
+
rubygems_version: 2.4.5
|
|
114
114
|
signing_key:
|
|
115
115
|
specification_version: 4
|
|
116
116
|
summary: Pronto runner for Flay, structural similarities analyzer
|
|
117
117
|
test_files: []
|
|
118
|
-
has_rdoc:
|