pdd 0.11 → 0.12

Sign up to get free protection for your applications and to get access to all the features.
@@ -13,6 +13,8 @@ release:
13
13
  rake
14
14
  rm -rf *.gem
15
15
  sed -i "s/1\.0\.snapshot/${tag}/g" lib/pdd/version.rb
16
+ git add lib/pdd/version.rb
17
+ git commit -m "version set to ${tag}"
16
18
  gem build pdd.gemspec
17
19
  chmod 0600 ../rubygems.yml
18
20
  gem push *.gem --config-file ../rubygems.yml
data/README.md CHANGED
@@ -44,3 +44,38 @@ Possible formats of puzzle markers:
44
44
 
45
45
  Read this article about
46
46
  [Puzzle Driven Development](http://www.yegor256.com/2009/03/04/pdd.html).
47
+ Check also patent application [US 12/840,306](http://www.google.com/patents/US20120023476)
48
+
49
+ ## Rules
50
+
51
+ You can specify post-parsing rules for your puzzles, in command line,
52
+ for example:
53
+
54
+ ```
55
+ $ pdd --rule=min-estimate:60 --rule=max-estimate:120
56
+ ```
57
+
58
+ These two parameters will add two post-parsing rules `min-estimate`
59
+ and `max-estimate` with parameters. Each rule may have an optional
60
+ parameter specified after a colon.
61
+
62
+ Here is a list of rules available now:
63
+
64
+ * `min-estimate:15` blocks all puzzles that don't have an estimate
65
+ or their estimates are less than 15 minutes.
66
+
67
+ * `max-estimate:120` blocks all puzzles with estimates over 120 minutes.
68
+
69
+ * `available-roles:DEV,IMP,DES` specifies a list of roles that
70
+ are allowed in puzzles. Puzzles without explicitly specified
71
+ roles will be rejected.
72
+
73
+ * `min-words:5` blocks puzzles with descriptions shorter than five words.
74
+
75
+ * `max-duplicates:1` blocks more than one duplicate of any puzzle
76
+ (this rule is used by default).
77
+
78
+ ## .pdd
79
+
80
+ You can put all command line options into `.pdd` file. The options from the
81
+ file will be used first. Command line options may be added on top of them.
data/bin/pdd CHANGED
@@ -29,7 +29,11 @@ require 'slop'
29
29
  require 'pdd/version'
30
30
  require 'nokogiri'
31
31
 
32
- opts = Slop.parse(ARGV, strict: true, help: true) do
32
+ args = []
33
+ args.push(*File.read('.pdd').split(/\s+/).map(&:strip)) if File.exist?('.pdd')
34
+ args.push(*ARGV)
35
+
36
+ opts = Slop.parse(args, strict: true, help: true) do
33
37
  banner "Usage (#{PDD::VERSION}): pdd [options]"
34
38
  on 'v', 'verbose', 'Enable verbose mode'
35
39
  on 'version', 'Show current version'
@@ -94,6 +98,5 @@ if opts[:format]
94
98
  else
95
99
  fail 'invalid format, use html or xml' if opts[:format] != 'xml'
96
100
  end
97
- output
98
101
  end
99
102
  file << output
@@ -0,0 +1,21 @@
1
+ Feature: Using .pdd config file
2
+ As a source code writer I want to be able to
3
+ call PDD as a command line tool and configure
4
+ it via .pdd configuration file
5
+
6
+ Scenario: Simple puzzles collecting
7
+ Given I have a "Sample.java" file with content:
8
+ """
9
+ @todo #13 Let's do it later, dude
10
+ """
11
+ And I have a ".pdd" file with content:
12
+ """
13
+ --verbose
14
+ --source=.
15
+ --file=out.xml
16
+ """
17
+ When I run bin/pdd with ""
18
+ Then Exit code is zero
19
+ And Stdout contains "reading ."
20
+ And XML file "out.xml" matches "/puzzles[count(puzzle)=1]"
21
+
@@ -26,5 +26,5 @@
26
26
  # Copyright:: Copyright (c) 2014 Yegor Bugayenko
27
27
  # License:: MIT
28
28
  module PDD
29
- VERSION = '0.11'
29
+ VERSION = '0.12'
30
30
  end
@@ -45,15 +45,15 @@ Gem::Specification.new do |s|
45
45
  s.test_files = s.files.grep(/^(test|spec|features)\//)
46
46
  s.rdoc_options = ['--charset=UTF-8']
47
47
  s.extra_rdoc_files = ['README.md', 'LICENSE.txt']
48
- s.add_runtime_dependency 'nokogiri', '1.6.4.1'
48
+ s.add_runtime_dependency 'nokogiri', '1.6.5'
49
49
  s.add_runtime_dependency 'ruby-filemagic', '0.6.1'
50
50
  s.add_runtime_dependency 'slop', '3.6.0'
51
- s.add_runtime_dependency 'rake', '10.3.2'
52
- s.add_development_dependency 'coveralls', '0.7'
53
- s.add_development_dependency 'rdoc', '3.11'
54
- s.add_development_dependency 'cucumber', '1.3.11'
55
- s.add_development_dependency 'minitest', '5.4'
51
+ s.add_runtime_dependency 'rake', '10.4.2'
52
+ s.add_development_dependency 'coveralls', '0.7.2'
53
+ s.add_development_dependency 'rdoc', '4.2.0'
54
+ s.add_development_dependency 'cucumber', '1.3.17'
55
+ s.add_development_dependency 'minitest', '5.5.0'
56
56
  s.add_development_dependency 'rubocop', '0.24.1'
57
- s.add_development_dependency 'rubocop-rspec', '1.1'
58
- s.add_development_dependency 'rspec-rails', '2.13'
57
+ s.add_development_dependency 'rubocop-rspec', '1.2.1'
58
+ s.add_development_dependency 'rspec-rails', '3.1.0'
59
59
  end
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.11'
4
+ version: '0.12'
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2014-12-07 00:00:00.000000000 Z
12
+ date: 2015-01-06 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: nokogiri
@@ -18,7 +18,7 @@ dependencies:
18
18
  requirements:
19
19
  - - '='
20
20
  - !ruby/object:Gem::Version
21
- version: 1.6.4.1
21
+ version: 1.6.5
22
22
  type: :runtime
23
23
  prerelease: false
24
24
  version_requirements: !ruby/object:Gem::Requirement
@@ -26,7 +26,7 @@ dependencies:
26
26
  requirements:
27
27
  - - '='
28
28
  - !ruby/object:Gem::Version
29
- version: 1.6.4.1
29
+ version: 1.6.5
30
30
  - !ruby/object:Gem::Dependency
31
31
  name: ruby-filemagic
32
32
  requirement: !ruby/object:Gem::Requirement
@@ -66,7 +66,7 @@ dependencies:
66
66
  requirements:
67
67
  - - '='
68
68
  - !ruby/object:Gem::Version
69
- version: 10.3.2
69
+ version: 10.4.2
70
70
  type: :runtime
71
71
  prerelease: false
72
72
  version_requirements: !ruby/object:Gem::Requirement
@@ -74,7 +74,7 @@ dependencies:
74
74
  requirements:
75
75
  - - '='
76
76
  - !ruby/object:Gem::Version
77
- version: 10.3.2
77
+ version: 10.4.2
78
78
  - !ruby/object:Gem::Dependency
79
79
  name: coveralls
80
80
  requirement: !ruby/object:Gem::Requirement
@@ -82,7 +82,7 @@ dependencies:
82
82
  requirements:
83
83
  - - '='
84
84
  - !ruby/object:Gem::Version
85
- version: '0.7'
85
+ version: 0.7.2
86
86
  type: :development
87
87
  prerelease: false
88
88
  version_requirements: !ruby/object:Gem::Requirement
@@ -90,7 +90,7 @@ dependencies:
90
90
  requirements:
91
91
  - - '='
92
92
  - !ruby/object:Gem::Version
93
- version: '0.7'
93
+ version: 0.7.2
94
94
  - !ruby/object:Gem::Dependency
95
95
  name: rdoc
96
96
  requirement: !ruby/object:Gem::Requirement
@@ -98,7 +98,7 @@ dependencies:
98
98
  requirements:
99
99
  - - '='
100
100
  - !ruby/object:Gem::Version
101
- version: '3.11'
101
+ version: 4.2.0
102
102
  type: :development
103
103
  prerelease: false
104
104
  version_requirements: !ruby/object:Gem::Requirement
@@ -106,7 +106,7 @@ dependencies:
106
106
  requirements:
107
107
  - - '='
108
108
  - !ruby/object:Gem::Version
109
- version: '3.11'
109
+ version: 4.2.0
110
110
  - !ruby/object:Gem::Dependency
111
111
  name: cucumber
112
112
  requirement: !ruby/object:Gem::Requirement
@@ -114,7 +114,7 @@ dependencies:
114
114
  requirements:
115
115
  - - '='
116
116
  - !ruby/object:Gem::Version
117
- version: 1.3.11
117
+ version: 1.3.17
118
118
  type: :development
119
119
  prerelease: false
120
120
  version_requirements: !ruby/object:Gem::Requirement
@@ -122,7 +122,7 @@ dependencies:
122
122
  requirements:
123
123
  - - '='
124
124
  - !ruby/object:Gem::Version
125
- version: 1.3.11
125
+ version: 1.3.17
126
126
  - !ruby/object:Gem::Dependency
127
127
  name: minitest
128
128
  requirement: !ruby/object:Gem::Requirement
@@ -130,7 +130,7 @@ dependencies:
130
130
  requirements:
131
131
  - - '='
132
132
  - !ruby/object:Gem::Version
133
- version: '5.4'
133
+ version: 5.5.0
134
134
  type: :development
135
135
  prerelease: false
136
136
  version_requirements: !ruby/object:Gem::Requirement
@@ -138,7 +138,7 @@ dependencies:
138
138
  requirements:
139
139
  - - '='
140
140
  - !ruby/object:Gem::Version
141
- version: '5.4'
141
+ version: 5.5.0
142
142
  - !ruby/object:Gem::Dependency
143
143
  name: rubocop
144
144
  requirement: !ruby/object:Gem::Requirement
@@ -162,7 +162,7 @@ dependencies:
162
162
  requirements:
163
163
  - - '='
164
164
  - !ruby/object:Gem::Version
165
- version: '1.1'
165
+ version: 1.2.1
166
166
  type: :development
167
167
  prerelease: false
168
168
  version_requirements: !ruby/object:Gem::Requirement
@@ -170,7 +170,7 @@ dependencies:
170
170
  requirements:
171
171
  - - '='
172
172
  - !ruby/object:Gem::Version
173
- version: '1.1'
173
+ version: 1.2.1
174
174
  - !ruby/object:Gem::Dependency
175
175
  name: rspec-rails
176
176
  requirement: !ruby/object:Gem::Requirement
@@ -178,7 +178,7 @@ dependencies:
178
178
  requirements:
179
179
  - - '='
180
180
  - !ruby/object:Gem::Version
181
- version: '2.13'
181
+ version: 3.1.0
182
182
  type: :development
183
183
  prerelease: false
184
184
  version_requirements: !ruby/object:Gem::Requirement
@@ -186,7 +186,7 @@ dependencies:
186
186
  requirements:
187
187
  - - '='
188
188
  - !ruby/object:Gem::Version
189
- version: '2.13'
189
+ version: 3.1.0
190
190
  description: Collects PDD puzzles from source code base
191
191
  email: yegor@teamed.io
192
192
  executables:
@@ -220,6 +220,7 @@ files:
220
220
  - features/step_definitions/steps.rb
221
221
  - features/support/env.rb
222
222
  - features/unicode.feature
223
+ - features/uses_config.feature
223
224
  - lib/pdd.rb
224
225
  - lib/pdd/puzzle.rb
225
226
  - lib/pdd/rule/duplicates.rb
@@ -275,6 +276,7 @@ test_files:
275
276
  - features/step_definitions/steps.rb
276
277
  - features/support/env.rb
277
278
  - features/unicode.feature
279
+ - features/uses_config.feature
278
280
  - test/test__helper.rb
279
281
  - test/test_duplicates.rb
280
282
  - test/test_estimates.rb