onlyoffice_rspec_parser 0.2.0 → 0.3.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/onlyoffice_rspec_parser/name.rb +2 -0
- data/lib/onlyoffice_rspec_parser/rspec_parser.rb +14 -2
- data/lib/onlyoffice_rspec_parser/spec_parsed.rb +3 -0
- data/lib/onlyoffice_rspec_parser/spec_parsed/it_parsed.rb +2 -1
- data/lib/onlyoffice_rspec_parser/version.rb +2 -1
- metadata +123 -11
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 55922500d4fd508cd1d4bc7e61344d0b551416dd9078f5fb6f9c0c90a7352836
|
4
|
+
data.tar.gz: 17ca69a5e8cb086aea388892fdf450ba0ae95a2352e8b3a6d2c7f4bd522b92e3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c70d626b2efac1198d0be5e868cd7b43d6e6b527bb0352703f24883d7aeae83ed5d70eca096e3b8efe7187e1f8271e65d8b4b99503c91886453599063084937e
|
7
|
+
data.tar.gz: ffa043f53ee5e1165e921260957069c97a2b8c98bf3d4ba999a95e4777ffe1ed317f679bce0caf9dd71317cec110b9f890a705a3911edcf77f1f4b771d5ab026
|
@@ -4,27 +4,36 @@ require 'onlyoffice_logger_helper'
|
|
4
4
|
module OnlyofficeRspecParser
|
5
5
|
# Static parsing of _rspec.rb files
|
6
6
|
class SpecParser
|
7
|
+
# Get list of `it` in path
|
8
|
+
# @param [String] path_to_spec path
|
9
|
+
# @return [Array<String>] list
|
7
10
|
def self.get_it_mass_by_path(path_to_spec)
|
8
11
|
raise "File not exists: #{path_to_spec}!" unless File.exist?(path_to_spec)
|
9
12
|
|
10
13
|
test_file = File.new(path_to_spec)
|
11
14
|
file_tests = []
|
12
15
|
test_file.each do |line|
|
13
|
-
next unless /it [
|
16
|
+
next unless /it ['"](.*)?['"] do/.match?(line)
|
14
17
|
|
15
|
-
test_name = line.scan(/it [
|
18
|
+
test_name = line.scan(/it ['"](.*?)['"] do/)
|
16
19
|
file_tests << test_name.first.first
|
17
20
|
end
|
18
21
|
test_file.close
|
19
22
|
file_tests
|
20
23
|
end
|
21
24
|
|
25
|
+
# Return uniq list of its
|
26
|
+
# @param [String] path_to_spec path
|
22
27
|
def self.uniq_duplicates(path_to_spec)
|
28
|
+
# @return [Array<String>] list of uniqs
|
23
29
|
case_names = get_it_mass_by_path(path_to_spec)
|
24
30
|
duplicates = case_names.find_all { |e| case_names.count(e) > 1 }
|
25
31
|
duplicates.uniq
|
26
32
|
end
|
27
33
|
|
34
|
+
# Check if spec contains doubles
|
35
|
+
# @param [String] path_to_spec path
|
36
|
+
# @return [Array<String>] list of duplicates
|
28
37
|
def self.check_for_doubles(path_to_spec)
|
29
38
|
duplicates = uniq_duplicates(path_to_spec)
|
30
39
|
if duplicates.empty?
|
@@ -38,6 +47,9 @@ module OnlyofficeRspecParser
|
|
38
47
|
duplicates
|
39
48
|
end
|
40
49
|
|
50
|
+
# Check if path with a lot of specs contains doubles
|
51
|
+
# @param [String] folder path
|
52
|
+
# @return [Array<String>] list of duplicates
|
41
53
|
def self.check_folder_for_spec_doubles(folder)
|
42
54
|
files = Dir.glob("#{folder}/**/*_spec.*")
|
43
55
|
files.each do |cur_file|
|
@@ -18,6 +18,9 @@ module OnlyofficeRspecParser
|
|
18
18
|
@it_nodes ||= search_node_for_it(@parsed_data)
|
19
19
|
end
|
20
20
|
|
21
|
+
# Search node for it
|
22
|
+
# @param [Parser::AST:Node] node for find
|
23
|
+
# @return [Array<Object>] nodes
|
21
24
|
def search_node_for_it(node)
|
22
25
|
nodes = []
|
23
26
|
node.children.each do |child|
|
@@ -8,13 +8,14 @@ module OnlyofficeRspecParser
|
|
8
8
|
@file = file
|
9
9
|
end
|
10
10
|
|
11
|
+
# @return [String] it node to string
|
11
12
|
def to_s
|
12
13
|
"#{@file}:#{@node.loc.expression.to_s.split(':')[1]}"
|
13
14
|
end
|
14
15
|
|
15
16
|
# @return [True, False] check if node include `expect`
|
16
17
|
def include_expect?
|
17
|
-
@node.children.last.to_s.match?(
|
18
|
+
@node.children.last.to_s.match?(/:expect\)?\n/)
|
18
19
|
end
|
19
20
|
end
|
20
21
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: onlyoffice_rspec_parser
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.3.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- ONLYOFFICE
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2020-
|
12
|
+
date: 2020-12-17 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: onlyoffice_file_helper
|
@@ -53,20 +53,132 @@ dependencies:
|
|
53
53
|
- - "~>"
|
54
54
|
- !ruby/object:Gem::Version
|
55
55
|
version: '2'
|
56
|
+
- !ruby/object:Gem::Dependency
|
57
|
+
name: overcommit
|
58
|
+
requirement: !ruby/object:Gem::Requirement
|
59
|
+
requirements:
|
60
|
+
- - "~>"
|
61
|
+
- !ruby/object:Gem::Version
|
62
|
+
version: '0'
|
63
|
+
type: :development
|
64
|
+
prerelease: false
|
65
|
+
version_requirements: !ruby/object:Gem::Requirement
|
66
|
+
requirements:
|
67
|
+
- - "~>"
|
68
|
+
- !ruby/object:Gem::Version
|
69
|
+
version: '0'
|
56
70
|
- !ruby/object:Gem::Dependency
|
57
71
|
name: rake
|
58
72
|
requirement: !ruby/object:Gem::Requirement
|
59
73
|
requirements:
|
60
74
|
- - "~>"
|
61
75
|
- !ruby/object:Gem::Version
|
62
|
-
version: '13
|
76
|
+
version: '13'
|
77
|
+
type: :development
|
78
|
+
prerelease: false
|
79
|
+
version_requirements: !ruby/object:Gem::Requirement
|
80
|
+
requirements:
|
81
|
+
- - "~>"
|
82
|
+
- !ruby/object:Gem::Version
|
83
|
+
version: '13'
|
84
|
+
- !ruby/object:Gem::Dependency
|
85
|
+
name: rspec
|
86
|
+
requirement: !ruby/object:Gem::Requirement
|
87
|
+
requirements:
|
88
|
+
- - "~>"
|
89
|
+
- !ruby/object:Gem::Version
|
90
|
+
version: '3'
|
91
|
+
type: :development
|
92
|
+
prerelease: false
|
93
|
+
version_requirements: !ruby/object:Gem::Requirement
|
94
|
+
requirements:
|
95
|
+
- - "~>"
|
96
|
+
- !ruby/object:Gem::Version
|
97
|
+
version: '3'
|
98
|
+
- !ruby/object:Gem::Dependency
|
99
|
+
name: rubocop
|
100
|
+
requirement: !ruby/object:Gem::Requirement
|
101
|
+
requirements:
|
102
|
+
- - "~>"
|
103
|
+
- !ruby/object:Gem::Version
|
104
|
+
version: '1'
|
105
|
+
type: :development
|
106
|
+
prerelease: false
|
107
|
+
version_requirements: !ruby/object:Gem::Requirement
|
108
|
+
requirements:
|
109
|
+
- - "~>"
|
110
|
+
- !ruby/object:Gem::Version
|
111
|
+
version: '1'
|
112
|
+
- !ruby/object:Gem::Dependency
|
113
|
+
name: rubocop-performance
|
114
|
+
requirement: !ruby/object:Gem::Requirement
|
115
|
+
requirements:
|
116
|
+
- - "~>"
|
117
|
+
- !ruby/object:Gem::Version
|
118
|
+
version: '1'
|
119
|
+
type: :development
|
120
|
+
prerelease: false
|
121
|
+
version_requirements: !ruby/object:Gem::Requirement
|
122
|
+
requirements:
|
123
|
+
- - "~>"
|
124
|
+
- !ruby/object:Gem::Version
|
125
|
+
version: '1'
|
126
|
+
- !ruby/object:Gem::Dependency
|
127
|
+
name: rubocop-rake
|
128
|
+
requirement: !ruby/object:Gem::Requirement
|
129
|
+
requirements:
|
130
|
+
- - "~>"
|
131
|
+
- !ruby/object:Gem::Version
|
132
|
+
version: '0'
|
133
|
+
type: :development
|
134
|
+
prerelease: false
|
135
|
+
version_requirements: !ruby/object:Gem::Requirement
|
136
|
+
requirements:
|
137
|
+
- - "~>"
|
138
|
+
- !ruby/object:Gem::Version
|
139
|
+
version: '0'
|
140
|
+
- !ruby/object:Gem::Dependency
|
141
|
+
name: rubocop-rspec
|
142
|
+
requirement: !ruby/object:Gem::Requirement
|
143
|
+
requirements:
|
144
|
+
- - "~>"
|
145
|
+
- !ruby/object:Gem::Version
|
146
|
+
version: '2'
|
63
147
|
type: :development
|
64
148
|
prerelease: false
|
65
149
|
version_requirements: !ruby/object:Gem::Requirement
|
66
150
|
requirements:
|
67
151
|
- - "~>"
|
68
152
|
- !ruby/object:Gem::Version
|
69
|
-
version: '
|
153
|
+
version: '2'
|
154
|
+
- !ruby/object:Gem::Dependency
|
155
|
+
name: simplecov
|
156
|
+
requirement: !ruby/object:Gem::Requirement
|
157
|
+
requirements:
|
158
|
+
- - "~>"
|
159
|
+
- !ruby/object:Gem::Version
|
160
|
+
version: '0'
|
161
|
+
type: :development
|
162
|
+
prerelease: false
|
163
|
+
version_requirements: !ruby/object:Gem::Requirement
|
164
|
+
requirements:
|
165
|
+
- - "~>"
|
166
|
+
- !ruby/object:Gem::Version
|
167
|
+
version: '0'
|
168
|
+
- !ruby/object:Gem::Dependency
|
169
|
+
name: yard
|
170
|
+
requirement: !ruby/object:Gem::Requirement
|
171
|
+
requirements:
|
172
|
+
- - ">="
|
173
|
+
- !ruby/object:Gem::Version
|
174
|
+
version: 0.9.20
|
175
|
+
type: :development
|
176
|
+
prerelease: false
|
177
|
+
version_requirements: !ruby/object:Gem::Requirement
|
178
|
+
requirements:
|
179
|
+
- - ">="
|
180
|
+
- !ruby/object:Gem::Version
|
181
|
+
version: 0.9.20
|
70
182
|
description: Gem for static parsing of _rspec.rb files
|
71
183
|
email:
|
72
184
|
- shockwavenn@gmail.com
|
@@ -80,15 +192,15 @@ files:
|
|
80
192
|
- lib/onlyoffice_rspec_parser/spec_parsed.rb
|
81
193
|
- lib/onlyoffice_rspec_parser/spec_parsed/it_parsed.rb
|
82
194
|
- lib/onlyoffice_rspec_parser/version.rb
|
83
|
-
homepage: https://github.com/
|
195
|
+
homepage: https://github.com/ONLYOFFICE-QA/onlyoffice_rspec_parser
|
84
196
|
licenses:
|
85
197
|
- AGPL-3.0
|
86
198
|
metadata:
|
87
|
-
bug_tracker_uri: https://github.com/
|
88
|
-
changelog_uri: https://github.com/
|
199
|
+
bug_tracker_uri: https://github.com/ONLYOFFICE-QA/onlyoffice_rspec_parser/issues
|
200
|
+
changelog_uri: https://github.com/ONLYOFFICE-QA/onlyoffice_rspec_parser/blob/master/CHANGELOG.md
|
89
201
|
documentation_uri: https://www.rubydoc.info/gems/onlyoffice_rspec_parser
|
90
|
-
homepage_uri: https://github.com/
|
91
|
-
source_code_uri: https://github.com/
|
202
|
+
homepage_uri: https://github.com/ONLYOFFICE-QA/onlyoffice_rspec_parser
|
203
|
+
source_code_uri: https://github.com/ONLYOFFICE-QA/onlyoffice_rspec_parser
|
92
204
|
post_install_message:
|
93
205
|
rdoc_options: []
|
94
206
|
require_paths:
|
@@ -97,14 +209,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
97
209
|
requirements:
|
98
210
|
- - ">="
|
99
211
|
- !ruby/object:Gem::Version
|
100
|
-
version: '2.
|
212
|
+
version: '2.5'
|
101
213
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
102
214
|
requirements:
|
103
215
|
- - ">="
|
104
216
|
- !ruby/object:Gem::Version
|
105
217
|
version: '0'
|
106
218
|
requirements: []
|
107
|
-
rubygems_version: 3.1.
|
219
|
+
rubygems_version: 3.1.4
|
108
220
|
signing_key:
|
109
221
|
specification_version: 4
|
110
222
|
summary: Parse rspec
|