pdd 0.24.0 → 0.24.2

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 (71) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile +17 -30
  3. data/Gemfile.lock +194 -0
  4. data/LICENSE.txt +1 -1
  5. data/LICENSES/MIT.txt +21 -0
  6. data/README.md +99 -100
  7. data/REUSE.toml +41 -0
  8. data/Rakefile +4 -31
  9. data/assets/puzzles.xsd +3 -22
  10. data/assets/puzzles.xsl +3 -22
  11. data/assets/puzzles_json.xsl +4 -23
  12. data/bin/pdd +6 -22
  13. data/cucumber.yml +3 -0
  14. data/features/applies_rules.feature +2 -0
  15. data/features/avoiding_duplicates.feature +2 -0
  16. data/features/catches_broken_puzzles.feature +2 -0
  17. data/features/cli.feature +2 -0
  18. data/features/gem_package.feature +2 -0
  19. data/features/html_output.feature +2 -0
  20. data/features/json_output.feature +2 -0
  21. data/features/parsing.feature +2 -0
  22. data/features/rake.feature +2 -2
  23. data/features/remove.feature +3 -0
  24. data/features/step_definitions/steps.rb +2 -19
  25. data/features/support/env.rb +2 -19
  26. data/features/unicode.feature +2 -0
  27. data/features/uses_config.feature +2 -1
  28. data/lib/pdd/puzzle.rb +2 -19
  29. data/lib/pdd/rake_task.rb +3 -1
  30. data/lib/pdd/rule/duplicates.rb +2 -19
  31. data/lib/pdd/rule/estimates.rb +2 -19
  32. data/lib/pdd/rule/roles.rb +2 -19
  33. data/lib/pdd/rule/text.rb +2 -19
  34. data/lib/pdd/source.rb +2 -19
  35. data/lib/pdd/sources.rb +2 -19
  36. data/lib/pdd/version.rb +4 -21
  37. data/lib/pdd.rb +3 -20
  38. data/pdd.gemspec +9 -25
  39. data/test_assets/aladdin.jpg +0 -0
  40. data/test_assets/elegant-objects.png +0 -0
  41. data/test_assets/puzzles/1-04e35eb3 +1 -1
  42. data/test_assets/puzzles/132-bc1dfafe +1 -1
  43. data/test_assets/puzzles/1425-59819ae3 +5 -5
  44. data/test_assets/puzzles/42-0d933cc0 +1 -1
  45. data/test_assets/puzzles/91-ecb9aa47 +1 -1
  46. data/test_assets/puzzles/93-641fe341 +1 -1
  47. data/utils/glob.rb +2 -19
  48. metadata +24 -33
  49. data/.0pdd.yml +0 -9
  50. data/.gitattributes +0 -12
  51. data/.github/workflows/codecov.yml +0 -23
  52. data/.github/workflows/pdd.yml +0 -15
  53. data/.github/workflows/rake.yml +0 -24
  54. data/.github/workflows/xcop.yml +0 -15
  55. data/.gitignore +0 -8
  56. data/.overcommit.yml +0 -96
  57. data/.pdd +0 -27
  58. data/.rubocop.yml +0 -32
  59. data/.rultor.yml +0 -22
  60. data/.simplecov +0 -35
  61. data/test/test__helper.rb +0 -43
  62. data/test/test_duplicates.rb +0 -48
  63. data/test/test_estimates.rb +0 -47
  64. data/test/test_many.rb +0 -42
  65. data/test/test_pdd.rb +0 -111
  66. data/test/test_rake_task.rb +0 -18
  67. data/test/test_roles.rb +0 -56
  68. data/test/test_source.rb +0 -396
  69. data/test/test_source_todo.rb +0 -295
  70. data/test/test_sources.rb +0 -137
  71. data/test/test_text.rb +0 -39
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-2026 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-2026 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-2026 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'
41
- s.files = `git ls-files`.split($RS)
23
+ s.homepage = 'https://github.com/cqfn/pdd'
24
+ s.files = `git ls-files | grep -v -E '^(test/|\\.|renovate)'`.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
Binary file
Binary file
@@ -1,3 +1,3 @@
1
1
  /**
2
2
  * @todo #1:30min How are you?
3
- */
3
+ */
@@ -5,4 +5,4 @@
5
5
  // @comment This is not a puzzle,
6
6
  // but another bloc of text
7
7
  //
8
- //
8
+ //
@@ -1,9 +1,9 @@
1
1
  /**
2
2
  *
3
3
  *
4
- * @todo #1425:30min Continue replacing usage of MatcherAssert.assertThat with
5
- * Assertion from cactoos-matchers. Keep PR short and limit the changes to
6
- * single package. Update this puzzle for the next package.
7
- * After all packages are done, add MatcherAssert to forbidden-apis.txt
4
+ * @todo #1425:30min Continue replacing usage of MatcherAssert.assertThat with
5
+ * Assertion from cactoos-matchers. Keep PR short and limit the changes to
6
+ * single package. Update this puzzle for the next package.
7
+ * After all packages are done, add MatcherAssert to forbidden-apis.txt
8
8
  *
9
- */
9
+ */
@@ -4,4 +4,4 @@
4
4
  # well formatted...
5
5
  #
6
6
  #
7
- #
7
+ #
@@ -6,4 +6,4 @@
6
6
  # Even though
7
7
  # It's weird
8
8
 
9
- # Here is the text after
9
+ # Here is the text after
@@ -1,4 +1,4 @@
1
1
  #
2
2
  # @todo #93:30min This puzzle is very simple. It is indented right by more spaces than the other text.
3
3
  # This is the other text here,
4
- # which doesn't belong to the puzzle
4
+ # which doesn't belong to the puzzle
data/utils/glob.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-2026 Yegor Bugayenko
2
+ # SPDX-License-Identifier: MIT
20
3
 
21
4
  # Utility glob class
22
5
  class Glob
metadata CHANGED
@@ -1,15 +1,28 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: pdd
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.24.0
4
+ version: 0.24.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Yegor Bugayenko
8
- autorequire:
9
8
  bindir: bin
10
9
  cert_chain: []
11
- date: 2024-02-09 00:00:00.000000000 Z
10
+ date: 1980-01-02 00:00:00.000000000 Z
12
11
  dependencies:
12
+ - !ruby/object:Gem::Dependency
13
+ name: backtrace
14
+ requirement: !ruby/object:Gem::Requirement
15
+ requirements:
16
+ - - "~>"
17
+ - !ruby/object:Gem::Version
18
+ version: '0.1'
19
+ type: :runtime
20
+ prerelease: false
21
+ version_requirements: !ruby/object:Gem::Requirement
22
+ requirements:
23
+ - - "~>"
24
+ - !ruby/object:Gem::Version
25
+ version: '0.1'
13
26
  - !ruby/object:Gem::Dependency
14
27
  name: nokogiri
15
28
  requirement: !ruby/object:Gem::Requirement
@@ -44,14 +57,14 @@ dependencies:
44
57
  requirements:
45
58
  - - "~>"
46
59
  - !ruby/object:Gem::Version
47
- version: 0.7.2
60
+ version: '0.7'
48
61
  type: :runtime
49
62
  prerelease: false
50
63
  version_requirements: !ruby/object:Gem::Requirement
51
64
  requirements:
52
65
  - - "~>"
53
66
  - !ruby/object:Gem::Version
54
- version: 0.7.2
67
+ version: '0.7'
55
68
  - !ruby/object:Gem::Dependency
56
69
  name: slop
57
70
  requirement: !ruby/object:Gem::Requirement
@@ -72,25 +85,16 @@ executables:
72
85
  - pdd
73
86
  extensions: []
74
87
  extra_rdoc_files:
75
- - README.md
76
88
  - LICENSE.txt
89
+ - README.md
77
90
  files:
78
- - ".0pdd.yml"
79
- - ".gitattributes"
80
- - ".github/workflows/codecov.yml"
81
- - ".github/workflows/pdd.yml"
82
- - ".github/workflows/rake.yml"
83
- - ".github/workflows/xcop.yml"
84
- - ".gitignore"
85
- - ".overcommit.yml"
86
- - ".pdd"
87
- - ".rubocop.yml"
88
- - ".rultor.yml"
89
- - ".simplecov"
90
91
  - CITATION.cff
91
92
  - Gemfile
93
+ - Gemfile.lock
92
94
  - LICENSE.txt
95
+ - LICENSES/MIT.txt
93
96
  - README.md
97
+ - REUSE.toml
94
98
  - Rakefile
95
99
  - assets/puzzles.xsd
96
100
  - assets/puzzles.xsl
@@ -122,17 +126,6 @@ files:
122
126
  - lib/pdd/sources.rb
123
127
  - lib/pdd/version.rb
124
128
  - pdd.gemspec
125
- - test/test__helper.rb
126
- - test/test_duplicates.rb
127
- - test/test_estimates.rb
128
- - test/test_many.rb
129
- - test/test_pdd.rb
130
- - test/test_rake_task.rb
131
- - test/test_roles.rb
132
- - test/test_source.rb
133
- - test/test_source_todo.rb
134
- - test/test_sources.rb
135
- - test/test_text.rb
136
129
  - test_assets/aladdin.jpg
137
130
  - test_assets/article.pdf
138
131
  - test_assets/cambria.woff
@@ -148,12 +141,11 @@ files:
148
141
  - test_assets/puzzles/91-ecb9aa47
149
142
  - test_assets/puzzles/93-641fe341
150
143
  - utils/glob.rb
151
- homepage: http://github.com/cqfn/pdd
144
+ homepage: https://github.com/cqfn/pdd
152
145
  licenses:
153
146
  - MIT
154
147
  metadata:
155
148
  rubygems_mfa_required: 'true'
156
- post_install_message:
157
149
  rdoc_options:
158
150
  - "--charset=UTF-8"
159
151
  require_paths:
@@ -169,8 +161,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
169
161
  - !ruby/object:Gem::Version
170
162
  version: '0'
171
163
  requirements: []
172
- rubygems_version: 3.4.10
173
- signing_key:
164
+ rubygems_version: 3.6.9
174
165
  specification_version: 4
175
166
  summary: Puzzle Driven Development collector
176
167
  test_files: []
data/.0pdd.yml DELETED
@@ -1,9 +0,0 @@
1
- errors:
2
- - yegor256@gmail.com
3
- # alerts:
4
- # github:
5
- # - yegor256
6
-
7
- tags:
8
- - pdd
9
- - bug
data/.gitattributes DELETED
@@ -1,12 +0,0 @@
1
- # Check out all text files in UNIX format, with LF as end of line
2
- # Don't change this file. If you have any ideas about it, please
3
- # submit a separate issue about it and we'll discuss.
4
-
5
- * text=auto eol=lf
6
- *.java ident
7
- *.xml ident
8
- *.jpg binary
9
- *.png binary
10
- *.pdf binary
11
- *.woff binary
12
- *.ico binary
@@ -1,23 +0,0 @@
1
- ---
2
- name: codecov
3
- on:
4
- push:
5
- branches:
6
- - master
7
- pull_request:
8
- branches:
9
- - master
10
- jobs:
11
- codecov:
12
- runs-on: ubuntu-22.04
13
- steps:
14
- - uses: actions/checkout@v4
15
- - uses: ruby/setup-ruby@v1
16
- with:
17
- ruby-version: '2.7'
18
- - run: bundle update
19
- - run: bundle exec rake
20
- - uses: codecov/codecov-action@v4
21
- with:
22
- token: ${{ secrets.CODECOV_TOKEN }}
23
- fail_ci_if_error: true
@@ -1,15 +0,0 @@
1
- ---
2
- name: pdd
3
- on:
4
- push:
5
- branches:
6
- - master
7
- pull_request:
8
- branches:
9
- - master
10
- jobs:
11
- pdd:
12
- runs-on: ubuntu-22.04
13
- steps:
14
- - uses: actions/checkout@v4
15
- - uses: volodya-lombrozo/pdd-action@master
@@ -1,24 +0,0 @@
1
- ---
2
- name: rake
3
- on:
4
- push:
5
- branches:
6
- - master
7
- pull_request:
8
- branches:
9
- - master
10
- jobs:
11
- rake:
12
- name: rake
13
- strategy:
14
- matrix:
15
- os: [ubuntu-20.04]
16
- ruby: ['2.7', '3.0']
17
- runs-on: ${{ matrix.os }}
18
- steps:
19
- - uses: actions/checkout@v4
20
- - uses: ruby/setup-ruby@v1
21
- with:
22
- ruby-version: ${{ matrix.ruby }}
23
- - run: bundle update
24
- - run: bundle exec rake
@@ -1,15 +0,0 @@
1
- ---
2
- name: xcop
3
- "on":
4
- push:
5
- branches:
6
- - master
7
- pull_request:
8
- branches:
9
- - master
10
- jobs:
11
- xcop:
12
- runs-on: ubuntu-20.04
13
- steps:
14
- - uses: actions/checkout@v2
15
- - uses: g4s8/xcop-action@master
data/.gitignore DELETED
@@ -1,8 +0,0 @@
1
- coverage/**/*
2
- Gemfile.lock
3
- .idea/**/*
4
- *.gem
5
- .bundle/**/*
6
- .DS_Store
7
- rdoc/**/*
8
- tmp/**/*
data/.overcommit.yml DELETED
@@ -1,96 +0,0 @@
1
- # Use this file to configure the Overcommit hooks you wish to use. This will
2
- # extend the default configuration defined in:
3
- # https://github.com/sds/overcommit/blob/master/config/default.yml
4
- #
5
- # At the topmost level of this YAML file is a key representing type of hook
6
- # being run (e.g. pre-commit, commit-msg, etc.). Within each type you can
7
- # customize each hook, such as whether to only run it on certain files (via
8
- # `include`), whether to only display output if it fails (via `quiet`), etc.
9
- #
10
- # For a complete list of hooks, see:
11
- # https://github.com/sds/overcommit/tree/master/lib/overcommit/hook
12
- #
13
- # For a complete list of options that you can use to customize hooks, see:
14
- # https://github.com/sds/overcommit#configuration
15
-
16
- PreCommit:
17
- ALL:
18
- problem_on_unmodified_line: report
19
- requires_files: true
20
- required: false
21
- quiet: false
22
-
23
- AuthorEmail:
24
- enabled: true
25
- description: 'Check author email'
26
- requires_files: false
27
- required: true
28
- quiet: true
29
- pattern: '^[^@]+@.*$'
30
-
31
- AuthorName:
32
- enabled: true
33
- description: 'Check for author name'
34
- requires_files: false
35
- required: true
36
- quiet: true
37
-
38
- BundleCheck:
39
- enabled: true
40
- description: 'Check Gemfile dependencies'
41
- required_executable: 'bundle'
42
- flags: ['check']
43
- include:
44
- - 'Gemfile'
45
- - 'Gemfile.lock'
46
- - '*.gemspec'
47
-
48
- BundleOutdated:
49
- enabled: true
50
- description: 'List installed gems with newer versions available'
51
- required_executable: 'bundle'
52
- flags: ['outdated', '--strict', '--parseable']
53
-
54
- RuboCop:
55
- enabled: true
56
- description: 'Analyze with RuboCop'
57
- required_executable: 'bundle'
58
- flags: ['exec', 'rubocop']
59
-
60
- # Hooks that are run against every commit message after a user has written it.
61
- # These hooks are useful for enforcing policies on commit messages written for a
62
- # project.
63
- CommitMsg:
64
- ALL:
65
- requires_files: false
66
- quiet: false
67
-
68
- EmptyMessage:
69
- enabled: true
70
- description: 'Check for empty commit message'
71
- quiet: true
72
-
73
- MessageFormat:
74
- enabled: true
75
- description: 'Check commit message matches expected pattern'
76
- pattern: '(\[#)(.+)(\]\s)(.+)'
77
- expected_pattern_message: '[#<Issue Id>] <Commit Message Description>'
78
- sample_message: '[#167] Refactored onboarding flow'
79
-
80
- PrePush:
81
- ALL:
82
- requires_files: false
83
- required: false
84
- quiet: false
85
-
86
- RakeTarget:
87
- enabled: true
88
- quite: true
89
- description: 'Run rake targets'
90
- targets:
91
- - 'rubocop'
92
- - 'test'
93
- - 'xcop'
94
- required_executable: 'bundle'
95
- flags: ['exec', 'rake']
96
-
data/.pdd DELETED
@@ -1,27 +0,0 @@
1
- --source=.
2
- --verbose
3
- --exclude .idea/**/*
4
- --exclude .bundle/**/*
5
- --exclude target/**/*
6
- --exclude coverage/**/*
7
- --exclude test_assets/**/*
8
- --exclude README.md
9
- --exclude features/cli.feature
10
- --exclude features/parsing.feature
11
- --exclude features/catches_broken_puzzles.feature
12
- --exclude features/remove.feature
13
- --exclude features/uses_config.feature
14
- --exclude features/html_output.feature
15
- --exclude features/json_output.feature
16
- --exclude features/avoiding_duplicates.feature
17
- --exclude features/applies_rules.feature
18
- --exclude features/unicode.feature
19
- --exclude lib/pdd/source.rb
20
- --exclude test/test_source.rb
21
- --exclude test/test_source_todo.rb
22
- --exclude test/test_pdd.rb
23
- --exclude src/main/resources/images/**/*
24
- --rule min-words:20
25
- --rule min-estimate:15
26
- --rule max-estimate:90
27
-
data/.rubocop.yml DELETED
@@ -1,32 +0,0 @@
1
- AllCops:
2
- Exclude:
3
- - "assets/**/*"
4
- DisplayCopNames: true
5
- TargetRubyVersion: 2.3
6
- NewCops: enable
7
- SuggestExtensions: false
8
-
9
- Gemspec/RequiredRubyVersion:
10
- Enabled: false
11
- Layout/EmptyLineAfterGuardClause:
12
- Enabled: false
13
- Metrics/CyclomaticComplexity:
14
- Max: 10
15
- Metrics/PerceivedComplexity:
16
- Max: 15
17
- Layout/EndOfLine:
18
- EnforcedStyle: lf
19
- Metrics/ClassLength:
20
- Max: 360
21
- Layout/LineLength:
22
- Max: 90
23
- Metrics/MethodLength:
24
- Max: 35
25
- Metrics/AbcSize:
26
- Max: 40
27
- Style/MultilineBlockChain:
28
- Enabled: false
29
- Metrics/BlockLength:
30
- Max: 50
31
- Style/FrozenStringLiteralComment:
32
- Enabled: false
data/.rultor.yml DELETED
@@ -1,22 +0,0 @@
1
- docker:
2
- image: yegor256/rultor-image:1.22.0
3
- assets:
4
- rubygems.yml: yegor256/home#assets/rubygems.yml
5
- install: |
6
- pdd -f /dev/null
7
- bundle install --no-color
8
- release:
9
- pre: false
10
- script: |-
11
- [[ "${tag}" =~ ^[0-9]+\.[0-9]+\.[0-9]+$ ]] || exit -1
12
- bundle exec rake
13
- rm -rf *.gem
14
- sed -i "s/0\.0\.0/${tag}/g" lib/pdd/version.rb
15
- git add lib/pdd/version.rb
16
- git commit -m "version set to ${tag}"
17
- gem build pdd.gemspec
18
- chmod 0600 ../rubygems.yml
19
- gem push *.gem --config-file ../rubygems.yml
20
- merge:
21
- script: |-
22
- LC_ALL=US-ASCII bundle exec rake
data/.simplecov DELETED
@@ -1,35 +0,0 @@
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.
20
-
21
- SimpleCov.formatter = if Gem.win_platform?
22
- SimpleCov::Formatter::MultiFormatter[
23
- SimpleCov::Formatter::HTMLFormatter
24
- ]
25
- else
26
- SimpleCov::Formatter::MultiFormatter.new(
27
- SimpleCov::Formatter::HTMLFormatter
28
- )
29
- end
30
-
31
- SimpleCov.start do
32
- add_filter '/test/'
33
- add_filter '/features/'
34
- minimum_coverage 90
35
- end
data/test/test__helper.rb DELETED
@@ -1,43 +0,0 @@
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.
20
-
21
- $stdout.sync = true
22
-
23
- require 'simplecov'
24
- SimpleCov.start
25
-
26
- require 'simplecov-cobertura'
27
- SimpleCov.formatter = SimpleCov::Formatter::CoberturaFormatter
28
-
29
- require 'minitest/autorun'
30
- require_relative '../lib/pdd'
31
-
32
- def stub_source_find_github_user(file, path = '')
33
- source = PDD::Source.new(file, path)
34
- verbose_source = PDD::VerboseSource.new(file, source)
35
- fake = proc do |info = {}|
36
- email, author = info.values_at(:email, :author)
37
- { 'login' => 'yegor256' } if email == 'yegor256@gmail.com' ||
38
- author == 'Yegor Bugayenko'
39
- end
40
- source.stub :find_github_user, fake do
41
- yield verbose_source
42
- end
43
- end