pdd 0.2 → 0.2.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
data/bin/pdd CHANGED
@@ -38,6 +38,6 @@ end
38
38
  if opts.help?
39
39
  puts opts
40
40
  else
41
- file = opts.file? ? opts[:file] : STDOUT
42
- File.write(file, PDD::Base.new(opts).xml)
41
+ file = opts.file? ? File.new(opts[:file], 'w') : STDOUT
42
+ file << PDD::Base.new(opts).xml
43
43
  end
data/features/cli.feature CHANGED
@@ -21,4 +21,18 @@ Feature: Command Line Processing
21
21
  }
22
22
  """
23
23
  When I run bin/pdd with "-v -s . -f out.xml"
24
- Then XML file "out.xml" matches "/puzzles[count(puzzle)=1]"
24
+ Then Exit code is zero
25
+ And Stdout contains "reading ."
26
+ And XML file "out.xml" matches "/puzzles[count(puzzle)=1]"
27
+
28
+ Scenario: Simple puzzles collecting into stdout
29
+ Given I have a "Sample.txt" file with content:
30
+ """
31
+ ~~
32
+ ~~ @todo #44 First
33
+ ~~ and second
34
+ ~~
35
+ """
36
+ When I run bin/pdd with "> out.xml"
37
+ Then Exit code is zero
38
+ And XML file "out.xml" matches "/puzzles[count(puzzle)=1]"
@@ -81,6 +81,7 @@ Then(/^Stdout contains "([^"]*)"$/) do |txt|
81
81
  end
82
82
 
83
83
  Then(/^XML file "([^"]+)" matches "([^"]+)"$/) do |file, xpath|
84
+ fail "File #{file} doesn't exit" unless File.exist?(file)
84
85
  xml = Nokogiri::XML.parse(File.read(file))
85
86
  if xml.xpath(xpath).empty?
86
87
  fail "XML file #{file} doesn't match \"#{xpath}\":\n#{xml}"
data/pdd.gemspec CHANGED
@@ -29,7 +29,7 @@ Gem::Specification.new do |s|
29
29
  s.rubygems_version = '2.2.2'
30
30
  s.required_ruby_version = '>= 1.9.3'
31
31
  s.name = 'pdd'
32
- s.version = '0.2'
32
+ s.version = '0.2.1'
33
33
  s.license = 'MIT'
34
34
  s.summary = 'Puzzle Driven Development collector'
35
35
  s.description = 'Collects puzzles from source code base'
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.2'
4
+ version: 0.2.1
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors: