flay 2.6.1 → 2.7.0
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.txt +6 -0
- data/README.txt +1 -1
- data/Rakefile +3 -1
- data/lib/flay.rb +2 -2
- data/lib/flay_erb.rb +22 -2
- metadata +29 -17
- metadata.gz.sig +2 -3
- data/.gemtest +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f1c0f1551528a45340225c5bd74349a396bba865
|
4
|
+
data.tar.gz: 8f2fcda92e948267073c31a4aa3cbddc044cd83e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a81499c489c9d49cf066a4feef7bf5bb834850b74623de8539ee4dea339b543d3afe52097546f35888038a0637be4da32704b000b45b91dbadfd541ba9bf46fb
|
7
|
+
data.tar.gz: 4c96b08538b1b54866df0ca31a17e5963233fd2965f1f6c8a4ad9cf0792eceadf3ec428b4a8a8783a4a133194fab23dd82c2d7ad9284a6dbc25c395a667c0b6f
|
checksums.yaml.gz.sig
CHANGED
Binary file
|
data.tar.gz.sig
CHANGED
Binary file
|
data/History.txt
CHANGED
data/README.txt
CHANGED
data/Rakefile
CHANGED
@@ -10,6 +10,7 @@ Hoe::add_include_dirs("../../sexp_processor/dev/lib",
|
|
10
10
|
"lib")
|
11
11
|
|
12
12
|
Hoe.plugin :seattlerb
|
13
|
+
Hoe.plugin :isolate
|
13
14
|
|
14
15
|
Hoe.spec "flay" do
|
15
16
|
developer "Ryan Davis", "ryand-ruby@zenspider.com"
|
@@ -17,11 +18,12 @@ Hoe.spec "flay" do
|
|
17
18
|
|
18
19
|
dependency "sexp_processor", "~> 4.0"
|
19
20
|
dependency "ruby_parser", "~> 3.0"
|
21
|
+
dependency "erubis", "~> 2.7.0"
|
20
22
|
|
21
23
|
self.flay_threshold = 250
|
22
24
|
end
|
23
25
|
|
24
|
-
task :debug do
|
26
|
+
task :debug => :isolate do
|
25
27
|
require "flay"
|
26
28
|
|
27
29
|
file = ENV["F"]
|
data/lib/flay.rb
CHANGED
@@ -15,7 +15,7 @@ class File
|
|
15
15
|
end
|
16
16
|
|
17
17
|
class Flay
|
18
|
-
VERSION = "2.
|
18
|
+
VERSION = "2.7.0" # :nodoc:
|
19
19
|
|
20
20
|
class Item < Struct.new(:structural_hash, :name, :bonus, :mass, :locations)
|
21
21
|
alias identical? bonus
|
@@ -174,7 +174,7 @@ class Flay
|
|
174
174
|
end
|
175
175
|
|
176
176
|
##
|
177
|
-
# Loads all flay plugins. Files must be named "
|
177
|
+
# Loads all flay plugins. Files must be named "flay_*.rb".
|
178
178
|
|
179
179
|
def self.load_plugins
|
180
180
|
unless defined? @@plugins then
|
data/lib/flay_erb.rb
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
|
3
3
|
require "rubygems"
|
4
4
|
require "flay"
|
5
|
-
require "
|
5
|
+
require "erubis"
|
6
6
|
|
7
7
|
class Flay
|
8
8
|
|
@@ -13,7 +13,7 @@ class Flay
|
|
13
13
|
def process_erb file
|
14
14
|
erb = File.read file
|
15
15
|
|
16
|
-
ruby =
|
16
|
+
ruby = Erubis.new(erb).src
|
17
17
|
begin
|
18
18
|
RubyParser.new.process(ruby, file)
|
19
19
|
rescue => e
|
@@ -21,4 +21,24 @@ class Flay
|
|
21
21
|
raise e
|
22
22
|
end
|
23
23
|
end
|
24
|
+
|
25
|
+
class Erubis < ::Erubis::Eruby # :nodoc:
|
26
|
+
BLOCK_EXPR = /\s+(do|\{)(\s*\|[^|]*\|)?\s*\Z/
|
27
|
+
|
28
|
+
def add_expr_literal(src, code)
|
29
|
+
if code =~ BLOCK_EXPR
|
30
|
+
src << '@output_buffer.append= ' << code
|
31
|
+
else
|
32
|
+
src << '@output_buffer.append=(' << code << ');'
|
33
|
+
end
|
34
|
+
end
|
35
|
+
|
36
|
+
def add_expr_escaped(src, code)
|
37
|
+
if code =~ BLOCK_EXPR
|
38
|
+
src << "@output_buffer.safe_append= " << code
|
39
|
+
else
|
40
|
+
src << "@output_buffer.safe_append=(" << code << ");"
|
41
|
+
end
|
42
|
+
end
|
43
|
+
end
|
24
44
|
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.
|
4
|
+
version: 2.7.0
|
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
|
+
MIIDPjCCAiagAwIBAgIBAzANBgkqhkiG9w0BAQUFADBFMRMwEQYDVQQDDApyeWFu
|
14
14
|
ZC1ydWJ5MRkwFwYKCZImiZPyLGQBGRYJemVuc3BpZGVyMRMwEQYKCZImiZPyLGQB
|
15
|
-
|
15
|
+
GRYDY29tMB4XDTE1MDkxOTIwNTEyMloXDTE2MDkxODIwNTEyMlowRTETMBEGA1UE
|
16
16
|
AwwKcnlhbmQtcnVieTEZMBcGCgmSJomT8ixkARkWCXplbnNwaWRlcjETMBEGCgmS
|
17
17
|
JomT8ixkARkWA2NvbTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBALda
|
18
18
|
b9DCgK+627gPJkB6XfjZ1itoOQvpqH1EXScSaba9/S2VF22VYQbXU1xQXL/WzCkx
|
@@ -22,14 +22,14 @@ cert_chain:
|
|
22
22
|
qhtV7HJxNKuPj/JFH0D2cswvzznE/a5FOYO68g+YCuFi5L8wZuuM8zzdwjrWHqSV
|
23
23
|
gBEfoTEGr7Zii72cx+sCAwEAAaM5MDcwCQYDVR0TBAIwADALBgNVHQ8EBAMCBLAw
|
24
24
|
HQYDVR0OBBYEFEfFe9md/r/tj/Wmwpy+MI8d9k/hMA0GCSqGSIb3DQEBBQUAA4IB
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
25
|
+
AQB+Hx8xUgrpZa4P8H8gR8zme5kISwQrG80MbpqJV6/G3/ZicRFhN5sjwu0uHGue
|
26
|
+
bd9Cymf6oIRwHVarJux2M32T6bL07Hmi07w2QaPc3MnMKB/D46SRZ2JSSGPFRBTc
|
27
|
+
SilobMRoGs/7B15uGFUEnNrCB/ltMqhwwSx1r++UQPfeySHEV9uqu03E5Vb7J37O
|
28
|
+
2Er6PLXHRiYsIycD1LkMi6YnixdITRHmrqJYE2rsjaIfpIehiusVAPHkNf7qbpHq
|
29
|
+
qx3h45R1CAsObX0SQDIT+rRbQrtKz1GHIZTOFYvEJjUY1XmRTZupD3CJ8Q7sDqSy
|
30
|
+
NLq5jm1fq6Y9Uolu3RJbmycf
|
31
31
|
-----END CERTIFICATE-----
|
32
|
-
date:
|
32
|
+
date: 2016-01-21 00:00:00.000000000 Z
|
33
33
|
dependencies:
|
34
34
|
- !ruby/object:Gem::Dependency
|
35
35
|
name: sexp_processor
|
@@ -59,20 +59,34 @@ dependencies:
|
|
59
59
|
- - ~>
|
60
60
|
- !ruby/object:Gem::Version
|
61
61
|
version: '3.0'
|
62
|
+
- !ruby/object:Gem::Dependency
|
63
|
+
name: erubis
|
64
|
+
requirement: !ruby/object:Gem::Requirement
|
65
|
+
requirements:
|
66
|
+
- - ~>
|
67
|
+
- !ruby/object:Gem::Version
|
68
|
+
version: 2.7.0
|
69
|
+
type: :runtime
|
70
|
+
prerelease: false
|
71
|
+
version_requirements: !ruby/object:Gem::Requirement
|
72
|
+
requirements:
|
73
|
+
- - ~>
|
74
|
+
- !ruby/object:Gem::Version
|
75
|
+
version: 2.7.0
|
62
76
|
- !ruby/object:Gem::Dependency
|
63
77
|
name: minitest
|
64
78
|
requirement: !ruby/object:Gem::Requirement
|
65
79
|
requirements:
|
66
80
|
- - ~>
|
67
81
|
- !ruby/object:Gem::Version
|
68
|
-
version: '5.
|
82
|
+
version: '5.8'
|
69
83
|
type: :development
|
70
84
|
prerelease: false
|
71
85
|
version_requirements: !ruby/object:Gem::Requirement
|
72
86
|
requirements:
|
73
87
|
- - ~>
|
74
88
|
- !ruby/object:Gem::Version
|
75
|
-
version: '5.
|
89
|
+
version: '5.8'
|
76
90
|
- !ruby/object:Gem::Dependency
|
77
91
|
name: rdoc
|
78
92
|
requirement: !ruby/object:Gem::Requirement
|
@@ -93,14 +107,14 @@ dependencies:
|
|
93
107
|
requirements:
|
94
108
|
- - ~>
|
95
109
|
- !ruby/object:Gem::Version
|
96
|
-
version: '3.
|
110
|
+
version: '3.14'
|
97
111
|
type: :development
|
98
112
|
prerelease: false
|
99
113
|
version_requirements: !ruby/object:Gem::Requirement
|
100
114
|
requirements:
|
101
115
|
- - ~>
|
102
116
|
- !ruby/object:Gem::Version
|
103
|
-
version: '3.
|
117
|
+
version: '3.14'
|
104
118
|
description: |-
|
105
119
|
Flay analyzes code for structural similarities. Differences in literal
|
106
120
|
values, variable, class, method names, whitespace, programming style,
|
@@ -115,7 +129,6 @@ extra_rdoc_files:
|
|
115
129
|
- Manifest.txt
|
116
130
|
- README.txt
|
117
131
|
files:
|
118
|
-
- .gemtest
|
119
132
|
- History.txt
|
120
133
|
- Manifest.txt
|
121
134
|
- README.txt
|
@@ -152,5 +165,4 @@ rubygems_version: 2.4.5
|
|
152
165
|
signing_key:
|
153
166
|
specification_version: 4
|
154
167
|
summary: Flay analyzes code for structural similarities
|
155
|
-
test_files:
|
156
|
-
- test/test_flay.rb
|
168
|
+
test_files: []
|
metadata.gz.sig
CHANGED
@@ -1,3 +1,2 @@
|
|
1
|
-
|
2
|
-
��
|
3
|
-
�,t�7�8/P%��3�r ���Ǧj?�;Fn���`��4�PV�5�:B���{�K.!H�Sì��AZi
|
1
|
+
����9i'�m61c~������@s%��_�h@�ب��Hb<�*���R�@�@li��I����Dn����+C�HAw
|
2
|
+
�ܸ���ޑ~�ej�gZ>�9zUPc��]Xg�����s(��Kj�����&�hkZ�/k������7��p�~��~��C[#l� d�����`"�ʈh�Z+8���4��[.HL椽j0��@��-}F�['�l�F��I���Fׇک���.Z8;��6 Fv��ը
|
data/.gemtest
DELETED
File without changes
|