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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 7d29b57ae72415c141564bdda66ecb07c9c1571b
4
- data.tar.gz: 851454230978fde269ddeaa9e8f739b123c39416
3
+ metadata.gz: 923491c89e00bd204e14a12c1c3d2f792c44c14b
4
+ data.tar.gz: 70ed765544c00e134373e5db4a4801afd4c5de53
5
5
  SHA512:
6
- metadata.gz: 4046ba434c2b96896ffde8b0cf518144533d6d6c90aeabdc9b50a8e0c957ec1049c190d6ae69310d54a589d358a108d467c89769f2602b659e7a82733778f862
7
- data.tar.gz: e80d00cd5635eabc7c96bde88391faaa6b2ce88c96ace5cf3edcfbf4f0d26e96e377e6648e28952006ee6b37257f9b1fd25d5ac63db56a95695ff28fe2d6c7b9
6
+ metadata.gz: a4b425410f882fcf7400ede903ba3b9d6ed983d96dc91c58e6d70c0d911202f37db1b40657b7115a50e5afd081917882ca54df65656f020f792f91c33ce8aea5
7
+ data.tar.gz: 3c02e5936c0538054a83a408b0f9083d8f45fbeabe0712f99c368b7455d3d5a31571a043623342ec85275353c6b37df136af2c5313dbbc102ea13fee4c347520
@@ -7,10 +7,10 @@ AllCops:
7
7
 
8
8
  Layout/EndOfLine:
9
9
  EnforcedStyle: lf
10
+ Metrics/ClassLength:
11
+ Max: 300
10
12
  Metrics/MethodLength:
11
13
  Max: 30
12
- Metrics/ClassLength:
13
- Max: 150
14
14
  Metrics/AbcSize:
15
15
  Max: 40
16
16
  Style/MultilineBlockChain:
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](https://cdn.rawgit.com/yegor256/elegantobjects.github.io/master/badge.svg)](http://www.elegantobjects.org)
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://img.teamed.io/rubymine-recommend.svg)](https://www.jetbrains.com/ruby/)
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)
@@ -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)
@@ -23,5 +23,5 @@
23
23
  # Copyright:: Copyright (c) 2014-2018 Yegor Bugayenko
24
24
  # License:: MIT
25
25
  module PDD
26
- VERSION = '0.20.2'.freeze
26
+ VERSION = '0.20.3'.freeze
27
27
  end
@@ -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.2
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-02-21 00:00:00.000000000 Z
11
+ date: 2018-03-05 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: nokogiri