pdd 0.20.4 → 0.20.8

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.
data/test/test_sources.rb CHANGED
@@ -1,4 +1,4 @@
1
- # Copyright (c) 2014-2018 Yegor Bugayenko
1
+ # Copyright (c) 2014-2021 Yegor Bugayenko
2
2
  #
3
3
  # Permission is hereby granted, free of charge, to any person obtaining a copy
4
4
  # of this software and associated documentation files (the 'Software'), to deal
@@ -26,7 +26,7 @@ require_relative '../lib/pdd/sources'
26
26
 
27
27
  # Sources test.
28
28
  # Author:: Yegor Bugayenko (yegor256@gmail.com)
29
- # Copyright:: Copyright (c) 2014-2018 Yegor Bugayenko
29
+ # Copyright:: Copyright (c) 2014-2021 Yegor Bugayenko
30
30
  # License:: MIT
31
31
  class TestSources < Minitest::Test
32
32
  def test_iterator
@@ -89,6 +89,22 @@ class TestSources < Minitest::Test
89
89
  end
90
90
  end
91
91
 
92
+ def test_includes_by_pattern
93
+ in_temp(['a/first.txt', 'b/c/d/second.txt']) do |dir|
94
+ list = PDD::Sources.new(dir).include('b/c/d/second.txt').fetch
95
+ assert_equal 2, list.size
96
+ end
97
+ end
98
+
99
+ def test_includes_recursively
100
+ in_temp(['a/first.txt', 'b/c/second.txt', 'b/c/d/third.txt']) do |dir|
101
+ sources = PDD::Sources.new(dir).exclude('b/c/**')
102
+ sources.include('b/c/d/third.txt')
103
+ list = sources.fetch
104
+ assert_equal 2, list.size
105
+ end
106
+ end
107
+
92
108
  def test_fails_with_verbose_output
93
109
  in_temp do |dir|
94
110
  File.write(File.join(dir, 'z1.txt'), "\x40todobroken\n")
data/test/test_text.rb CHANGED
@@ -1,4 +1,4 @@
1
- # Copyright (c) 2014-2018 Yegor Bugayenko
1
+ # Copyright (c) 2014-2021 Yegor Bugayenko
2
2
  #
3
3
  # Permission is hereby granted, free of charge, to any person obtaining a copy
4
4
  # of this software and associated documentation files (the 'Software'), to deal
@@ -24,7 +24,7 @@ require_relative '../lib/pdd/rule/text'
24
24
 
25
25
  # PDD::Rule::Text module tests.
26
26
  # Author:: Yegor Bugayenko (yegor256@gmail.com)
27
- # Copyright:: Copyright (c) 2014-2018 Yegor Bugayenko
27
+ # Copyright:: Copyright (c) 2014-2021 Yegor Bugayenko
28
28
  # License:: MIT
29
29
  class TestText < Minitest::Test
30
30
  def test_min_words
data/utils/glob.rb ADDED
@@ -0,0 +1,67 @@
1
+ # Copyright (c) 2014-2021 Yegor Bugayenko
2
+ #
3
+ # Permission is hereby granted, free of charge, to any person obtaining a copy
4
+ # of this software and associated documentation files (the 'Software'), to deal
5
+ # in the Software without restriction, including without limitation the rights
6
+ # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
7
+ # copies of the Software, and to permit persons to whom the Software is
8
+ # furnished to do so, subject to the following conditions:
9
+ #
10
+ # The above copyright notice and this permission notice shall be included in all
11
+ # copies or substantial portions of the Software.
12
+ #
13
+ # THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14
+ # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15
+ # FITNESS FOR A PARTICULAR PURPOSE AND NONINFINGEMENT. IN NO EVENT SHALL THE
16
+ # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17
+ # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
18
+ # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
19
+ # SOFTWARE.
20
+
21
+ # Utility glob class
22
+ class Glob
23
+ NO_LEADING_DOT = '(?=[^\.])'.freeze
24
+
25
+ def initialize(glob_string)
26
+ @glob_string = glob_string
27
+ end
28
+
29
+ # rubocop:disable Metrics/CyclomaticComplexity
30
+ # rubocop:disable Metrics/MethodLength
31
+ def to_regexp
32
+ chars = @glob_string.gsub(%r{(\*\*\/\*)|(\*\*)}, '*').split('')
33
+ in_curlies = 0, escaping = false
34
+ chars.map do |char|
35
+ if escaping
36
+ escaping = false
37
+ return char
38
+ end
39
+ case char
40
+ when '*'
41
+ '.*'
42
+ when '?'
43
+ '.'
44
+ when '.'
45
+ '\\.'
46
+ when '{'
47
+ in_curlies += 1
48
+ '('
49
+ when '}'
50
+ if in_curlies.positive?
51
+ in_curlies -= 1
52
+ return ')'
53
+ end
54
+ return char
55
+ when ','
56
+ in_curlies.positive? ? '|' : char
57
+ when '\\'
58
+ escaping = true
59
+ '\\'
60
+ else
61
+ char
62
+ end
63
+ end.join
64
+ end
65
+ # rubocop:enable Metrics/CyclomaticComplexity
66
+ # rubocop:enable Metrics/MethodLength
67
+ end
metadata CHANGED
@@ -1,29 +1,29 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: pdd
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.20.4
4
+ version: 0.20.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - Yegor Bugayenko
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-12-25 00:00:00.000000000 Z
11
+ date: 2021-12-17 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: nokogiri
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - '='
17
+ - - "~>"
18
18
  - !ruby/object:Gem::Version
19
- version: 1.8.2
19
+ version: '1.10'
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
- - - '='
24
+ - - "~>"
25
25
  - !ruby/object:Gem::Version
26
- version: 1.8.2
26
+ version: '1.10'
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: rainbow
29
29
  requirement: !ruby/object:Gem::Requirement
@@ -42,30 +42,44 @@ dependencies:
42
42
  name: slop
43
43
  requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
- - - '='
45
+ - - "~>"
46
46
  - !ruby/object:Gem::Version
47
- version: 4.6.1
47
+ version: '4.6'
48
48
  type: :runtime
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
- - - '='
52
+ - - "~>"
53
+ - !ruby/object:Gem::Version
54
+ version: '4.6'
55
+ - !ruby/object:Gem::Dependency
56
+ name: aruba
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - "~>"
60
+ - !ruby/object:Gem::Version
61
+ version: 0.14.1
62
+ type: :development
63
+ prerelease: false
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - "~>"
53
67
  - !ruby/object:Gem::Version
54
- version: 4.6.1
68
+ version: 0.14.1
55
69
  - !ruby/object:Gem::Dependency
56
70
  name: codecov
57
71
  requirement: !ruby/object:Gem::Requirement
58
72
  requirements:
59
73
  - - '='
60
74
  - !ruby/object:Gem::Version
61
- version: 0.1.10
75
+ version: 0.2.12
62
76
  type: :development
63
77
  prerelease: false
64
78
  version_requirements: !ruby/object:Gem::Requirement
65
79
  requirements:
66
80
  - - '='
67
81
  - !ruby/object:Gem::Version
68
- version: 0.1.10
82
+ version: 0.2.12
69
83
  - !ruby/object:Gem::Dependency
70
84
  name: cucumber
71
85
  requirement: !ruby/object:Gem::Requirement
@@ -164,6 +178,20 @@ dependencies:
164
178
  - - '='
165
179
  - !ruby/object:Gem::Version
166
180
  version: 1.15.1
181
+ - !ruby/object:Gem::Dependency
182
+ name: slop
183
+ requirement: !ruby/object:Gem::Requirement
184
+ requirements:
185
+ - - '='
186
+ - !ruby/object:Gem::Version
187
+ version: 4.9.1
188
+ type: :development
189
+ prerelease: false
190
+ version_requirements: !ruby/object:Gem::Requirement
191
+ requirements:
192
+ - - '='
193
+ - !ruby/object:Gem::Version
194
+ version: 4.9.1
167
195
  - !ruby/object:Gem::Dependency
168
196
  name: xcop
169
197
  requirement: !ruby/object:Gem::Requirement
@@ -192,6 +220,7 @@ files:
192
220
  - ".github/ISSUE_TEMPLATE.md"
193
221
  - ".github/PULL_REQUEST_TEMPLATE.md"
194
222
  - ".gitignore"
223
+ - ".overcommit.yml"
195
224
  - ".pdd"
196
225
  - ".rubocop.yml"
197
226
  - ".rultor.yml"
@@ -213,12 +242,14 @@ files:
213
242
  - features/gem_package.feature
214
243
  - features/html_output.feature
215
244
  - features/parsing.feature
245
+ - features/rake.feature
216
246
  - features/step_definitions/steps.rb
217
247
  - features/support/env.rb
218
248
  - features/unicode.feature
219
249
  - features/uses_config.feature
220
250
  - lib/pdd.rb
221
251
  - lib/pdd/puzzle.rb
252
+ - lib/pdd/rake_task.rb
222
253
  - lib/pdd/rule/duplicates.rb
223
254
  - lib/pdd/rule/estimates.rb
224
255
  - lib/pdd/rule/roles.rb
@@ -231,6 +262,7 @@ files:
231
262
  - test/test_duplicates.rb
232
263
  - test/test_estimates.rb
233
264
  - test/test_pdd.rb
265
+ - test/test_rake_task.rb
234
266
  - test/test_roles.rb
235
267
  - test/test_source.rb
236
268
  - test/test_source_todo.rb
@@ -241,7 +273,8 @@ files:
241
273
  - test_assets/cambria.woff
242
274
  - test_assets/elegant-objects.png
243
275
  - test_assets/favicon.ico
244
- homepage: http://github.com/yegor256/pdd
276
+ - utils/glob.rb
277
+ homepage: http://github.com/cqfn/pdd
245
278
  licenses:
246
279
  - MIT
247
280
  metadata: {}
@@ -252,17 +285,16 @@ require_paths:
252
285
  - lib
253
286
  required_ruby_version: !ruby/object:Gem::Requirement
254
287
  requirements:
255
- - - ">="
288
+ - - "~>"
256
289
  - !ruby/object:Gem::Version
257
- version: '2.2'
290
+ version: '2.3'
258
291
  required_rubygems_version: !ruby/object:Gem::Requirement
259
292
  requirements:
260
293
  - - ">="
261
294
  - !ruby/object:Gem::Version
262
295
  version: '0'
263
296
  requirements: []
264
- rubyforge_project:
265
- rubygems_version: 2.7.6
297
+ rubygems_version: 3.1.2
266
298
  signing_key:
267
299
  specification_version: 2
268
300
  summary: Puzzle Driven Development collector
@@ -274,6 +306,7 @@ test_files:
274
306
  - features/gem_package.feature
275
307
  - features/html_output.feature
276
308
  - features/parsing.feature
309
+ - features/rake.feature
277
310
  - features/step_definitions/steps.rb
278
311
  - features/support/env.rb
279
312
  - features/unicode.feature
@@ -282,6 +315,7 @@ test_files:
282
315
  - test/test_duplicates.rb
283
316
  - test/test_estimates.rb
284
317
  - test/test_pdd.rb
318
+ - test/test_rake_task.rb
285
319
  - test/test_roles.rb
286
320
  - test/test_source.rb
287
321
  - test/test_source_todo.rb