pdd 0.20.2 → 0.20.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.rubocop.yml +2 -2
- data/README.md +2 -2
- data/lib/pdd/source.rb +5 -0
- data/lib/pdd/version.rb +1 -1
- data/test/test_source.rb +18 -2
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 923491c89e00bd204e14a12c1c3d2f792c44c14b
|
4
|
+
data.tar.gz: 70ed765544c00e134373e5db4a4801afd4c5de53
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a4b425410f882fcf7400ede903ba3b9d6ed983d96dc91c58e6d70c0d911202f37db1b40657b7115a50e5afd081917882ca54df65656f020f792f91c33ce8aea5
|
7
|
+
data.tar.gz: 3c02e5936c0538054a83a408b0f9083d8f45fbeabe0712f99c368b7455d3d5a31571a043623342ec85275353c6b37df136af2c5313dbbc102ea13fee4c347520
|
data/.rubocop.yml
CHANGED
data/README.md
CHANGED
@@ -1,9 +1,9 @@
|
|
1
1
|
<img src="https://avatars2.githubusercontent.com/u/24456188" width="64px" height="64px"/>
|
2
2
|
|
3
|
-
[![EO principles respected here](
|
3
|
+
[![EO principles respected here](http://www.elegantobjects.org/badge.svg)](http://www.elegantobjects.org)
|
4
4
|
[![Managed by Zerocracy](https://www.0crat.com/badge/C3T46CUJJ.svg)](https://www.0crat.com/p/C3T46CUJJ)
|
5
5
|
[![DevOps By Rultor.com](http://www.rultor.com/b/yegor256/pdd)](http://www.rultor.com/p/yegor256/pdd)
|
6
|
-
[![We recommend RubyMine](http://
|
6
|
+
[![We recommend RubyMine](http://www.elegantobjects.org/rubymine.svg)](https://www.jetbrains.com/ruby/)
|
7
7
|
|
8
8
|
[![Build Status](https://travis-ci.org/yegor256/pdd.svg)](https://travis-ci.org/yegor256/pdd)
|
9
9
|
[![Build status](https://ci.appveyor.com/api/projects/status/b59sdhuu0gcku15b?svg=true)](https://ci.appveyor.com/project/yegor256/pdd)
|
data/lib/pdd/source.rb
CHANGED
@@ -49,6 +49,11 @@ a puzzle, as this page explains: https://github.com/yegor256/pdd#how-to-format"
|
|
49
49
|
raise Error, "\x40todo found, but puzzle can't be parsed, \
|
50
50
|
most probably because \x40todo is not followed by a puzzle marker, \
|
51
51
|
as this page explains: https://github.com/yegor256/pdd#how-to-format"
|
52
|
+
end
|
53
|
+
/\x40todo\s+#\s/.match(line) do |_|
|
54
|
+
raise Error, "\x40todo found, but there is an unexpected space \
|
55
|
+
after the hash sign, it should not be there, \
|
56
|
+
see https://github.com/yegor256/pdd#how-to-format"
|
52
57
|
end
|
53
58
|
%r{(.*(?:^|\s))\x40todo\s+#([\w\-\.:/]+)\s+(.+)}.match(line) do |m|
|
54
59
|
puzzles << puzzle(lines.drop(idx + 1), m, idx)
|
data/lib/pdd/version.rb
CHANGED
data/test/test_source.rb
CHANGED
@@ -106,9 +106,9 @@ class TestSource < Minitest::Test
|
|
106
106
|
file = File.join(dir, 'a.txt')
|
107
107
|
File.write(
|
108
108
|
file,
|
109
|
-
|
109
|
+
"
|
110
110
|
* \x40todo 44 this puzzle is not formatted correctly
|
111
|
-
|
111
|
+
"
|
112
112
|
)
|
113
113
|
error = assert_raises PDD::Error do
|
114
114
|
PDD::VerboseSource.new(file, PDD::Source.new(file, 'hey')).puzzles
|
@@ -133,6 +133,22 @@ class TestSource < Minitest::Test
|
|
133
133
|
end
|
134
134
|
end
|
135
135
|
|
136
|
+
def test_failing_on_puzzle_with_space_after_dash
|
137
|
+
Dir.mktmpdir 'test' do |dir|
|
138
|
+
file = File.join(dir, 'hey-you.txt')
|
139
|
+
File.write(
|
140
|
+
file,
|
141
|
+
"
|
142
|
+
* \x40todo # 123 This puzzle has an unnecessary space before the dash
|
143
|
+
"
|
144
|
+
)
|
145
|
+
error = assert_raises PDD::Error do
|
146
|
+
PDD::VerboseSource.new(file, PDD::Source.new(file, 'x')).puzzles
|
147
|
+
end
|
148
|
+
assert !error.message.index('an unexpected space').nil?
|
149
|
+
end
|
150
|
+
end
|
151
|
+
|
136
152
|
def test_reads_git_author
|
137
153
|
skip if Gem.win_platform?
|
138
154
|
Dir.mktmpdir 'test' do |dir|
|
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.20.
|
4
|
+
version: 0.20.3
|
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-
|
11
|
+
date: 2018-03-05 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: nokogiri
|