pdd 0.24.0 → 0.24.1

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.
Files changed (77) hide show
  1. checksums.yaml +4 -4
  2. data/.0pdd.yml +3 -0
  3. data/.github/workflows/actionlint.yml +25 -0
  4. data/.github/workflows/codecov.yml +12 -6
  5. data/.github/workflows/copyrights.yml +19 -0
  6. data/.github/workflows/markdown-lint.yml +19 -0
  7. data/.github/workflows/pdd.yml +6 -2
  8. data/.github/workflows/rake.yml +10 -5
  9. data/.github/workflows/reuse.yml +19 -0
  10. data/.github/workflows/typos.yml +19 -0
  11. data/.github/workflows/xcop.yml +6 -2
  12. data/.github/workflows/yamllint.yml +19 -0
  13. data/.gitignore +12 -5
  14. data/.markdownlint.yml +6 -0
  15. data/.pdd +0 -1
  16. data/.rubocop.yml +12 -2
  17. data/.rultor.yml +5 -1
  18. data/.simplecov +2 -19
  19. data/Gemfile +15 -30
  20. data/Gemfile.lock +173 -0
  21. data/LICENSE.txt +1 -1
  22. data/LICENSES/MIT.txt +21 -0
  23. data/README.md +76 -62
  24. data/REUSE.toml +43 -0
  25. data/Rakefile +4 -31
  26. data/assets/puzzles.xsd +3 -22
  27. data/assets/puzzles.xsl +3 -22
  28. data/assets/puzzles_json.xsl +4 -23
  29. data/bin/pdd +5 -20
  30. data/cucumber.yml +3 -0
  31. data/features/applies_rules.feature +2 -0
  32. data/features/avoiding_duplicates.feature +2 -0
  33. data/features/catches_broken_puzzles.feature +2 -0
  34. data/features/cli.feature +2 -0
  35. data/features/gem_package.feature +2 -0
  36. data/features/html_output.feature +2 -0
  37. data/features/json_output.feature +2 -0
  38. data/features/parsing.feature +2 -0
  39. data/features/rake.feature +2 -2
  40. data/features/remove.feature +2 -0
  41. data/features/step_definitions/steps.rb +2 -19
  42. data/features/support/env.rb +2 -19
  43. data/features/unicode.feature +2 -0
  44. data/features/uses_config.feature +2 -1
  45. data/lib/pdd/puzzle.rb +2 -19
  46. data/lib/pdd/rake_task.rb +3 -0
  47. data/lib/pdd/rule/duplicates.rb +2 -19
  48. data/lib/pdd/rule/estimates.rb +2 -19
  49. data/lib/pdd/rule/roles.rb +2 -19
  50. data/lib/pdd/rule/text.rb +2 -19
  51. data/lib/pdd/source.rb +2 -19
  52. data/lib/pdd/sources.rb +2 -19
  53. data/lib/pdd/version.rb +4 -21
  54. data/lib/pdd.rb +3 -20
  55. data/pdd.gemspec +8 -24
  56. data/test/test__helper.rb +23 -22
  57. data/test/test_duplicates.rb +5 -22
  58. data/test/test_estimates.rb +5 -22
  59. data/test/test_many.rb +3 -20
  60. data/test/test_pdd.rb +4 -21
  61. data/test/test_rake_task.rb +3 -0
  62. data/test/test_roles.rb +6 -23
  63. data/test/test_source.rb +14 -31
  64. data/test/test_source_todo.rb +3 -20
  65. data/test/test_sources.rb +4 -21
  66. data/test/test_text.rb +4 -21
  67. data/test_assets/aladdin.jpg +0 -0
  68. data/test_assets/elegant-objects.png +0 -0
  69. data/test_assets/puzzles/1-04e35eb3 +1 -1
  70. data/test_assets/puzzles/132-bc1dfafe +1 -1
  71. data/test_assets/puzzles/1425-59819ae3 +5 -5
  72. data/test_assets/puzzles/42-0d933cc0 +1 -1
  73. data/test_assets/puzzles/91-ecb9aa47 +1 -1
  74. data/test_assets/puzzles/93-641fe341 +1 -1
  75. data/utils/glob.rb +2 -19
  76. metadata +31 -11
  77. data/.overcommit.yml +0 -96
@@ -1,22 +1,5 @@
1
- # Copyright (c) 2014-2024 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.
1
+ # SPDX-FileCopyrightText: Copyright (c) 2014-2025 Yegor Bugayenko
2
+ # SPDX-License-Identifier: MIT
20
3
 
21
4
  require 'nokogiri'
22
5
  require 'tmpdir'
@@ -1,22 +1,5 @@
1
- # Copyright (c) 2014-2024 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.
1
+ # SPDX-FileCopyrightText: Copyright (c) 2014-2025 Yegor Bugayenko
2
+ # SPDX-License-Identifier: MIT
20
3
 
21
4
  require 'simplecov'
22
5
  require_relative '../../lib/pdd'
@@ -1,3 +1,5 @@
1
+ # SPDX-FileCopyrightText: Copyright (c) 2014-2025 Yegor Bugayenko
2
+ # SPDX-License-Identifier: MIT
1
3
  Feature: Unicode
2
4
  As a source code writer I want to be able to
3
5
  work with Unicode files
@@ -1,3 +1,5 @@
1
+ # SPDX-FileCopyrightText: Copyright (c) 2014-2025 Yegor Bugayenko
2
+ # SPDX-License-Identifier: MIT
1
3
  Feature: Using .pdd config file
2
4
  As a source code writer I want to be able to
3
5
  call PDD as a command line tool and configure
@@ -18,4 +20,3 @@ Feature: Using .pdd config file
18
20
  Then Exit code is zero
19
21
  And Stdout contains "Reading from root dir ."
20
22
  And XML file "out.xml" matches "/puzzles[count(puzzle)=1]"
21
-
data/lib/pdd/puzzle.rb CHANGED
@@ -1,22 +1,5 @@
1
- # Copyright (c) 2014-2024 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.
1
+ # SPDX-FileCopyrightText: Copyright (c) 2014-2025 Yegor Bugayenko
2
+ # SPDX-License-Identifier: MIT
20
3
 
21
4
  module PDD
22
5
  # Puzzle.
data/lib/pdd/rake_task.rb CHANGED
@@ -1,3 +1,6 @@
1
+ # SPDX-FileCopyrightText: Copyright (c) 2014-2025 Yegor Bugayenko
2
+ # SPDX-License-Identifier: MIT
3
+
1
4
  require 'rake'
2
5
  require 'rake/tasklib'
3
6
  require 'minitest/autorun'
@@ -1,22 +1,5 @@
1
- # Copyright (c) 2014-2024 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.
1
+ # SPDX-FileCopyrightText: Copyright (c) 2014-2025 Yegor Bugayenko
2
+ # SPDX-License-Identifier: MIT
20
3
 
21
4
  module PDD
22
5
  module Rule
@@ -1,22 +1,5 @@
1
- # Copyright (c) 2014-2024 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.
1
+ # SPDX-FileCopyrightText: Copyright (c) 2014-2025 Yegor Bugayenko
2
+ # SPDX-License-Identifier: MIT
20
3
 
21
4
  module PDD
22
5
  module Rule
@@ -1,22 +1,5 @@
1
- # Copyright (c) 2014-2024 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.
1
+ # SPDX-FileCopyrightText: Copyright (c) 2014-2025 Yegor Bugayenko
2
+ # SPDX-License-Identifier: MIT
20
3
 
21
4
  module PDD
22
5
  module Rule
data/lib/pdd/rule/text.rb CHANGED
@@ -1,22 +1,5 @@
1
- # Copyright (c) 2014-2024 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.
1
+ # SPDX-FileCopyrightText: Copyright (c) 2014-2025 Yegor Bugayenko
2
+ # SPDX-License-Identifier: MIT
20
3
 
21
4
  module PDD
22
5
  module Rule
data/lib/pdd/source.rb CHANGED
@@ -1,22 +1,5 @@
1
- # Copyright (c) 2014-2024 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.
1
+ # SPDX-FileCopyrightText: Copyright (c) 2014-2025 Yegor Bugayenko
2
+ # SPDX-License-Identifier: MIT
20
3
 
21
4
  require 'digest/md5'
22
5
  require 'net/http'
data/lib/pdd/sources.rb CHANGED
@@ -1,22 +1,5 @@
1
- # Copyright (c) 2014-2024 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.
1
+ # SPDX-FileCopyrightText: Copyright (c) 2014-2025 Yegor Bugayenko
2
+ # SPDX-License-Identifier: MIT
20
3
 
21
4
  require 'rainbow'
22
5
  require 'English'
data/lib/pdd/version.rb CHANGED
@@ -1,27 +1,10 @@
1
- # Copyright (c) 2014-2024 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.
1
+ # SPDX-FileCopyrightText: Copyright (c) 2014-2025 Yegor Bugayenko
2
+ # SPDX-License-Identifier: MIT
20
3
 
21
4
  # PDD main module.
22
5
  # Author:: Yegor Bugayenko (yegor256@gmail.com)
23
- # Copyright:: Copyright (c) 2014-2024 Yegor Bugayenko
6
+ # Copyright:: Copyright (c) 2014-2025 Yegor Bugayenko
24
7
  # License:: MIT
25
8
  module PDD
26
- VERSION = '0.24.0'.freeze
9
+ VERSION = '0.24.1'.freeze
27
10
  end
data/lib/pdd.rb CHANGED
@@ -1,22 +1,5 @@
1
- # Copyright (c) 2014-2024 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.
1
+ # SPDX-FileCopyrightText: Copyright (c) 2014-2025 Yegor Bugayenko
2
+ # SPDX-License-Identifier: MIT
20
3
 
21
4
  require 'nokogiri'
22
5
  require 'logger'
@@ -30,7 +13,7 @@ require_relative 'pdd/rule/roles'
30
13
 
31
14
  # PDD main module.
32
15
  # Author:: Yegor Bugayenko (yegor256@gmail.com)
33
- # Copyright:: Copyright (c) 2014-2024 Yegor Bugayenko
16
+ # Copyright:: Copyright (c) 2014-2025 Yegor Bugayenko
34
17
  # License:: MIT
35
18
  module PDD
36
19
  # If it breaks.
data/pdd.gemspec CHANGED
@@ -1,22 +1,5 @@
1
- # Copyright (c) 2014-2024 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 NONINFRINGEMENT. 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.
1
+ # SPDX-FileCopyrightText: Copyright (c) 2014-2025 Yegor Bugayenko
2
+ # SPDX-License-Identifier: MIT
20
3
 
21
4
  require 'English'
22
5
 
@@ -37,14 +20,15 @@ Gem::Specification.new do |s|
37
20
  s.description = 'Collects PDD puzzles from a source code base'
38
21
  s.authors = ['Yegor Bugayenko']
39
22
  s.email = 'yegor256@gmail.com'
40
- s.homepage = 'http://github.com/cqfn/pdd'
23
+ s.homepage = 'https://github.com/cqfn/pdd'
41
24
  s.files = `git ls-files`.split($RS)
42
25
  s.executables = s.files.grep(%r{^bin/}) { |f| File.basename(f) }
43
26
  s.rdoc_options = ['--charset=UTF-8']
44
27
  s.extra_rdoc_files = ['README.md', 'LICENSE.txt']
45
- s.add_runtime_dependency 'nokogiri', '~> 1.10'
46
- s.add_runtime_dependency 'rainbow', '~> 3.0'
47
- s.add_runtime_dependency 'ruby-filemagic', '~> 0.7.2'
48
- s.add_runtime_dependency 'slop', '~> 4.6'
28
+ s.add_dependency 'backtrace', '~>0.1'
29
+ s.add_dependency 'nokogiri', '~>1.10'
30
+ s.add_dependency 'rainbow', '~>3.0'
31
+ s.add_dependency 'ruby-filemagic', '~>0.7'
32
+ s.add_dependency 'slop', '~>4.6'
49
33
  s.metadata['rubygems_mfa_required'] = 'true'
50
34
  end
data/test/test__helper.rb CHANGED
@@ -1,32 +1,33 @@
1
- # Copyright (c) 2014-2024 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.
1
+ # SPDX-FileCopyrightText: Copyright (c) 2014-2025 Yegor Bugayenko
2
+ # SPDX-License-Identifier: MIT
20
3
 
21
4
  $stdout.sync = true
22
5
 
23
6
  require 'simplecov'
24
- SimpleCov.start
25
-
26
7
  require 'simplecov-cobertura'
27
- SimpleCov.formatter = SimpleCov::Formatter::CoberturaFormatter
8
+ unless SimpleCov.running
9
+ SimpleCov.command_name('test')
10
+ SimpleCov.formatter = SimpleCov::Formatter::MultiFormatter.new(
11
+ [
12
+ SimpleCov::Formatter::HTMLFormatter,
13
+ SimpleCov::Formatter::CoberturaFormatter
14
+ ]
15
+ )
16
+ SimpleCov.minimum_coverage 100
17
+ SimpleCov.minimum_coverage_by_file 100
18
+ SimpleCov.start do
19
+ add_filter 'test/'
20
+ add_filter 'vendor/'
21
+ add_filter 'target/'
22
+ track_files 'lib/**/*.rb'
23
+ track_files '*.rb'
24
+ end
25
+ end
28
26
 
29
27
  require 'minitest/autorun'
28
+ require 'minitest/reporters'
29
+ Minitest::Reporters.use! [Minitest::Reporters::SpecReporter.new]
30
+
30
31
  require_relative '../lib/pdd'
31
32
 
32
33
  def stub_source_find_github_user(file, path = '')
@@ -1,22 +1,5 @@
1
- # Copyright (c) 2014-2024 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.
1
+ # SPDX-FileCopyrightText: Copyright (c) 2014-2025 Yegor Bugayenko
2
+ # SPDX-License-Identifier: MIT
20
3
 
21
4
  require 'minitest/autorun'
22
5
  require 'nokogiri'
@@ -24,7 +7,7 @@ require_relative '../lib/pdd/rule/duplicates'
24
7
 
25
8
  # PDD::Rule::MaxDuplicates class test.
26
9
  # Author:: Yegor Bugayenko (yegor256@gmail.com)
27
- # Copyright:: Copyright (c) 2014-2024 Yegor Bugayenko
10
+ # Copyright:: Copyright (c) 2014-2025 Yegor Bugayenko
28
11
  # License:: MIT
29
12
  class TestMaxDuplicates < Minitest::Test
30
13
  def test_max_duplicates
@@ -34,7 +17,7 @@ class TestMaxDuplicates < Minitest::Test
34
17
  <puzzle><body>test</body></puzzle></puzzles>'
35
18
  ), 1
36
19
  )
37
- assert !rule.errors.empty?, 'why it is empty?'
20
+ refute_empty rule.errors, 'why it is empty?'
38
21
  end
39
22
 
40
23
  def test_max_duplicates_without_errors
@@ -43,6 +26,6 @@ class TestMaxDuplicates < Minitest::Test
43
26
  '<puzzles><puzzle><body>hello</body></puzzle></puzzles>'
44
27
  ), 1
45
28
  )
46
- assert rule.errors.empty?, 'it has to be empty!'
29
+ assert_empty rule.errors, 'it has to be empty!'
47
30
  end
48
31
  end
@@ -1,22 +1,5 @@
1
- # Copyright (c) 2014-2024 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.
1
+ # SPDX-FileCopyrightText: Copyright (c) 2014-2025 Yegor Bugayenko
2
+ # SPDX-License-Identifier: MIT
20
3
 
21
4
  require 'minitest/autorun'
22
5
  require 'nokogiri'
@@ -24,7 +7,7 @@ require_relative '../lib/pdd/rule/estimates'
24
7
 
25
8
  # PDD::Rule::Estimate module tests.
26
9
  # Author:: Yegor Bugayenko (yegor256@gmail.com)
27
- # Copyright:: Copyright (c) 2014-2024 Yegor Bugayenko
10
+ # Copyright:: Copyright (c) 2014-2025 Yegor Bugayenko
28
11
  # License:: MIT
29
12
  class TestEstimates < Minitest::Test
30
13
  def test_min
@@ -33,7 +16,7 @@ class TestEstimates < Minitest::Test
33
16
  '<puzzles><puzzle><estimate>15</estimate></puzzle></puzzles>'
34
17
  ), 30
35
18
  )
36
- assert !rule.errors.empty?, 'why it is empty?'
19
+ refute_empty rule.errors, 'why it is empty?'
37
20
  end
38
21
 
39
22
  def test_max
@@ -42,6 +25,6 @@ class TestEstimates < Minitest::Test
42
25
  '<puzzles><puzzle><estimate>30</estimate></puzzle></puzzles>'
43
26
  ), 15
44
27
  )
45
- assert !rule.errors.empty?, 'why it is empty?'
28
+ refute_empty rule.errors, 'why it is empty?'
46
29
  end
47
30
  end
data/test/test_many.rb CHANGED
@@ -1,22 +1,5 @@
1
- # Copyright (c) 2014-2024 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.
1
+ # SPDX-FileCopyrightText: Copyright (c) 2014-2025 Yegor Bugayenko
2
+ # SPDX-License-Identifier: MIT
20
3
 
21
4
  require 'minitest/autorun'
22
5
  require 'tmpdir'
@@ -25,7 +8,7 @@ require_relative '../lib/pdd/sources'
25
8
 
26
9
  # Test many puzzles to make sure their IDs are correct.
27
10
  # Author:: Yegor Bugayenko (yegor256@gmail.com)
28
- # Copyright:: Copyright (c) 2014-2024 Yegor Bugayenko
11
+ # Copyright:: Copyright (c) 2014-2025 Yegor Bugayenko
29
12
  # License:: MIT
30
13
  class TestMany < Minitest::Test
31
14
  def test_parsing
data/test/test_pdd.rb CHANGED
@@ -1,22 +1,5 @@
1
- # Copyright (c) 2014-2024 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.
1
+ # SPDX-FileCopyrightText: Copyright (c) 2014-2025 Yegor Bugayenko
2
+ # SPDX-License-Identifier: MIT
20
3
 
21
4
  require 'minitest/autorun'
22
5
  require 'nokogiri'
@@ -26,7 +9,7 @@ require_relative '../lib/pdd'
26
9
 
27
10
  # PDD main module test.
28
11
  # Author:: Yegor Bugayenko (yegor256@gmail.com)
29
- # Copyright:: Copyright (c) 2014-2024 Yegor Bugayenko
12
+ # Copyright:: Copyright (c) 2014-2025 Yegor Bugayenko
30
13
  # License:: MIT
31
14
  class TestPDD < Minitest::Test
32
15
  def test_basic
@@ -73,7 +56,7 @@ class TestPDD < Minitest::Test
73
56
  echo '\x40todo #1 this is some puzzle' > '.это файл.txt'
74
57
  cd ../..
75
58
  git add -f .
76
- git commit --quiet -am 'first version'
59
+ git commit --no-verify --quiet -am 'first version'
77
60
  ")
78
61
 
79
62
  matches(
@@ -1,3 +1,6 @@
1
+ # SPDX-FileCopyrightText: Copyright (c) 2014-2025 Yegor Bugayenko
2
+ # SPDX-License-Identifier: MIT
3
+
1
4
  require 'minitest/autorun'
2
5
  require 'tmpdir'
3
6
  require 'rake'