pdd 0.23.2 → 0.24.0

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/features/cli.feature CHANGED
@@ -64,15 +64,14 @@ Feature: Command Line Processing
64
64
  Then Exit code is zero
65
65
  And XML file "out.xml" matches "/puzzles[count(puzzle)=0]"
66
66
 
67
- Scenario: Excluding unnecessary files from gitignore
68
- Given this step says to skip
69
- And I have a "a/b/c/test.txt" file with content:
67
+ Scenario: Excluding unnecessary files from .gitignore
68
+ Given I have a "a/b/c/test.txt" file with content:
70
69
  """
71
70
  ~~ @todo #44 some puzzle to be excluded
72
71
  """
73
72
  And I have a "f/g/h/hello.md" file with content:
74
73
  """
75
- ~~ @todo #44 some puzzle to be excluded as well
74
+ ~~ @todo #45 some puzzle to be excluded as well
76
75
  """
77
76
  And I have a ".gitignore" file with content:
78
77
  """
@@ -80,10 +79,52 @@ Feature: Command Line Processing
80
79
  a/**/*
81
80
  !/f
82
81
  """
83
- When I run bin/pdd with "> out.xml"
82
+ When I run bin/pdd with "--skip-gitignore > out.xml"
83
+ Then Exit code is zero
84
+ And XML file "out.xml" matches "/puzzles/puzzle[./ticket='45']"
85
+ And XML file "out.xml" matches "/puzzles[count(puzzle)=1]"
86
+
87
+ Scenario: Excluding unnecessary files from .gitignore and ignore comments
88
+ Given I have a "a/b/c/test.txt" file with content:
89
+ """
90
+ ~~ @todo #44 some puzzle to be excluded
91
+ """
92
+ And I have a "f/g/h/hello.md" file with content:
93
+ """
94
+ ~~ @todo #45 some puzzle to be excluded as well
95
+ """
96
+ And I have a ".gitignore" file with content:
97
+ """
98
+ # This is the list of patterns
99
+ # a/**/*
100
+ f/**/*
101
+ """
102
+ When I run bin/pdd with "--skip-gitignore > out.xml"
84
103
  Then Exit code is zero
104
+ And XML file "out.xml" matches "/puzzles/puzzle[./ticket='44']"
85
105
  And XML file "out.xml" matches "/puzzles[count(puzzle)=1]"
86
106
 
107
+ Scenario: Files from .gitignore is not excluded by default
108
+ Given I have a "a/b/c/test.txt" file with content:
109
+ """
110
+ ~~ @todo #44 some puzzle to be excluded
111
+ """
112
+ And I have a "f/g/h/hello.md" file with content:
113
+ """
114
+ ~~ @todo #45 some puzzle to be excluded as well
115
+ """
116
+ And I have a ".gitignore" file with content:
117
+ """
118
+ # This is the list of patterns
119
+ a/**/*
120
+ !/f
121
+ """
122
+ When I run bin/pdd with "> out.xml"
123
+ Then Exit code is zero
124
+ And XML file "out.xml" matches "/puzzles/puzzle[./ticket='44']"
125
+ And XML file "out.xml" matches "/puzzles/puzzle[./ticket='45']"
126
+ And XML file "out.xml" matches "/puzzles[count(puzzle)=2]"
127
+
87
128
  Scenario: Rejects unknown options
88
129
  Given I have a "test.txt" file with content:
89
130
  """
@@ -0,0 +1,22 @@
1
+ Feature: JSON output
2
+ As a source code writer I want to be able to
3
+ call PDD as a command line tool, and retrieve an
4
+ JSON report
5
+
6
+ Scenario: JSON report building
7
+ Given I have a "Sample.java" file with content:
8
+ """
9
+ public class Main {
10
+ /**
11
+ * @todo #13 Let's do json
12
+ * or maybe not json ":)"
13
+ */
14
+ public void main(String[] args) {
15
+ // later
16
+ }
17
+ }
18
+ """
19
+ When I run bin/pdd with "-v -s . -f out.json --format=json"
20
+ Then Exit code is zero
21
+ And Stdout contains "Reading from root dir ."
22
+ And Text File "out.json" contains "Let's do json or maybe not json “:)“"
@@ -1,4 +1,4 @@
1
- # Copyright (c) 2014-2023 Yegor Bugayenko
1
+ # Copyright (c) 2014-2024 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
@@ -41,7 +41,7 @@ After do
41
41
  FileUtils.rm_rf(@dir)
42
42
  end
43
43
 
44
- Given(/skip/) do
44
+ Given(/skip test/) do
45
45
  skip_this_scenario
46
46
  end
47
47
 
@@ -95,6 +95,14 @@ Then(/^XML file "([^"]+)" matches "([^"]+)"$/) do |file, xpath|
95
95
  raise "XML file #{file} doesn't match \"#{xpath}\":\n#{xml}" if xml.xpath(xpath).empty?
96
96
  end
97
97
 
98
+ Then(/^Text File "([^"]+)" contains "([^"]+)"$/) do |file, substring|
99
+ raise "File #{file} doesn't exist" unless File.exist?(file)
100
+
101
+ content = File.read(file)
102
+ raise "File #{file} doesn't contain \"#{substring}\":\n#{content}" \
103
+ if content.index(substring).nil?
104
+ end
105
+
98
106
  Then(/^Exit code is zero$/) do
99
107
  raise "Non-zero exit code #{@exitstatus}" unless @exitstatus.zero?
100
108
  end
@@ -1,4 +1,4 @@
1
- # Copyright (c) 2014-2023 Yegor Bugayenko
1
+ # Copyright (c) 2014-2024 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
data/lib/pdd/puzzle.rb CHANGED
@@ -1,4 +1,4 @@
1
- # Copyright (c) 2014-2023 Yegor Bugayenko
1
+ # Copyright (c) 2014-2024 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
@@ -1,4 +1,4 @@
1
- # Copyright (c) 2014-2023 Yegor Bugayenko
1
+ # Copyright (c) 2014-2024 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
@@ -1,4 +1,4 @@
1
- # Copyright (c) 2014-2023 Yegor Bugayenko
1
+ # Copyright (c) 2014-2024 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
@@ -1,4 +1,4 @@
1
- # Copyright (c) 2014-2023 Yegor Bugayenko
1
+ # Copyright (c) 2014-2024 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
data/lib/pdd/rule/text.rb CHANGED
@@ -1,4 +1,4 @@
1
- # Copyright (c) 2014-2023 Yegor Bugayenko
1
+ # Copyright (c) 2014-2024 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
data/lib/pdd/source.rb CHANGED
@@ -1,4 +1,4 @@
1
- # Copyright (c) 2014-2023 Yegor Bugayenko
1
+ # Copyright (c) 2014-2024 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
@@ -51,7 +51,7 @@ module PDD
51
51
  /[^\s]TODO:?/.match(line) do |_|
52
52
  raise Error, get_no_leading_space_error('TODO')
53
53
  end
54
- /TODO(?!:?\s+#)/.match(line) do |_|
54
+ /TODO(?=[:\s])(?!:?\s+#)/.match(line) do |_|
55
55
  raise Error, get_no_puzzle_marker_error('TODO')
56
56
  end
57
57
  /TODO:?\s+#\s/.match(line) do |_|
@@ -140,26 +140,42 @@ against the rules explained here: https://github.com/cqfn/pdd#how-to-format"
140
140
  min
141
141
  end
142
142
 
143
- # rubocop:disable Metrics/CyclomaticComplexity
144
- # @todo #209:30min temporarily disabled cyclomatic complexity for the method.
145
- # below. Please fix soon.
146
- #
147
143
  # Fetch puzzle tail (all lines after the first one)
148
144
  def tail(lines, prefix, start)
145
+ return [] if lines.empty?
149
146
  prefix = " #{' ' * start}" if prefix.empty? # fallback to space indentation
150
- line = lines[0][prefix.length, lines[0].length] if lines[0]
151
- is_indented = line&.start_with?(' ')
152
- lines
153
- .take_while do |t|
154
- start = t.length > prefix.length ? prefix : prefix.rstrip
155
- match_markers(t).none? && t.start_with?(start)
156
- end
157
- .take_while do |t|
158
- !is_indented || t[prefix.length, t.length].start_with?(' ')
147
+ tail_prefix = puzzle_tail_prefix(lines, prefix)
148
+ tail = lines
149
+ .take_while { |t| puzzle_text?(t, tail_prefix, prefix) }
150
+ .map do |t|
151
+ content = t[tail_prefix.length, t.length]&.lstrip
152
+ puzzle_empty_line?(content, '') ? '' : content
153
+ end
154
+ tail.pop if tail[-1].eql?('')
155
+ tail
156
+ end
157
+
158
+ def puzzle_tail_prefix(lines, prefix)
159
+ return prefix if lines.empty?
160
+ i = 0
161
+ while i < lines.length
162
+ unless puzzle_empty_line?(lines[i], prefix)
163
+ return lines[i].start_with?("#{prefix} ") ? "#{prefix} " : prefix
159
164
  end
160
- .map { |t| t[prefix.length, t.length]&.lstrip }
165
+ i += 1
166
+ end
167
+ prefix
168
+ end
169
+
170
+ def puzzle_text?(line, prefix, intro_prefix)
171
+ return false unless match_markers(line).none?
172
+ line.start_with?(prefix) || puzzle_empty_line?(line, intro_prefix)
173
+ end
174
+
175
+ def puzzle_empty_line?(line, prefix)
176
+ return true if line.nil?
177
+ line.start_with?(prefix) && line.gsub(prefix, '').chomp.strip.eql?('\\')
161
178
  end
162
- # rubocop:enable Metrics/CyclomaticComplexity
163
179
 
164
180
  # @todo #75:30min Let's make it possible to fetch Subversion data
165
181
  # in a similar way as we are doing with Git. We should also just
data/lib/pdd/sources.rb CHANGED
@@ -1,4 +1,4 @@
1
- # Copyright (c) 2014-2023 Yegor Bugayenko
1
+ # Copyright (c) 2014-2024 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
data/lib/pdd/version.rb CHANGED
@@ -1,4 +1,4 @@
1
- # Copyright (c) 2014-2023 Yegor Bugayenko
1
+ # Copyright (c) 2014-2024 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
@@ -20,8 +20,8 @@
20
20
 
21
21
  # PDD main module.
22
22
  # Author:: Yegor Bugayenko (yegor256@gmail.com)
23
- # Copyright:: Copyright (c) 2014-2023 Yegor Bugayenko
23
+ # Copyright:: Copyright (c) 2014-2024 Yegor Bugayenko
24
24
  # License:: MIT
25
25
  module PDD
26
- VERSION = '0.23.2'.freeze
26
+ VERSION = '0.24.0'.freeze
27
27
  end
data/lib/pdd.rb CHANGED
@@ -1,4 +1,4 @@
1
- # Copyright (c) 2014-2023 Yegor Bugayenko
1
+ # Copyright (c) 2014-2024 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
@@ -30,7 +30,7 @@ require_relative 'pdd/rule/roles'
30
30
 
31
31
  # PDD main module.
32
32
  # Author:: Yegor Bugayenko (yegor256@gmail.com)
33
- # Copyright:: Copyright (c) 2014-2023 Yegor Bugayenko
33
+ # Copyright:: Copyright (c) 2014-2024 Yegor Bugayenko
34
34
  # License:: MIT
35
35
  module PDD
36
36
  # If it breaks.
data/pdd.gemspec CHANGED
@@ -1,4 +1,4 @@
1
- # Copyright (c) 2014-2023 Yegor Bugayenko
1
+ # Copyright (c) 2014-2024 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
data/test/test__helper.rb CHANGED
@@ -1,4 +1,4 @@
1
- # Copyright (c) 2014-2023 Yegor Bugayenko
1
+ # Copyright (c) 2014-2024 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
@@ -23,6 +23,9 @@ $stdout.sync = true
23
23
  require 'simplecov'
24
24
  SimpleCov.start
25
25
 
26
+ require 'simplecov-cobertura'
27
+ SimpleCov.formatter = SimpleCov::Formatter::CoberturaFormatter
28
+
26
29
  require 'minitest/autorun'
27
30
  require_relative '../lib/pdd'
28
31
 
@@ -1,4 +1,4 @@
1
- # Copyright (c) 2014-2023 Yegor Bugayenko
1
+ # Copyright (c) 2014-2024 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/duplicates'
24
24
 
25
25
  # PDD::Rule::MaxDuplicates class test.
26
26
  # Author:: Yegor Bugayenko (yegor256@gmail.com)
27
- # Copyright:: Copyright (c) 2014-2023 Yegor Bugayenko
27
+ # Copyright:: Copyright (c) 2014-2024 Yegor Bugayenko
28
28
  # License:: MIT
29
29
  class TestMaxDuplicates < Minitest::Test
30
30
  def test_max_duplicates
@@ -1,4 +1,4 @@
1
- # Copyright (c) 2014-2023 Yegor Bugayenko
1
+ # Copyright (c) 2014-2024 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/estimates'
24
24
 
25
25
  # PDD::Rule::Estimate module tests.
26
26
  # Author:: Yegor Bugayenko (yegor256@gmail.com)
27
- # Copyright:: Copyright (c) 2014-2023 Yegor Bugayenko
27
+ # Copyright:: Copyright (c) 2014-2024 Yegor Bugayenko
28
28
  # License:: MIT
29
29
  class TestEstimates < Minitest::Test
30
30
  def test_min
data/test/test_many.rb CHANGED
@@ -1,4 +1,4 @@
1
- # Copyright (c) 2014-2023 Yegor Bugayenko
1
+ # Copyright (c) 2014-2024 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
@@ -25,7 +25,7 @@ require_relative '../lib/pdd/sources'
25
25
 
26
26
  # Test many puzzles to make sure their IDs are correct.
27
27
  # Author:: Yegor Bugayenko (yegor256@gmail.com)
28
- # Copyright:: Copyright (c) 2014-2023 Yegor Bugayenko
28
+ # Copyright:: Copyright (c) 2014-2024 Yegor Bugayenko
29
29
  # License:: MIT
30
30
  class TestMany < Minitest::Test
31
31
  def test_parsing
data/test/test_pdd.rb CHANGED
@@ -1,4 +1,4 @@
1
- # Copyright (c) 2014-2023 Yegor Bugayenko
1
+ # Copyright (c) 2014-2024 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'
26
26
 
27
27
  # PDD main module test.
28
28
  # Author:: Yegor Bugayenko (yegor256@gmail.com)
29
- # Copyright:: Copyright (c) 2014-2023 Yegor Bugayenko
29
+ # Copyright:: Copyright (c) 2014-2024 Yegor Bugayenko
30
30
  # License:: MIT
31
31
  class TestPDD < Minitest::Test
32
32
  def test_basic
data/test/test_roles.rb CHANGED
@@ -1,4 +1,4 @@
1
- # Copyright (c) 2014-2023 Yegor Bugayenko
1
+ # Copyright (c) 2014-2024 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/roles'
24
24
 
25
25
  # PDD::Rule::Role module tests.
26
26
  # Author:: Yegor Bugayenko (yegor256@gmail.com)
27
- # Copyright:: Copyright (c) 2014-2023 Yegor Bugayenko
27
+ # Copyright:: Copyright (c) 2014-2024 Yegor Bugayenko
28
28
  # License:: MIT
29
29
  class TestRoles < Minitest::Test
30
30
  def test_incorrect_role
data/test/test_source.rb CHANGED
@@ -1,4 +1,4 @@
1
- # Copyright (c) 2014-2023 Yegor Bugayenko
1
+ # Copyright (c) 2014-2024 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 'test__helper'
26
26
 
27
27
  # Source test.
28
28
  # Author:: Yegor Bugayenko (yegor256@gmail.com)
29
- # Copyright:: Copyright (c) 2014-2023 Yegor Bugayenko
29
+ # Copyright:: Copyright (c) 2014-2024 Yegor Bugayenko
30
30
  # License:: MIT
31
31
  class TestSource < Minitest::Test
32
32
  def test_parsing
@@ -48,7 +48,7 @@ class TestSource < Minitest::Test
48
48
  assert_equal 2, list.size
49
49
  puzzle = list.first
50
50
  assert_equal '2-3', puzzle.props[:lines]
51
- assert_equal 'привет, how are you doing?', \
51
+ assert_equal 'привет, how are you doing?',
52
52
  puzzle.props[:body]
53
53
  assert_equal '44', puzzle.props[:ticket]
54
54
  assert puzzle.props[:author].nil?
@@ -136,7 +136,7 @@ class TestSource < Minitest::Test
136
136
  * \x40todo #1 First one with
137
137
  * a few lines
138
138
  * \x40todo #1 Second one also
139
- * with a few lines
139
+ * with a few lines of text
140
140
  */
141
141
  "
142
142
  )
@@ -145,7 +145,7 @@ class TestSource < Minitest::Test
145
145
  assert_equal 2, source.puzzles.size
146
146
  puzzle = source.puzzles.last
147
147
  assert_equal '5-6', puzzle.props[:lines]
148
- assert_equal 'Second one also with a few lines', puzzle.props[:body]
148
+ assert_equal 'Second one also with a few lines of text', puzzle.props[:body]
149
149
  assert_equal '1', puzzle.props[:ticket]
150
150
  end
151
151
  end
@@ -1,4 +1,4 @@
1
- # Copyright (c) 2014-2023 Yegor Bugayenko
1
+ # Copyright (c) 2014-2024 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
@@ -22,6 +22,7 @@ require 'minitest/autorun'
22
22
  require 'tmpdir'
23
23
  require_relative '../lib/pdd'
24
24
  require_relative '../lib/pdd/sources'
25
+ require_relative 'test__helper'
25
26
 
26
27
  class TestSourceTodo < Minitest::Test
27
28
  def check_valid_puzzle(text, lines, body, ticket, count = 1)
@@ -50,6 +51,21 @@ class TestSourceTodo < Minitest::Test
50
51
  end
51
52
  end
52
53
 
54
+ def check_missing_puzzle(text)
55
+ Dir.mktmpdir 'test' do |dir|
56
+ file = File.join(dir, 'a.txt')
57
+ File.write(file, text)
58
+ begin
59
+ stub_source_find_github_user(file, 'hey') do |source|
60
+ list = source.puzzles
61
+ assert_equal 0, list.size
62
+ end
63
+ rescue PDD::Error => e
64
+ assert_nil e, "Error is raised #{e.message}"
65
+ end
66
+ end
67
+ end
68
+
53
69
  def test_todo_parsing
54
70
  check_valid_puzzle(
55
71
  "
@@ -96,6 +112,17 @@ class TestSourceTodo < Minitest::Test
96
112
  )
97
113
  end
98
114
 
115
+ def test_todo_backslash_escape
116
+ check_valid_puzzle(
117
+ "
118
+ // TODO #45 task description with \\
119
+ ",
120
+ '2-2',
121
+ 'task description with \\',
122
+ '45'
123
+ )
124
+ end
125
+
99
126
  def test_multiple_todo_colon
100
127
  check_valid_puzzle(
101
128
  "
@@ -121,6 +148,89 @@ class TestSourceTodo < Minitest::Test
121
148
  )
122
149
  end
123
150
 
151
+ def test_todo_colon_parsing_multi_line_with_empty_line
152
+ check_valid_puzzle(
153
+ "
154
+ // TODO: #45 task description
155
+ //
156
+ // second line after empty line is not a puzzle text
157
+ ",
158
+ '2-2',
159
+ 'task description',
160
+ '45'
161
+ )
162
+ end
163
+
164
+ def test_todo_colon_parsing_multi_line_with_empty_line_and_space
165
+ check_valid_puzzle(
166
+ '
167
+ // TODO: #46 task description
168
+ // \
169
+ // second line after empty line is a part of the puzzle in case of backslash exists
170
+ ',
171
+ '2-4',
172
+ 'task description second line after empty line is a part ' \
173
+ 'of the puzzle in case of backslash exists',
174
+ '46'
175
+ )
176
+ end
177
+
178
+ def test_todo_colon_parsing_double_puzzle_with_empty_line
179
+ check_valid_puzzle(
180
+ '
181
+ // TODO: #46 task description for first
182
+ // \
183
+ // TODO: #47 task description
184
+ ',
185
+ '2-2',
186
+ 'task description for first',
187
+ '46',
188
+ 2
189
+ )
190
+ end
191
+
192
+ def test_todo_parsing_puzzle_javadoc_with_empty_line
193
+ check_valid_puzzle(
194
+ '
195
+ /**
196
+ * TODO: #46 task description
197
+ * \
198
+ */
199
+ * some text
200
+ ',
201
+ '3-3',
202
+ 'task description',
203
+ '46'
204
+ )
205
+ end
206
+
207
+ def test_todo_parsing_puzzle_last_empty_line
208
+ check_valid_puzzle(
209
+ '
210
+ /**
211
+ * TODO: #47 task description
212
+ * \
213
+ ',
214
+ '3-3',
215
+ 'task description',
216
+ '47'
217
+ )
218
+ end
219
+
220
+ def test_todo_colon_parsing_multi_line_random_prefix
221
+ check_valid_puzzle(
222
+ '
223
+ ~~
224
+ ~~ @todo #44 First
225
+ ~~ and
226
+ ~~ second
227
+ ',
228
+ '3-4',
229
+ 'First and',
230
+ '44'
231
+ )
232
+ end
233
+
124
234
  def test_todo_failing_no_ticket
125
235
  check_invalid_puzzle(
126
236
  "
@@ -174,4 +284,12 @@ class TestSourceTodo < Minitest::Test
174
284
  'TODO must have a leading space'
175
285
  )
176
286
  end
287
+
288
+ def test_todo_not_puzzle
289
+ check_missing_puzzle(
290
+ "
291
+ TODOS_DIR=$PWD
292
+ "
293
+ )
294
+ end
177
295
  end
data/test/test_sources.rb CHANGED
@@ -1,4 +1,4 @@
1
- # Copyright (c) 2014-2023 Yegor Bugayenko
1
+ # Copyright (c) 2014-2024 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-2023 Yegor Bugayenko
29
+ # Copyright:: Copyright (c) 2014-2024 Yegor Bugayenko
30
30
  # License:: MIT
31
31
  class TestSources < Minitest::Test
32
32
  def test_iterator
data/test/test_text.rb CHANGED
@@ -1,4 +1,4 @@
1
- # Copyright (c) 2014-2023 Yegor Bugayenko
1
+ # Copyright (c) 2014-2024 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-2023 Yegor Bugayenko
27
+ # Copyright:: Copyright (c) 2014-2024 Yegor Bugayenko
28
28
  # License:: MIT
29
29
  class TestText < Minitest::Test
30
30
  def test_min_words
@@ -2,8 +2,8 @@
2
2
  // @todo #44 This puzzle
3
3
  // consists
4
4
  // of
5
- //
5
+ // \
6
6
  // two
7
7
  // paragraphs
8
8
 
9
- // This text doesn't belong to the puzzle
9
+ // This text doesn't belong to the puzzle
data/utils/glob.rb CHANGED
@@ -1,4 +1,4 @@
1
- # Copyright (c) 2014-2023 Yegor Bugayenko
1
+ # Copyright (c) 2014-2024 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
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: pdd
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.23.2
4
+ version: 0.24.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Yegor Bugayenko
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-06-29 00:00:00.000000000 Z
11
+ date: 2024-02-09 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: nokogiri
@@ -94,6 +94,7 @@ files:
94
94
  - Rakefile
95
95
  - assets/puzzles.xsd
96
96
  - assets/puzzles.xsl
97
+ - assets/puzzles_json.xsl
97
98
  - bin/pdd
98
99
  - cucumber.yml
99
100
  - features/applies_rules.feature
@@ -102,6 +103,7 @@ files:
102
103
  - features/cli.feature
103
104
  - features/gem_package.feature
104
105
  - features/html_output.feature
106
+ - features/json_output.feature
105
107
  - features/parsing.feature
106
108
  - features/rake.feature
107
109
  - features/remove.feature
@@ -167,7 +169,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
167
169
  - !ruby/object:Gem::Version
168
170
  version: '0'
169
171
  requirements: []
170
- rubygems_version: 3.2.15
172
+ rubygems_version: 3.4.10
171
173
  signing_key:
172
174
  specification_version: 4
173
175
  summary: Puzzle Driven Development collector