pdd 0.17.8 → 0.17.9
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.travis.yml +2 -6
- data/README.md +11 -7
- data/appveyor.yml +1 -1
- data/features/applies_rules.feature +9 -0
- data/lib/pdd.rb +6 -2
- data/lib/pdd/sources.rb +1 -0
- data/lib/pdd/version.rb +2 -2
- data/pdd.gemspec +2 -2
- data/test/test__helper.rb +6 -0
- data/test/test_duplicates.rb +1 -1
- data/test/test_estimates.rb +1 -1
- data/test/test_pdd.rb +1 -1
- data/test/test_roles.rb +1 -1
- data/test/test_source.rb +1 -1
- data/test/test_sources.rb +6 -2
- data/test/test_text.rb +1 -1
- metadata +6 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 13b8f74b0fadd780f0b33023410df1b44cc83f8f
|
4
|
+
data.tar.gz: 9ec0aa1148ee8bbeee5b75d9fe678dc3269c74b8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1f9fa206b2bf86935642f2660393049b53be4432804d34b0dfe0b9ab75cbc0421fe61b9ad698cb4113bf43bfea83b85f894161ede93229bd0837a64a68d92607
|
7
|
+
data.tar.gz: 93f4bdb7f8f793e66be89d256af0307734d04cf782aad05f9e446866117f4c23407359f68a11d36ca3d0c07d0cae4dd4c72823af1853f7274f1ac2169f32b8b2
|
data/.travis.yml
CHANGED
data/README.md
CHANGED
@@ -1,16 +1,16 @@
|
|
1
1
|
<img src="https://avatars2.githubusercontent.com/u/24456188" width="64px" height="64px"/>
|
2
2
|
|
3
3
|
[![Made By Teamed.io](http://img.teamed.io/btn.svg)](http://www.teamed.io)
|
4
|
-
[![DevOps By Rultor.com](http://www.rultor.com/b/
|
4
|
+
[![DevOps By Rultor.com](http://www.rultor.com/b/yegor256/pdd)](http://www.rultor.com/p/yegor256/pdd)
|
5
5
|
[![We recommend RubyMine](http://img.teamed.io/rubymine-recommend.svg)](https://www.jetbrains.com/ruby/)
|
6
6
|
|
7
|
-
[![Build Status](https://travis-ci.org/
|
8
|
-
[![Build status](https://ci.appveyor.com/api/projects/status/
|
7
|
+
[![Build Status](https://travis-ci.org/yegor256/pdd.svg)](https://travis-ci.org/yegor256/pdd)
|
8
|
+
[![Build status](https://ci.appveyor.com/api/projects/status/b59sdhuu0gcku15b?svg=true)](https://ci.appveyor.com/project/yegor256/pdd)
|
9
9
|
[![PDD status](http://www.0pdd.com/svg?name=yegor256/pdd)](http://www.0pdd.com/p?name=yegor256/pdd)
|
10
10
|
[![Gem Version](https://badge.fury.io/rb/pdd.svg)](http://badge.fury.io/rb/pdd)
|
11
|
-
[![Dependency Status](https://gemnasium.com/
|
12
|
-
[![Code Climate](http://img.shields.io/codeclimate/github/
|
13
|
-
[![Coverage
|
11
|
+
[![Dependency Status](https://gemnasium.com/yegor256/pdd.svg)](https://gemnasium.com/yegor256/pdd)
|
12
|
+
[![Code Climate](http://img.shields.io/codeclimate/github/yegor256/pdd.svg)](https://codeclimate.com/github/yegor256/pdd)
|
13
|
+
[![Test Coverage](https://img.shields.io/codecov/c/github/yegor256/pdd.svg)](https://codecov.io/github/yegor256/pdd?branch=master)
|
14
14
|
|
15
15
|
## What This is for?
|
16
16
|
|
@@ -54,9 +54,12 @@ to the leading space in every consecutive line):
|
|
54
54
|
```java
|
55
55
|
/**
|
56
56
|
* @todo #234:15m/DEV This is something to do later
|
57
|
-
* in one of the next releases. I can't figure out
|
57
|
+
* in one of the next releases. I can't figure out
|
58
58
|
* how to implement it now, that's why the puzzle.
|
59
59
|
*/
|
60
|
+
void sendEmail() {
|
61
|
+
throw new UnsupportedOperationException();
|
62
|
+
}
|
60
63
|
```
|
61
64
|
|
62
65
|
It starts with `@todo`, followed by a space and a puzzle marker.
|
@@ -101,3 +104,4 @@ Here is a list of rules available now:
|
|
101
104
|
|
102
105
|
You can put all command line options into `.pdd` file. The options from the
|
103
106
|
file will be used first. Command line options may be added on top of them.
|
107
|
+
See, how it is done in [yegor256/0pdd](https://github.com/yegor256/0pdd/blob/master/.pdd).
|
data/appveyor.yml
CHANGED
@@ -39,3 +39,12 @@ Feature: Applies Post-Parsing Rules
|
|
39
39
|
When I run bin/pdd with "--rule=available-roles:DEV,IMP"
|
40
40
|
Then Exit code is not zero
|
41
41
|
Then Stdout contains "defines role TEST"
|
42
|
+
|
43
|
+
Scenario: Throwing exception on touching max-duplicates rule
|
44
|
+
Given I have a "Sample.java" file with content:
|
45
|
+
"""
|
46
|
+
@todo #334:15m This is the puzzle
|
47
|
+
@todo #35:30m This is the puzzle
|
48
|
+
"""
|
49
|
+
When I run bin/pdd with "--rule=max-duplicates:3"
|
50
|
+
Then Exit code is not zero
|
data/lib/pdd.rb
CHANGED
@@ -31,7 +31,7 @@ require_relative 'pdd/rule/duplicates'
|
|
31
31
|
require_relative 'pdd/rule/roles'
|
32
32
|
|
33
33
|
# PDD main module.
|
34
|
-
# Author:: Yegor Bugayenko (
|
34
|
+
# Author:: Yegor Bugayenko (yegor256@gmail.com)
|
35
35
|
# Copyright:: Copyright (c) 2014-2017 Yegor Bugayenko
|
36
36
|
# License:: MIT
|
37
37
|
module PDD
|
@@ -138,7 +138,11 @@ module PDD
|
|
138
138
|
def rules(xml)
|
139
139
|
doc = Nokogiri::XML(xml)
|
140
140
|
total = 0
|
141
|
-
|
141
|
+
list = @opts[:rule] || []
|
142
|
+
unless list.select { |r| r.start_with?('max-duplicates:') }.empty?
|
143
|
+
raise PDD::Error, 'You can\'t modify max-duplicates, it\'s always 1'
|
144
|
+
end
|
145
|
+
list.push('max-duplicates:1').map do |r|
|
142
146
|
name, value = r.split(':')
|
143
147
|
rule = RULES[name]
|
144
148
|
raise "rule '#{name}' doesn't exist" if rule.nil?
|
data/lib/pdd/sources.rb
CHANGED
data/lib/pdd/version.rb
CHANGED
@@ -21,9 +21,9 @@
|
|
21
21
|
# SOFTWARE.
|
22
22
|
|
23
23
|
# PDD main module.
|
24
|
-
# Author:: Yegor Bugayenko (
|
24
|
+
# Author:: Yegor Bugayenko (yegor256@gmail.com)
|
25
25
|
# Copyright:: Copyright (c) 2014-2017 Yegor Bugayenko
|
26
26
|
# License:: MIT
|
27
27
|
module PDD
|
28
|
-
VERSION = '0.17.
|
28
|
+
VERSION = '0.17.9'.freeze
|
29
29
|
end
|
data/pdd.gemspec
CHANGED
@@ -37,7 +37,7 @@ Gem::Specification.new do |s|
|
|
37
37
|
s.summary = 'Puzzle Driven Development collector'
|
38
38
|
s.description = 'Collects PDD puzzles from source code base'
|
39
39
|
s.authors = ['Yegor Bugayenko']
|
40
|
-
s.email = '
|
40
|
+
s.email = 'yegor256@gmail.com'
|
41
41
|
s.homepage = 'http://github.com/yegor256/pdd'
|
42
42
|
s.files = `git ls-files`.split($RS)
|
43
43
|
s.executables = s.files.grep(%r{^bin/}) { |f| File.basename(f) }
|
@@ -47,7 +47,7 @@ Gem::Specification.new do |s|
|
|
47
47
|
s.add_runtime_dependency 'nokogiri', '~>1.7.2'
|
48
48
|
s.add_runtime_dependency 'slop', '~>4.4.1'
|
49
49
|
s.add_development_dependency 'rake', '12.0.0'
|
50
|
-
s.add_development_dependency '
|
50
|
+
s.add_development_dependency 'codecov', '0.1.10'
|
51
51
|
s.add_development_dependency 'rdoc', '4.2.0'
|
52
52
|
s.add_development_dependency 'cucumber', '1.3.17'
|
53
53
|
s.add_development_dependency 'minitest', '5.5.0'
|
data/test/test__helper.rb
CHANGED
data/test/test_duplicates.rb
CHANGED
@@ -25,7 +25,7 @@ require 'nokogiri'
|
|
25
25
|
require_relative '../lib/pdd/rule/duplicates'
|
26
26
|
|
27
27
|
# PDD::Rule::MaxDuplicates class test.
|
28
|
-
# Author:: Yegor Bugayenko (
|
28
|
+
# Author:: Yegor Bugayenko (yegor256@gmail.com)
|
29
29
|
# Copyright:: Copyright (c) 2014-2017 Yegor Bugayenko
|
30
30
|
# License:: MIT
|
31
31
|
class TestMaxDuplicates < Minitest::Test
|
data/test/test_estimates.rb
CHANGED
@@ -25,7 +25,7 @@ require 'nokogiri'
|
|
25
25
|
require_relative '../lib/pdd/rule/estimates'
|
26
26
|
|
27
27
|
# PDD::Rule::Estimate module tests.
|
28
|
-
# Author:: Yegor Bugayenko (
|
28
|
+
# Author:: Yegor Bugayenko (yegor256@gmail.com)
|
29
29
|
# Copyright:: Copyright (c) 2014-2017 Yegor Bugayenko
|
30
30
|
# License:: MIT
|
31
31
|
class TestEstimates < Minitest::Test
|
data/test/test_pdd.rb
CHANGED
@@ -27,7 +27,7 @@ require 'slop'
|
|
27
27
|
require_relative '../lib/pdd'
|
28
28
|
|
29
29
|
# PDD main module test.
|
30
|
-
# Author:: Yegor Bugayenko (
|
30
|
+
# Author:: Yegor Bugayenko (yegor256@gmail.com)
|
31
31
|
# Copyright:: Copyright (c) 2014-2017 Yegor Bugayenko
|
32
32
|
# License:: MIT
|
33
33
|
class TestPDD < Minitest::Test
|
data/test/test_roles.rb
CHANGED
@@ -25,7 +25,7 @@ require 'nokogiri'
|
|
25
25
|
require_relative '../lib/pdd/rule/roles'
|
26
26
|
|
27
27
|
# PDD::Rule::Role module tests.
|
28
|
-
# Author:: Yegor Bugayenko (
|
28
|
+
# Author:: Yegor Bugayenko (yegor256@gmail.com)
|
29
29
|
# Copyright:: Copyright (c) 2014-2017 Yegor Bugayenko
|
30
30
|
# License:: MIT
|
31
31
|
class TestRoles < Minitest::Test
|
data/test/test_source.rb
CHANGED
@@ -25,7 +25,7 @@ require 'tmpdir'
|
|
25
25
|
require_relative '../lib/pdd/sources'
|
26
26
|
|
27
27
|
# Source test.
|
28
|
-
# Author:: Yegor Bugayenko (
|
28
|
+
# Author:: Yegor Bugayenko (yegor256@gmail.com)
|
29
29
|
# Copyright:: Copyright (c) 2014-2017 Yegor Bugayenko
|
30
30
|
# License:: MIT
|
31
31
|
class TestSource < Minitest::Test
|
data/test/test_sources.rb
CHANGED
@@ -27,7 +27,7 @@ require_relative '../test/test__helper'
|
|
27
27
|
require_relative '../lib/pdd/sources'
|
28
28
|
|
29
29
|
# Sources test.
|
30
|
-
# Author:: Yegor Bugayenko (
|
30
|
+
# Author:: Yegor Bugayenko (yegor256@gmail.com)
|
31
31
|
# Copyright:: Copyright (c) 2014-2017 Yegor Bugayenko
|
32
32
|
# License:: MIT
|
33
33
|
class TestSources < Minitest::Test
|
@@ -39,6 +39,7 @@ class TestSources < Minitest::Test
|
|
39
39
|
end
|
40
40
|
|
41
41
|
def test_ignores_binary_files
|
42
|
+
skip if Gem.win_platform?
|
42
43
|
in_temp([]) do |dir|
|
43
44
|
[
|
44
45
|
'README.md',
|
@@ -61,7 +62,10 @@ class TestSources < Minitest::Test
|
|
61
62
|
File.write(File.join(dir, "test.#{ext}"), 'text')
|
62
63
|
end
|
63
64
|
list = PDD::Sources.new(dir).fetch
|
64
|
-
assert_equal
|
65
|
+
assert_equal(
|
66
|
+
exts.size, list.size,
|
67
|
+
"Files found: #{list}"
|
68
|
+
)
|
65
69
|
end
|
66
70
|
end
|
67
71
|
|
data/test/test_text.rb
CHANGED
@@ -25,7 +25,7 @@ require 'nokogiri'
|
|
25
25
|
require_relative '../lib/pdd/rule/text'
|
26
26
|
|
27
27
|
# PDD::Rule::Text module tests.
|
28
|
-
# Author:: Yegor Bugayenko (
|
28
|
+
# Author:: Yegor Bugayenko (yegor256@gmail.com)
|
29
29
|
# Copyright:: Copyright (c) 2014-2017 Yegor Bugayenko
|
30
30
|
# License:: MIT
|
31
31
|
class TestText < Minitest::Test
|
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.17.
|
4
|
+
version: 0.17.9
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Yegor Bugayenko
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-
|
11
|
+
date: 2017-06-07 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: nokogiri
|
@@ -53,19 +53,19 @@ dependencies:
|
|
53
53
|
- !ruby/object:Gem::Version
|
54
54
|
version: 12.0.0
|
55
55
|
- !ruby/object:Gem::Dependency
|
56
|
-
name:
|
56
|
+
name: codecov
|
57
57
|
requirement: !ruby/object:Gem::Requirement
|
58
58
|
requirements:
|
59
59
|
- - '='
|
60
60
|
- !ruby/object:Gem::Version
|
61
|
-
version: 0.
|
61
|
+
version: 0.1.10
|
62
62
|
type: :development
|
63
63
|
prerelease: false
|
64
64
|
version_requirements: !ruby/object:Gem::Requirement
|
65
65
|
requirements:
|
66
66
|
- - '='
|
67
67
|
- !ruby/object:Gem::Version
|
68
|
-
version: 0.
|
68
|
+
version: 0.1.10
|
69
69
|
- !ruby/object:Gem::Dependency
|
70
70
|
name: rdoc
|
71
71
|
requirement: !ruby/object:Gem::Requirement
|
@@ -151,7 +151,7 @@ dependencies:
|
|
151
151
|
- !ruby/object:Gem::Version
|
152
152
|
version: 3.1.0
|
153
153
|
description: Collects PDD puzzles from source code base
|
154
|
-
email:
|
154
|
+
email: yegor256@gmail.com
|
155
155
|
executables:
|
156
156
|
- pdd
|
157
157
|
extensions: []
|