onlyoffice_rspec_parser 0.2.0 → 0.5.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 51d18f456879010c62bd1ae7cde93a75794edd15f0ceec7f13b868567f868d98
4
- data.tar.gz: 6b0bbe309f1a946074ab61a7a82d532b3749ee34c52bef94f5a18ed4a487c3e4
3
+ metadata.gz: 73dabe721557a00cbb116eba94a60b08193a53f13a4c661dba8e1b73d6edd2ed
4
+ data.tar.gz: 22b3cc26a9d9fb4be2d83bae3716dcb8ee7b5ad590333330b6c4dca7d2921c33
5
5
  SHA512:
6
- metadata.gz: a34f284d9930e0c6c0510fd1c0ac2f26247b3b46eaa8f0b0f93a6ff9d82fb332c6c013410479d11e9891cb4db7a03180b2a8790bb15c2dc04d534e50ea881aa5
7
- data.tar.gz: eaf8ebdf88a032da128c3d94aeb249172b6429007aff24cf63d09ff9e146094da98ed92109d6991c080fdb7f850afb41f85c2706b3db60795e08ff1ccf38bc30
6
+ metadata.gz: dd6ea64100b8b246ad20189470726b07f9af206675f9f660ba3926176ad63b390357cba233981fe703ebad373c3e67cb6e7724f6b5d0909fb6df85dd78ed5902
7
+ data.tar.gz: 8ed79ca3775a0d1eec460f3130e1cfea44a34ec649b9ba31af1f666cc1e272ce47c23d7d1bfee756f50319105f73aa0c49d7b8562081c8b771883bee0aa721c8
@@ -1,5 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
+ # Main namespace of gem
3
4
  module OnlyofficeRspecParser
5
+ # @return [String] name of gem
4
6
  NAME = 'onlyoffice_rspec_parser'
5
7
  end
@@ -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 [\'\"](.*)?[\'\"] do/.match?(line)
16
+ next unless /it ['"](.*)?['"] do/.match?(line)
14
17
 
15
- test_name = line.scan(/it [\'\"](.*?)[\'\"] do/)
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|
@@ -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?(/\:expect\)?\n/)
18
+ @node.children.last.to_s.match?(/:expect\)?\n/)
18
19
  end
19
20
  end
20
21
  end
@@ -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|
@@ -1,5 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module OnlyofficeRspecParser
4
- VERSION = '0.2.0'
4
+ # @return [String] version of gem
5
+ VERSION = '0.5.0'
5
6
  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.2.0
4
+ version: 0.5.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - ONLYOFFICE
@@ -9,22 +9,28 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2020-05-07 00:00:00.000000000 Z
12
+ date: 2022-08-10 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: onlyoffice_file_helper
16
16
  requirement: !ruby/object:Gem::Requirement
17
17
  requirements:
18
- - - "~>"
18
+ - - ">="
19
19
  - !ruby/object:Gem::Version
20
20
  version: '0.1'
21
+ - - "<"
22
+ - !ruby/object:Gem::Version
23
+ version: '2.0'
21
24
  type: :runtime
22
25
  prerelease: false
23
26
  version_requirements: !ruby/object:Gem::Requirement
24
27
  requirements:
25
- - - "~>"
28
+ - - ">="
26
29
  - !ruby/object:Gem::Version
27
30
  version: '0.1'
31
+ - - "<"
32
+ - !ruby/object:Gem::Version
33
+ version: '2.0'
28
34
  - !ruby/object:Gem::Dependency
29
35
  name: onlyoffice_logger_helper
30
36
  requirement: !ruby/object:Gem::Requirement
@@ -43,30 +49,148 @@ dependencies:
43
49
  name: parser
44
50
  requirement: !ruby/object:Gem::Requirement
45
51
  requirements:
46
- - - "~>"
52
+ - - ">="
47
53
  - !ruby/object:Gem::Version
48
54
  version: '2'
55
+ - - "<"
56
+ - !ruby/object:Gem::Version
57
+ version: '4'
49
58
  type: :runtime
50
59
  prerelease: false
51
60
  version_requirements: !ruby/object:Gem::Requirement
52
61
  requirements:
53
- - - "~>"
62
+ - - ">="
54
63
  - !ruby/object:Gem::Version
55
64
  version: '2'
65
+ - - "<"
66
+ - !ruby/object:Gem::Version
67
+ version: '4'
68
+ - !ruby/object:Gem::Dependency
69
+ name: overcommit
70
+ requirement: !ruby/object:Gem::Requirement
71
+ requirements:
72
+ - - "~>"
73
+ - !ruby/object:Gem::Version
74
+ version: '0'
75
+ type: :development
76
+ prerelease: false
77
+ version_requirements: !ruby/object:Gem::Requirement
78
+ requirements:
79
+ - - "~>"
80
+ - !ruby/object:Gem::Version
81
+ version: '0'
56
82
  - !ruby/object:Gem::Dependency
57
83
  name: rake
58
84
  requirement: !ruby/object:Gem::Requirement
59
85
  requirements:
60
86
  - - "~>"
61
87
  - !ruby/object:Gem::Version
62
- version: '13.0'
88
+ version: '13'
89
+ type: :development
90
+ prerelease: false
91
+ version_requirements: !ruby/object:Gem::Requirement
92
+ requirements:
93
+ - - "~>"
94
+ - !ruby/object:Gem::Version
95
+ version: '13'
96
+ - !ruby/object:Gem::Dependency
97
+ name: rspec
98
+ requirement: !ruby/object:Gem::Requirement
99
+ requirements:
100
+ - - "~>"
101
+ - !ruby/object:Gem::Version
102
+ version: '3'
103
+ type: :development
104
+ prerelease: false
105
+ version_requirements: !ruby/object:Gem::Requirement
106
+ requirements:
107
+ - - "~>"
108
+ - !ruby/object:Gem::Version
109
+ version: '3'
110
+ - !ruby/object:Gem::Dependency
111
+ name: rubocop
112
+ requirement: !ruby/object:Gem::Requirement
113
+ requirements:
114
+ - - "~>"
115
+ - !ruby/object:Gem::Version
116
+ version: '1'
117
+ type: :development
118
+ prerelease: false
119
+ version_requirements: !ruby/object:Gem::Requirement
120
+ requirements:
121
+ - - "~>"
122
+ - !ruby/object:Gem::Version
123
+ version: '1'
124
+ - !ruby/object:Gem::Dependency
125
+ name: rubocop-performance
126
+ requirement: !ruby/object:Gem::Requirement
127
+ requirements:
128
+ - - "~>"
129
+ - !ruby/object:Gem::Version
130
+ version: '1'
131
+ type: :development
132
+ prerelease: false
133
+ version_requirements: !ruby/object:Gem::Requirement
134
+ requirements:
135
+ - - "~>"
136
+ - !ruby/object:Gem::Version
137
+ version: '1'
138
+ - !ruby/object:Gem::Dependency
139
+ name: rubocop-rake
140
+ requirement: !ruby/object:Gem::Requirement
141
+ requirements:
142
+ - - "~>"
143
+ - !ruby/object:Gem::Version
144
+ version: '0'
145
+ type: :development
146
+ prerelease: false
147
+ version_requirements: !ruby/object:Gem::Requirement
148
+ requirements:
149
+ - - "~>"
150
+ - !ruby/object:Gem::Version
151
+ version: '0'
152
+ - !ruby/object:Gem::Dependency
153
+ name: rubocop-rspec
154
+ requirement: !ruby/object:Gem::Requirement
155
+ requirements:
156
+ - - "~>"
157
+ - !ruby/object:Gem::Version
158
+ version: '2'
63
159
  type: :development
64
160
  prerelease: false
65
161
  version_requirements: !ruby/object:Gem::Requirement
66
162
  requirements:
67
163
  - - "~>"
68
164
  - !ruby/object:Gem::Version
69
- version: '13.0'
165
+ version: '2'
166
+ - !ruby/object:Gem::Dependency
167
+ name: simplecov
168
+ requirement: !ruby/object:Gem::Requirement
169
+ requirements:
170
+ - - "~>"
171
+ - !ruby/object:Gem::Version
172
+ version: '0'
173
+ type: :development
174
+ prerelease: false
175
+ version_requirements: !ruby/object:Gem::Requirement
176
+ requirements:
177
+ - - "~>"
178
+ - !ruby/object:Gem::Version
179
+ version: '0'
180
+ - !ruby/object:Gem::Dependency
181
+ name: yard
182
+ requirement: !ruby/object:Gem::Requirement
183
+ requirements:
184
+ - - ">="
185
+ - !ruby/object:Gem::Version
186
+ version: 0.9.20
187
+ type: :development
188
+ prerelease: false
189
+ version_requirements: !ruby/object:Gem::Requirement
190
+ requirements:
191
+ - - ">="
192
+ - !ruby/object:Gem::Version
193
+ version: 0.9.20
70
194
  description: Gem for static parsing of _rspec.rb files
71
195
  email:
72
196
  - shockwavenn@gmail.com
@@ -80,15 +204,16 @@ files:
80
204
  - lib/onlyoffice_rspec_parser/spec_parsed.rb
81
205
  - lib/onlyoffice_rspec_parser/spec_parsed/it_parsed.rb
82
206
  - lib/onlyoffice_rspec_parser/version.rb
83
- homepage: https://github.com/onlyoffice-testing-robot/onlyoffice_rspec_parser
207
+ homepage: https://github.com/ONLYOFFICE-QA/onlyoffice_rspec_parser
84
208
  licenses:
85
209
  - AGPL-3.0
86
210
  metadata:
87
- bug_tracker_uri: https://github.com/onlyoffice-testing-robot/onlyoffice_rspec_parser/issues
88
- changelog_uri: https://github.com/onlyoffice-testing-robot/onlyoffice_rspec_parser/blob/master/CHANGELOG.md
211
+ bug_tracker_uri: https://github.com/ONLYOFFICE-QA/onlyoffice_rspec_parser/issues
212
+ changelog_uri: https://github.com/ONLYOFFICE-QA/onlyoffice_rspec_parser/blob/master/CHANGELOG.md
89
213
  documentation_uri: https://www.rubydoc.info/gems/onlyoffice_rspec_parser
90
- homepage_uri: https://github.com/onlyoffice-testing-robot/onlyoffice_rspec_parser
91
- source_code_uri: https://github.com/onlyoffice-testing-robot/onlyoffice_rspec_parser
214
+ homepage_uri: https://github.com/ONLYOFFICE-QA/onlyoffice_rspec_parser
215
+ source_code_uri: https://github.com/ONLYOFFICE-QA/onlyoffice_rspec_parser
216
+ rubygems_mfa_required: 'true'
92
217
  post_install_message:
93
218
  rdoc_options: []
94
219
  require_paths:
@@ -97,14 +222,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
97
222
  requirements:
98
223
  - - ">="
99
224
  - !ruby/object:Gem::Version
100
- version: '2.4'
225
+ version: '2.7'
101
226
  required_rubygems_version: !ruby/object:Gem::Requirement
102
227
  requirements:
103
228
  - - ">="
104
229
  - !ruby/object:Gem::Version
105
230
  version: '0'
106
231
  requirements: []
107
- rubygems_version: 3.1.2
232
+ rubygems_version: 3.3.20
108
233
  signing_key:
109
234
  specification_version: 4
110
235
  summary: Parse rspec