pdd 0.19.1 → 0.19.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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 70605c231a2b289a5a6596696970d736a82742bb
4
- data.tar.gz: bfa4a9fbb46cd693337eb82c1658c2843e68ed17
3
+ metadata.gz: 39b17b27fc5abf3a65daa3f936c96d6968757485
4
+ data.tar.gz: 2835caf28f81e80a098921bfba476c220fa2b9ad
5
5
  SHA512:
6
- metadata.gz: 3ab6a6b36484213810dca3494b66cef150c413f7fbb6f29f8953724ceca0d1fc53f268bce66f369484511d290592f5ce0a66d598803367c0786b85d561b564ad
7
- data.tar.gz: fa42c284c924fcb9fa9dec2ab659ea8fa75927f4ac4d530b6192e7f2b248d41058c6905deb7da77c445fcdc2c808994c87392c974cdb2379f792895d687f50ce
6
+ metadata.gz: fcd1254a03181424c502cd20b14b5df208bb81d126f3df17bccd98b5741ac20c881a94a939492623eabe53ff5a8f1dea8a6a0c74804d51c4d5a2309644b5e71c
7
+ data.tar.gz: 616fe34b598bdc3cae70727e0a8c754639abaa448ef6abf975061e2e9ea4fa998d86fc3ee4f0b2df465b38f1a1a329031a83735cad4472c03d2b5379f2770315
data/bin/pdd CHANGED
@@ -110,6 +110,3 @@ rescue StandardError => ex
110
110
  puts "#{Rainbow('ERROR').red} (#{ex.class.name}): #{ex.message}"
111
111
  exit(-1)
112
112
  end
113
-
114
- # @todo xx
115
-
data/lib/pdd/source.rb CHANGED
@@ -41,17 +41,17 @@ module PDD
41
41
  lines = File.readlines(@file)
42
42
  lines.each_with_index do |line, idx|
43
43
  begin
44
- /[^\s]@todo/.match(line) do |_|
45
- raise Error, 'TODO must have a leading space to become a puzzle, \
46
- as this page explains: https://github.com/yegor256/pdd#how-to-format'
44
+ /[^\s]\x40todo/.match(line) do |_|
45
+ raise Error, "\x40todo must have a leading space to become \
46
+ a puzzle, as this page explains: https://github.com/yegor256/pdd#how-to-format"
47
47
  end
48
- /@todo(?!\s+#)/.match(line) do |_|
49
- raise Error, "@todo found, but puzzle can't be parsed, \
50
- most probably because TODO is not followed by a puzzle marker, as this page \
51
- explains: https://github.com/yegor256/pdd#how-to-format"
48
+ /\x40todo(?!\s+#)/.match(line) do |_|
49
+ raise Error, "\x40todo found, but puzzle can't be parsed, \
50
+ most probably because \x40todo is not followed by a puzzle marker, \
51
+ as this page explains: https://github.com/yegor256/pdd#how-to-format"
52
52
  end
53
- %r{(.*(?:^|\s))@todo\s+#([\w\-\.:/]+)\s+(.+)}.match(line) do |match|
54
- puzzles << puzzle(lines.drop(idx + 1), match, idx)
53
+ %r{(.*(?:^|\s))\x40todo\s+#([\w\-\.:/]+)\s+(.+)}.match(line) do |m|
54
+ puzzles << puzzle(lines.drop(idx + 1), m, idx)
55
55
  end
56
56
  rescue Error, ArgumentError => ex
57
57
  raise Error, "puzzle at line ##{idx + 1}; #{ex.message}"
data/lib/pdd/version.rb CHANGED
@@ -23,5 +23,5 @@
23
23
  # Copyright:: Copyright (c) 2014-2017 Yegor Bugayenko
24
24
  # License:: MIT
25
25
  module PDD
26
- VERSION = '0.19.1'.freeze
26
+ VERSION = '0.19.2'.freeze
27
27
  end
data/test/test_pdd.rb CHANGED
@@ -32,7 +32,7 @@ class TestPDD < Minitest::Test
32
32
  def test_basic
33
33
  Dir.mktmpdir 'test' do |dir|
34
34
  opts = opts(['-q', '-s', dir, '-e', '**/*.png', '-r', 'max-estimate:15'])
35
- File.write(File.join(dir, 'a.txt'), '@todo #55 hello!')
35
+ File.write(File.join(dir, 'a.txt'), "\x40todo #55 hello!")
36
36
  matches(
37
37
  Nokogiri::XML(PDD::Base.new(opts).xml),
38
38
  [
@@ -49,7 +49,7 @@ class TestPDD < Minitest::Test
49
49
  def test_rules_failure
50
50
  Dir.mktmpdir 'test' do |dir|
51
51
  opts = opts(['-q', '-s', dir, '-e', '**/*.png', '-r', 'min-estimate:30'])
52
- File.write(File.join(dir, 'a.txt'), '@todo #90 hello!')
52
+ File.write(File.join(dir, 'a.txt'), "\x40todo #90 hello!")
53
53
  assert_raises PDD::Error do
54
54
  PDD::Base.new(opts).xml
55
55
  end
@@ -70,7 +70,7 @@ class TestPDD < Minitest::Test
70
70
  cd 'a long dir name'
71
71
  mkdir 'a kid'
72
72
  cd 'a kid'
73
- echo '@todo #1 this is some puzzle' > '.это файл.txt'
73
+ echo '\x40todo #1 this is some puzzle' > '.это файл.txt'
74
74
  cd ../..
75
75
  git add -f .
76
76
  git commit --quiet -am 'first version'
data/test/test_source.rb CHANGED
@@ -34,11 +34,11 @@ class TestSource < Minitest::Test
34
34
  File.write(
35
35
  file,
36
36
  "
37
- * @todo #44 hello,
37
+ * \x40todo #44 hello,
38
38
  * how are you\t\r\tdoing?
39
39
  * -something else
40
40
  Something else
41
- ~~ @todo #ABC-3 this is another puzzle
41
+ ~~ \x40todo #ABC-3 this is another puzzle
42
42
  ~~ and it also has to work
43
43
  "
44
44
  )
@@ -59,10 +59,10 @@ class TestSource < Minitest::Test
59
59
  file = File.join(dir, 'a.txt')
60
60
  File.write(
61
61
  file,
62
- '
63
- * @todo #44 this is an incorrectly formatted puzzle,
62
+ "
63
+ * \x40todo #44 this is an incorrectly formatted puzzle,
64
64
  * with a second line without a leading space
65
- '
65
+ "
66
66
  )
67
67
  error = assert_raises PDD::Error do
68
68
  PDD::VerboseSource.new(file, PDD::Source.new(file, 'hey')).puzzles
@@ -76,14 +76,14 @@ class TestSource < Minitest::Test
76
76
  file = File.join(dir, 'ff.txt')
77
77
  File.write(
78
78
  file,
79
- '
80
- * @todo this puzzle misses ticket name/number
81
- '
79
+ "
80
+ * \x40todo this puzzle misses ticket name/number
81
+ "
82
82
  )
83
83
  error = assert_raises PDD::Error do
84
84
  PDD::VerboseSource.new(file, PDD::Source.new(file, 'ff')).puzzles
85
85
  end
86
- assert !error.to_s.index('TODO is not followed by a puzzle marker').nil?
86
+ assert !error.to_s.index("\x40todo is not followed by").nil?
87
87
  end
88
88
  end
89
89
 
@@ -91,7 +91,7 @@ class TestSource < Minitest::Test
91
91
  skip if Gem.win_platform?
92
92
  Dir.mktmpdir 'test' do |dir|
93
93
  file = File.join(dir, 'xx.txt')
94
- File.write(file, ' * @todo #44 this is a broken unicode: ' + 0x92.chr)
94
+ File.write(file, ' * \x40todo #44 this is a broken unicode: ' + 0x92.chr)
95
95
  assert_raises PDD::Error do
96
96
  PDD::VerboseSource.new(file, PDD::Source.new(file, 'xx')).puzzles
97
97
  end
@@ -105,7 +105,7 @@ class TestSource < Minitest::Test
105
105
  File.write(
106
106
  file,
107
107
  '
108
- * @todo 44 this puzzle is not formatted correctly
108
+ * \x40todo 44 this puzzle is not formatted correctly
109
109
  '
110
110
  )
111
111
  error = assert_raises PDD::Error do
@@ -120,14 +120,14 @@ class TestSource < Minitest::Test
120
120
  file = File.join(dir, 'hey.txt')
121
121
  File.write(
122
122
  file,
123
- '
124
- *@todo #999 this is an incorrectly formatted puzzle!
125
- '
123
+ "
124
+ *\x40todo #999 this is an incorrectly formatted puzzle!
125
+ "
126
126
  )
127
127
  error = assert_raises PDD::Error do
128
128
  PDD::VerboseSource.new(file, PDD::Source.new(file, 'x')).puzzles
129
129
  end
130
- assert !error.message.index('TODO must have a leading space').nil?
130
+ assert !error.message.index("\x40todo must have a leading space").nil?
131
131
  end
132
132
  end
133
133
 
@@ -140,7 +140,7 @@ class TestSource < Minitest::Test
140
140
  git init --quiet .
141
141
  git config user.email test@teamed.io
142
142
  git config user.name test
143
- echo '@todo #1 this is the puzzle' > a.txt
143
+ echo '\x40todo #1 this is the puzzle' > a.txt
144
144
  git add a.txt
145
145
  git commit --quiet -am 'first version'
146
146
  ")
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: pdd
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.19.1
4
+ version: 0.19.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Yegor Bugayenko