pdd 0.4 → 0.4.1
Sign up to get free protection for your applications and to get access to all the features.
- data/bin/pdd +2 -0
- data/features/gem_package.feature +22 -0
- data/features/step_definitions/steps.rb +8 -0
- data/features/unicode.feature +14 -0
- data/lib/pdd/version.rb +1 -1
- data/pdd.gemspec +2 -2
- metadata +17 -3
data/bin/pdd
CHANGED
@@ -41,6 +41,8 @@ fail '-f is mandatory when using -v' if opts.verbose? && !opts.file?
|
|
41
41
|
if opts.help?
|
42
42
|
puts opts
|
43
43
|
else
|
44
|
+
Encoding.default_external = Encoding::UTF_8
|
45
|
+
Encoding.default_internal = Encoding::UTF_8
|
44
46
|
file = opts.file? ? File.new(opts[:file], 'w') : STDOUT
|
45
47
|
file << PDD::Base.new(opts).xml
|
46
48
|
end
|
@@ -0,0 +1,22 @@
|
|
1
|
+
Feature: Gem Package
|
2
|
+
As a source code writer I want to be able to
|
3
|
+
package the Gem into .gem file
|
4
|
+
|
5
|
+
Scenario: Gem can be packaged
|
6
|
+
Given I have a "execs.rb" file with content:
|
7
|
+
"""
|
8
|
+
#!/usr/bin/env ruby
|
9
|
+
require 'rubygems'
|
10
|
+
spec = Gem::Specification::load('./spec.rb')
|
11
|
+
fail 'no executables' if spec.executables.empty?
|
12
|
+
"""
|
13
|
+
When I run bash with
|
14
|
+
"""
|
15
|
+
set -e
|
16
|
+
cd pdd
|
17
|
+
gem build pdd.gemspec
|
18
|
+
gem specification --ruby pdd-*.gem > ../spec.rb
|
19
|
+
cd ..
|
20
|
+
ruby execs.rb
|
21
|
+
"""
|
22
|
+
Then Exit code is zero
|
@@ -28,6 +28,7 @@ require 'slop'
|
|
28
28
|
require 'English'
|
29
29
|
|
30
30
|
Before do
|
31
|
+
@cwd = Dir.pwd
|
31
32
|
@dir = Dir.mktmpdir('test')
|
32
33
|
FileUtils.mkdir_p(@dir) unless File.exist?(@dir)
|
33
34
|
Dir.chdir(@dir)
|
@@ -38,6 +39,7 @@ Before do
|
|
38
39
|
end
|
39
40
|
|
40
41
|
After do
|
42
|
+
Dir.chdir(@cwd)
|
41
43
|
FileUtils.rm_rf(@dir) if File.exist?(@dir)
|
42
44
|
end
|
43
45
|
|
@@ -95,3 +97,9 @@ end
|
|
95
97
|
Then(/^Exit code is not zero$/) do
|
96
98
|
fail 'Zero exit code' if @exitstatus == 0
|
97
99
|
end
|
100
|
+
|
101
|
+
When(/^I run bash with$/) do |text|
|
102
|
+
FileUtils.copy_entry(@cwd, File.join(@dir, 'pdd'))
|
103
|
+
@stdout = `#{text}`
|
104
|
+
@exitstatus = $CHILD_STATUS.exitstatus
|
105
|
+
end
|
@@ -0,0 +1,14 @@
|
|
1
|
+
Feature: Unicode
|
2
|
+
As a source code writer I want to be able to
|
3
|
+
work with Unicode files
|
4
|
+
|
5
|
+
Scenario: Unicode on ASCII locale
|
6
|
+
Given I have a "test.txt" file with content:
|
7
|
+
"""
|
8
|
+
# @todo #44 привет, друзья
|
9
|
+
"""
|
10
|
+
When I run bash with
|
11
|
+
"""
|
12
|
+
LANG=C ruby -Ipdd/lib pdd/bin/pdd test.txt -v -f=/dev/null -e=pdd/**/*
|
13
|
+
"""
|
14
|
+
Then Exit code is zero
|
data/lib/pdd/version.rb
CHANGED
data/pdd.gemspec
CHANGED
@@ -41,8 +41,8 @@ Gem::Specification.new do |s|
|
|
41
41
|
s.email = 'yegor@teamed.io'
|
42
42
|
s.homepage = 'http://github.com/teamed/pdd'
|
43
43
|
s.files = `git ls-files`.split($RS)
|
44
|
-
s.executables = s.files.grep(
|
45
|
-
s.test_files = s.files.grep(
|
44
|
+
s.executables = s.files.grep(/^bin\//) { |f| File.basename(f) }
|
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
48
|
s.add_runtime_dependency 'nokogiri', '~> 1.6', '>= 1.6.3.1'
|
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:
|
4
|
+
version: 0.4.1
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -231,7 +231,8 @@ dependencies:
|
|
231
231
|
version: '2.13'
|
232
232
|
description: Collects puzzles from source code base
|
233
233
|
email: yegor@teamed.io
|
234
|
-
executables:
|
234
|
+
executables:
|
235
|
+
- pdd
|
235
236
|
extensions: []
|
236
237
|
extra_rdoc_files:
|
237
238
|
- README.md
|
@@ -253,9 +254,11 @@ files:
|
|
253
254
|
- cucumber.yml
|
254
255
|
- features/avoiding_duplicates.feature
|
255
256
|
- features/cli.feature
|
257
|
+
- features/gem_package.feature
|
256
258
|
- features/parsing.feature
|
257
259
|
- features/step_definitions/steps.rb
|
258
260
|
- features/support/env.rb
|
261
|
+
- features/unicode.feature
|
259
262
|
- lib/pdd.rb
|
260
263
|
- lib/pdd/puzzle.rb
|
261
264
|
- lib/pdd/source.rb
|
@@ -292,4 +295,15 @@ rubygems_version: 1.8.23
|
|
292
295
|
signing_key:
|
293
296
|
specification_version: 2
|
294
297
|
summary: Puzzle Driven Development collector
|
295
|
-
test_files:
|
298
|
+
test_files:
|
299
|
+
- features/avoiding_duplicates.feature
|
300
|
+
- features/cli.feature
|
301
|
+
- features/gem_package.feature
|
302
|
+
- features/parsing.feature
|
303
|
+
- features/step_definitions/steps.rb
|
304
|
+
- features/support/env.rb
|
305
|
+
- features/unicode.feature
|
306
|
+
- test/test_helper.rb
|
307
|
+
- test/test_pdd.rb
|
308
|
+
- test/test_source.rb
|
309
|
+
- test/test_sources.rb
|