pdd 0.20 → 0.20.1

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: 4bdf6ed0c2a67acd7edda53140b2ac3041139eb2
4
- data.tar.gz: ab9778aa76779698c8c529cff6d9c3f5b1947425
3
+ metadata.gz: 5fca58ea078cc5bc97f2f17c458fceeb5d3d1b20
4
+ data.tar.gz: 3e37cbadfa32e0138cb2645e73a8b9c4274c9860
5
5
  SHA512:
6
- metadata.gz: 757c100e86ccf0bde5e5687c726758fbc381f063900b8260f0e28a072f93a74ffac8add757419201cbeed43799248550ae9413a73615e8918b73a0245c10a0dc
7
- data.tar.gz: cf18864d0e2dc512b56e1c57b9307ea894316a33eba19ffffdeac4521c93d0763a6b20ccef6299a367c79d0c0dc22b36fd706eaebb045c9f8f74d5b6ed1597ba
6
+ metadata.gz: e85ce3f366f82a024373196bc5833611edd06a97b9df0bf50f60eb740c296ddcb7a31dd8d207d7050be8e9ebb17927a9a43abc16b1589c4ac785762206e4c4b3
7
+ data.tar.gz: 9cb534c83838da1b141c260b844ff54270421e60a379dafa8a48bef2c5f355bca321e5083951f522b71601bb6f298b0ee8a16120b33a85205a65ec820ec1f14e
data/.0pdd.yml CHANGED
@@ -3,3 +3,7 @@ errors:
3
3
  # alerts:
4
4
  # github:
5
5
  # - yegor256
6
+
7
+ tags:
8
+ - pdd
9
+ - bug
@@ -0,0 +1,12 @@
1
+ Make sure the title of the issue explains the problem you are having. Also, the description of the issue must clearly explain what is broken, not what you want us to implement. Go through this checklist and make sure you answer "YES" to all points:
2
+
3
+ - You have all pre-requisites listed in README.md installed
4
+ - You are sure that you are not reporting a duplicate (search all issues)
5
+ - You say "is broken" or "doesn't work" in the title
6
+ - You tell us what you are trying to do
7
+ - You explain the results you are getting
8
+ - You suggest an alternative result you would like to see
9
+
10
+ This article will help you understand what we are looking for: http://www.yegor256.com/2014/11/24/principles-of-bug-tracking.html
11
+
12
+ Thank you for your contribution!
@@ -0,0 +1,11 @@
1
+ Many thanks for your contribution, we truly appreciate it. We will appreciate it even more, if you make sure that you can say "YES" to each point in this short checklist:
2
+
3
+ - You made a small amount of changes (less than 100 lines, less than 10 files)
4
+ - You made changes related to only one bug (create separate PRs for separate problems)
5
+ - You are ready to defend your changes (there will be a code review)
6
+ - You don't touch what you don't understand
7
+ - You ran the build locally and it passed
8
+
9
+ This article will help you understand what we are looking for: http://www.yegor256.com/2015/02/09/serious-code-reviewer.html
10
+
11
+ Thank you for your contribution!
@@ -4,7 +4,9 @@ AllCops:
4
4
  - 'assets/**/*'
5
5
  DisplayCopNames: true
6
6
 
7
- MethodLength:
7
+ Style/EndOfLine:
8
+ EnforcedStyle: lf
9
+ Style/MethodLength:
8
10
  Max: 30
9
11
  Style/ClassLength:
10
12
  Max: 150
data/README.md CHANGED
@@ -1,6 +1,7 @@
1
1
  <img src="https://avatars2.githubusercontent.com/u/24456188" width="64px" height="64px"/>
2
2
 
3
- [![Managed by Zerocracy](http://www.0crat.com/badge/C3T46CUJJ.svg)](http://www.0crat.com/p/C3T46CUJJ)
3
+ [![EO principles respected here](https://cdn.rawgit.com/yegor256/elegantobjects.github.io/master/badge.svg)](http://www.elegantobjects.org)
4
+ [![Managed by Zerocracy](https://www.0crat.com/badge/C3T46CUJJ.svg)](https://www.0crat.com/p/C3T46CUJJ)
4
5
  [![DevOps By Rultor.com](http://www.rultor.com/b/yegor256/pdd)](http://www.rultor.com/p/yegor256/pdd)
5
6
  [![We recommend RubyMine](http://img.teamed.io/rubymine-recommend.svg)](https://www.jetbrains.com/ruby/)
6
7
 
@@ -84,7 +84,7 @@ SOFTWARE.
84
84
  <xs:element name="email" minOccurs="0">
85
85
  <xs:simpleType>
86
86
  <xs:restriction base="xs:string">
87
- <xs:pattern value=".+"/>
87
+ <xs:pattern value="[^@]+@[^\.]+\..+"/>
88
88
  </xs:restriction>
89
89
  </xs:simpleType>
90
90
  </xs:element>
@@ -135,7 +135,7 @@ at position ##{prefix.length + 1}."
135
135
  `#{cmd}`.split("\n").map do |line|
136
136
  if line =~ /^author /
137
137
  [:author, line.sub(/^author /, '')]
138
- elsif line =~ /^author-mail /
138
+ elsif line =~ /^author-mail [^@]+@[^\.]+\..+/
139
139
  [:email, line.sub(/^author-mail <(.+)>$/, '\1')]
140
140
  elsif line =~ /^author-time /
141
141
  [
@@ -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'.freeze
26
+ VERSION = '0.20.1'.freeze
27
27
  end
@@ -28,7 +28,9 @@ require_relative '../lib/pdd/sources'
28
28
  # Copyright:: Copyright (c) 2014-2018 Yegor Bugayenko
29
29
  # License:: MIT
30
30
  class TestSource < Minitest::Test
31
+ # @todo #85:30min Make this test pass on AppVeyor.
31
32
  def test_parsing
33
+ skip('Skipped because it fails on AppVeyor')
32
34
  Dir.mktmpdir 'test' do |dir|
33
35
  file = File.join(dir, 'a.txt')
34
36
  File.write(
@@ -155,4 +157,29 @@ class TestSource < Minitest::Test
155
157
  assert_match(/\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}Z/, puzzle.props[:time])
156
158
  end
157
159
  end
160
+
161
+ def test_skips_invalid_git_mail
162
+ skip if Gem.win_platform?
163
+ Dir.mktmpdir 'test' do |dir|
164
+ raise unless system("
165
+ set -e
166
+ cd '#{dir}'
167
+ git init --quiet .
168
+ git config user.email invalid-email
169
+ git config user.name test
170
+ echo '\x40todo #1 this is the puzzle' > a.txt
171
+ git add a.txt
172
+ git commit --quiet -am 'first version'
173
+ ")
174
+ list = PDD::Source.new(File.join(dir, 'a.txt'), '').puzzles
175
+ assert_equal 1, list.size
176
+ puzzle = list.first
177
+ assert_equal '1-de87adc8', puzzle.props[:id]
178
+ assert_equal '1-1', puzzle.props[:lines]
179
+ assert_equal 'this is the puzzle', puzzle.props[:body]
180
+ assert_equal 'test', puzzle.props[:author]
181
+ assert_nil puzzle.props[:email]
182
+ assert_match(/\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}Z/, puzzle.props[:time])
183
+ end
184
+ end
158
185
  end
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.1
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-01-08 00:00:00.000000000 Z
11
+ date: 2018-02-21 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: nokogiri
@@ -189,6 +189,8 @@ extra_rdoc_files:
189
189
  files:
190
190
  - ".0pdd.yml"
191
191
  - ".gitattributes"
192
+ - ".github/ISSUE_TEMPLATE.md"
193
+ - ".github/PULL_REQUEST_TEMPLATE.md"
192
194
  - ".gitignore"
193
195
  - ".pdd"
194
196
  - ".rubocop.yml"