flay 2.12.0 → 2.12.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- checksums.yaml.gz.sig +0 -0
- data.tar.gz.sig +0 -0
- data/History.rdoc +6 -0
- data/lib/flay.rb +10 -6
- data/test/test_flay.rb +3 -3
- metadata +22 -17
- metadata.gz.sig +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 82b6642b1277bcd3a44da4c3ce4b5e72fa4432f7660a3d497d933ca4c2950556
|
4
|
+
data.tar.gz: c865cbbdf68e0183bbf3fb6a1ff6188651034634398364aac77c4eed451384c3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5ed7081512167da74c114acbd37098f1b6ff01a0521c2f400408da1243441030e6d342d7e34b400702eb74cf97a66879bd5b276339564c83582f1105c624fe15
|
7
|
+
data.tar.gz: c57fdc2be2bb6c85523fa4e895fc6cbe04ffd158a17a0d946768950dec545653a132ccdfa9ab51c25502a66076f7a7e8f45ba78dafc921995b175aabe22f1531
|
checksums.yaml.gz.sig
CHANGED
Binary file
|
data.tar.gz.sig
CHANGED
Binary file
|
data/History.rdoc
CHANGED
data/lib/flay.rb
CHANGED
@@ -17,7 +17,7 @@ class File
|
|
17
17
|
end
|
18
18
|
|
19
19
|
class Flay
|
20
|
-
VERSION = "2.12.
|
20
|
+
VERSION = "2.12.1" # :nodoc:
|
21
21
|
|
22
22
|
class Item < Struct.new(:structural_hash, :name, :bonus, :mass, :locations)
|
23
23
|
alias identical? bonus
|
@@ -228,10 +228,11 @@ class Flay
|
|
228
228
|
update_masses
|
229
229
|
|
230
230
|
sorted = masses.sort_by { |h,m|
|
231
|
+
exp = hashes[h].first
|
231
232
|
[-m,
|
232
|
-
|
233
|
-
|
234
|
-
|
233
|
+
exp.file,
|
234
|
+
exp.line,
|
235
|
+
exp.sexp_type.to_s]
|
235
236
|
}
|
236
237
|
|
237
238
|
sorted.map { |hash, mass|
|
@@ -249,7 +250,7 @@ class Flay
|
|
249
250
|
Location[x.file, x.line, extra]
|
250
251
|
}
|
251
252
|
|
252
|
-
Item[hash, node.
|
253
|
+
Item[hash, node.sexp_type, bonus, mass, locs]
|
253
254
|
}.compact
|
254
255
|
end
|
255
256
|
|
@@ -579,7 +580,10 @@ class Sexp
|
|
579
580
|
s
|
580
581
|
end
|
581
582
|
|
583
|
+
alias :[] :[] # needed for STRICT_SEXP
|
584
|
+
|
582
585
|
def [] a # :nodoc:
|
586
|
+
# TODO: figure out a way to make this STRICT_SEXP happy
|
583
587
|
s = super
|
584
588
|
if Sexp === s then
|
585
589
|
s.file = self.file
|
@@ -636,7 +640,7 @@ class Sexp # straight from flay-persistent
|
|
636
640
|
def pure_ruby_hash # :nodoc: see above
|
637
641
|
hash = 0
|
638
642
|
|
639
|
-
n = NODE_NAMES[
|
643
|
+
n = NODE_NAMES[sexp_type]
|
640
644
|
|
641
645
|
raise "Bad lookup: #{first} in #{sexp.inspect}" unless n
|
642
646
|
|
data/test/test_flay.rb
CHANGED
@@ -65,7 +65,7 @@ class TestSexp < Minitest::Test
|
|
65
65
|
assert_equal expected, x.sort.uniq
|
66
66
|
end
|
67
67
|
|
68
|
-
DOG_AND_CAT =
|
68
|
+
DOG_AND_CAT = RubyParser.new.process <<-RUBY
|
69
69
|
##
|
70
70
|
# I am a dog.
|
71
71
|
|
@@ -88,7 +88,7 @@ class TestSexp < Minitest::Test
|
|
88
88
|
end
|
89
89
|
RUBY
|
90
90
|
|
91
|
-
ROUND =
|
91
|
+
ROUND = RubyParser.new.process <<-RUBY
|
92
92
|
def x(n)
|
93
93
|
if n % 2 == 0
|
94
94
|
return n
|
@@ -196,7 +196,7 @@ class TestSexp < Minitest::Test
|
|
196
196
|
|
197
197
|
flay.process_sexp ROUND.deep_clone
|
198
198
|
|
199
|
-
actual = flay.hashes.values.map { |sexps| sexps.map
|
199
|
+
actual = flay.hashes.values.map { |sexps| sexps.map(&:sexp_type) }
|
200
200
|
|
201
201
|
assert_equal expected, actual.sort_by { |a| a.inspect }
|
202
202
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: flay
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.12.
|
4
|
+
version: 2.12.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ryan Davis
|
@@ -10,9 +10,9 @@ bindir: bin
|
|
10
10
|
cert_chain:
|
11
11
|
- |
|
12
12
|
-----BEGIN CERTIFICATE-----
|
13
|
-
|
13
|
+
MIIDPjCCAiagAwIBAgIBAzANBgkqhkiG9w0BAQsFADBFMRMwEQYDVQQDDApyeWFu
|
14
14
|
ZC1ydWJ5MRkwFwYKCZImiZPyLGQBGRYJemVuc3BpZGVyMRMwEQYKCZImiZPyLGQB
|
15
|
-
|
15
|
+
GRYDY29tMB4XDTE4MTIwNDIxMzAxNFoXDTE5MTIwNDIxMzAxNFowRTETMBEGA1UE
|
16
16
|
AwwKcnlhbmQtcnVieTEZMBcGCgmSJomT8ixkARkWCXplbnNwaWRlcjETMBEGCgmS
|
17
17
|
JomT8ixkARkWA2NvbTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBALda
|
18
18
|
b9DCgK+627gPJkB6XfjZ1itoOQvpqH1EXScSaba9/S2VF22VYQbXU1xQXL/WzCkx
|
@@ -21,15 +21,15 @@ cert_chain:
|
|
21
21
|
GiadM9GHRaDiaxuX0cIUBj19T01mVE2iymf9I6bEsiayK/n6QujtyCbTWsAS9Rqt
|
22
22
|
qhtV7HJxNKuPj/JFH0D2cswvzznE/a5FOYO68g+YCuFi5L8wZuuM8zzdwjrWHqSV
|
23
23
|
gBEfoTEGr7Zii72cx+sCAwEAAaM5MDcwCQYDVR0TBAIwADALBgNVHQ8EBAMCBLAw
|
24
|
-
HQYDVR0OBBYEFEfFe9md/r/tj/Wmwpy+MI8d9k/
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
24
|
+
HQYDVR0OBBYEFEfFe9md/r/tj/Wmwpy+MI8d9k/hMA0GCSqGSIb3DQEBCwUAA4IB
|
25
|
+
AQCbJwLmpJR2PomLU+Zzw3KRzH/hbyUWc/ftru71AopZ1fy4iY9J/BW5QYKVYwbP
|
26
|
+
V0FSBWtvfI/RdwfKGtuGhPKECZgmLieGuZ3XCc09qPu1bdg7i/tu1p0t0c6163ku
|
27
|
+
nDMDIC/t/DAFK0TY9I3HswuyZGbLW7rgF0DmiuZdN/RPhHq2pOLMLXJmFclCb/im
|
28
|
+
9yToml/06TJdUJ5p64mkBs0TzaK66DIB1Smd3PdtfZqoRV+EwaXMdx0Hb3zdR1JR
|
29
|
+
Em82dBUFsipwMLCYj39kcyHWAxyl6Ae1Cn9r/ItVBCxoeFdrHjfavnrIEoXUt4bU
|
30
|
+
UfBugfLD19bu3nvL+zTAGx/U
|
31
31
|
-----END CERTIFICATE-----
|
32
|
-
date:
|
32
|
+
date: 2019-10-09 00:00:00.000000000 Z
|
33
33
|
dependencies:
|
34
34
|
- !ruby/object:Gem::Dependency
|
35
35
|
name: sexp_processor
|
@@ -119,30 +119,36 @@ dependencies:
|
|
119
119
|
name: rdoc
|
120
120
|
requirement: !ruby/object:Gem::Requirement
|
121
121
|
requirements:
|
122
|
-
- - "
|
122
|
+
- - ">="
|
123
123
|
- !ruby/object:Gem::Version
|
124
124
|
version: '4.0'
|
125
|
+
- - "<"
|
126
|
+
- !ruby/object:Gem::Version
|
127
|
+
version: '7'
|
125
128
|
type: :development
|
126
129
|
prerelease: false
|
127
130
|
version_requirements: !ruby/object:Gem::Requirement
|
128
131
|
requirements:
|
129
|
-
- - "
|
132
|
+
- - ">="
|
130
133
|
- !ruby/object:Gem::Version
|
131
134
|
version: '4.0'
|
135
|
+
- - "<"
|
136
|
+
- !ruby/object:Gem::Version
|
137
|
+
version: '7'
|
132
138
|
- !ruby/object:Gem::Dependency
|
133
139
|
name: hoe
|
134
140
|
requirement: !ruby/object:Gem::Requirement
|
135
141
|
requirements:
|
136
142
|
- - "~>"
|
137
143
|
- !ruby/object:Gem::Version
|
138
|
-
version: '3.
|
144
|
+
version: '3.18'
|
139
145
|
type: :development
|
140
146
|
prerelease: false
|
141
147
|
version_requirements: !ruby/object:Gem::Requirement
|
142
148
|
requirements:
|
143
149
|
- - "~>"
|
144
150
|
- !ruby/object:Gem::Version
|
145
|
-
version: '3.
|
151
|
+
version: '3.18'
|
146
152
|
description: |-
|
147
153
|
Flay analyzes code for structural similarities. Differences in literal
|
148
154
|
values, variable, class, method names, whitespace, programming style,
|
@@ -188,8 +194,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
188
194
|
- !ruby/object:Gem::Version
|
189
195
|
version: '0'
|
190
196
|
requirements: []
|
191
|
-
|
192
|
-
rubygems_version: 2.7.3
|
197
|
+
rubygems_version: 3.0.6
|
193
198
|
signing_key:
|
194
199
|
specification_version: 4
|
195
200
|
summary: Flay analyzes code for structural similarities
|
metadata.gz.sig
CHANGED
Binary file
|