pdd 0.17.3 → 0.17.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.simplecov +1 -1
- data/Rakefile +2 -3
- data/bin/pdd +13 -40
- data/features/step_definitions/steps.rb +4 -4
- data/features/support/env.rb +1 -1
- data/features/unicode.feature +1 -1
- data/lib/pdd.rb +6 -6
- data/lib/pdd/source.rb +6 -5
- data/lib/pdd/sources.rb +2 -2
- data/lib/pdd/version.rb +1 -1
- data/pdd.gemspec +2 -2
- data/test/test__helper.rb +1 -1
- data/test/test_duplicates.rb +1 -1
- data/test/test_estimates.rb +1 -1
- data/test/test_pdd.rb +14 -9
- data/test/test_roles.rb +1 -1
- data/test/test_source.rb +1 -1
- data/test/test_sources.rb +1 -2
- data/test/test_text.rb +1 -1
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8e3a86ea459f81e85300aca8db83ac75fa4900ef
|
4
|
+
data.tar.gz: 0e0b0382904a578a64e43066bb06ae8b8be78b56
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: fb8ed0d9236f69ad90bfb6f81ae7d8439c9982e004351ea18a10ee4236eadd3d7272d532c1cb0976a28edd10f238ee3121a37ac8e00ab7560be7b9c8bee2e601
|
7
|
+
data.tar.gz: c0aad26728527b0f345932dbcdb0c022e6693e91c076e8f81280b7db5243285dfead016ebfdcf191d8f7ea1201ddb19af8d5a315c7c9d88a4e1b24c578e9eabf
|
data/.simplecov
CHANGED
data/Rakefile
CHANGED
@@ -61,11 +61,10 @@ RuboCop::RakeTask.new(:rubocop) do |task|
|
|
61
61
|
end
|
62
62
|
|
63
63
|
require 'cucumber/rake/task'
|
64
|
-
Cucumber::Rake::Task.new(:features) do
|
64
|
+
Cucumber::Rake::Task.new(:features) do
|
65
65
|
Rake::Cleaner.cleanup_files(['coverage'])
|
66
|
-
t.profile = 'travis'
|
67
66
|
end
|
68
|
-
Cucumber::Rake::Task.new(:
|
67
|
+
Cucumber::Rake::Task.new(:'features:html') do |t|
|
69
68
|
t.profile = 'html_report'
|
70
69
|
end
|
71
70
|
|
data/bin/pdd
CHANGED
@@ -23,53 +23,26 @@
|
|
23
23
|
|
24
24
|
STDOUT.sync = true
|
25
25
|
|
26
|
-
require 'pdd'
|
27
26
|
require 'slop'
|
28
|
-
require 'pdd/version'
|
29
27
|
require 'nokogiri'
|
28
|
+
require_relative '../lib/pdd'
|
29
|
+
require_relative '../lib/pdd/version'
|
30
30
|
|
31
31
|
args = []
|
32
32
|
args += File.read('.pdd').split(/\s+/).map(&:strip) if File.exist?('.pdd')
|
33
33
|
args += ARGV
|
34
34
|
|
35
|
-
opts = Slop.parse(args, strict: true, help: true) do
|
36
|
-
banner "Usage (#{PDD::VERSION}): pdd [options]"
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
on(
|
47
|
-
'f',
|
48
|
-
'file',
|
49
|
-
'File to save XML into',
|
50
|
-
argument: :required
|
51
|
-
)
|
52
|
-
on(
|
53
|
-
'e',
|
54
|
-
'exclude',
|
55
|
-
'Glob pattern to exclude',
|
56
|
-
as: Array,
|
57
|
-
argument: :required
|
58
|
-
)
|
59
|
-
on(
|
60
|
-
't',
|
61
|
-
'format',
|
62
|
-
'Format to use (xml|html)',
|
63
|
-
argument: :required
|
64
|
-
)
|
65
|
-
on(
|
66
|
-
'r',
|
67
|
-
'rule',
|
68
|
-
'Format to use (xml|html)',
|
69
|
-
argument: :required,
|
70
|
-
as: Array,
|
71
|
-
limit: 1
|
72
|
-
)
|
35
|
+
opts = Slop.parse(args, strict: true, help: true) do |o|
|
36
|
+
o.banner = "Usage (#{PDD::VERSION}): pdd [options]"
|
37
|
+
o.bool '-h', '--help', 'Show these instructions'
|
38
|
+
o.bool '-v', '--verbose', 'Enable verbose mode'
|
39
|
+
o.bool '-q', '--quiet', 'Enable quiet mode'
|
40
|
+
o.bool '--version', 'Show current version'
|
41
|
+
o.string '-s', '--source', 'Source directory to parse'
|
42
|
+
o.string '-f', '--file', 'File to save XML into'
|
43
|
+
o.array '-e', '--exclude', 'Glob pattern to exclude'
|
44
|
+
o.string '-t', '--format', 'Format to use (xml|html)'
|
45
|
+
o.array '-r', '--rule', 'Rule to apply'
|
73
46
|
end
|
74
47
|
|
75
48
|
raise '-f is mandatory when using -v' if opts.verbose? && !opts.file?
|
@@ -20,20 +20,20 @@
|
|
20
20
|
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
21
21
|
# SOFTWARE.
|
22
22
|
|
23
|
-
require 'pdd'
|
24
23
|
require 'nokogiri'
|
25
24
|
require 'tmpdir'
|
26
25
|
require 'slop'
|
27
26
|
require 'English'
|
27
|
+
require_relative '../../lib/pdd'
|
28
28
|
|
29
29
|
Before do
|
30
30
|
@cwd = Dir.pwd
|
31
31
|
@dir = Dir.mktmpdir('test')
|
32
32
|
FileUtils.mkdir_p(@dir) unless File.exist?(@dir)
|
33
33
|
Dir.chdir(@dir)
|
34
|
-
@opts = Slop.parse ['-v', '-s', @dir] do
|
35
|
-
|
36
|
-
|
34
|
+
@opts = Slop.parse ['-v', '-s', @dir] do |o|
|
35
|
+
o.bool '-v', '--verbose'
|
36
|
+
o.string '-s', '--source'
|
37
37
|
end
|
38
38
|
end
|
39
39
|
|
data/features/support/env.rb
CHANGED
data/features/unicode.feature
CHANGED
@@ -22,6 +22,6 @@ Feature: Unicode
|
|
22
22
|
# @todo #44 \xFF hey
|
23
23
|
\xFF test again
|
24
24
|
"""
|
25
|
-
When I run bin/pdd with "--exclude=test.txt
|
25
|
+
When I run bin/pdd with "--exclude=test.txt -v -f=/dev/null"
|
26
26
|
Then Stdout contains "excluding test.txt"
|
27
27
|
Then Exit code is zero
|
data/lib/pdd.rb
CHANGED
@@ -20,15 +20,15 @@
|
|
20
20
|
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
21
21
|
# SOFTWARE.
|
22
22
|
|
23
|
-
require 'pdd/sources'
|
24
|
-
require 'pdd/version'
|
25
|
-
require 'pdd/rule/estimates'
|
26
|
-
require 'pdd/rule/text'
|
27
|
-
require 'pdd/rule/duplicates'
|
28
|
-
require 'pdd/rule/roles'
|
29
23
|
require 'nokogiri'
|
30
24
|
require 'logger'
|
31
25
|
require 'time'
|
26
|
+
require_relative 'pdd/sources'
|
27
|
+
require_relative 'pdd/version'
|
28
|
+
require_relative 'pdd/rule/estimates'
|
29
|
+
require_relative 'pdd/rule/text'
|
30
|
+
require_relative 'pdd/rule/duplicates'
|
31
|
+
require_relative 'pdd/rule/roles'
|
32
32
|
|
33
33
|
# PDD main module.
|
34
34
|
# Author:: Yegor Bugayenko (yegor@teamed.io)
|
data/lib/pdd/source.rb
CHANGED
@@ -21,7 +21,9 @@
|
|
21
21
|
# SOFTWARE.
|
22
22
|
|
23
23
|
require 'digest/md5'
|
24
|
-
require '
|
24
|
+
require 'shellwords'
|
25
|
+
require_relative '../pdd'
|
26
|
+
require_relative '../pdd/puzzle'
|
25
27
|
|
26
28
|
module PDD
|
27
29
|
# Source.
|
@@ -105,10 +107,9 @@ module PDD
|
|
105
107
|
|
106
108
|
# Git information at the line
|
107
109
|
def git(pos)
|
108
|
-
cmd =
|
109
|
-
|
110
|
-
|
111
|
-
].join(' && ')
|
110
|
+
cmd = "cd #{Shellwords.escape(File.dirname(@file))} && \
|
111
|
+
git blame -L #{pos},#{pos} --porcelain \
|
112
|
+
#{Shellwords.escape(File.basename(@file))}"
|
112
113
|
Hash[
|
113
114
|
`#{cmd}`.split("\n").map do |line|
|
114
115
|
if line =~ /^author /
|
data/lib/pdd/sources.rb
CHANGED
@@ -20,10 +20,10 @@
|
|
20
20
|
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
21
21
|
# SOFTWARE.
|
22
22
|
|
23
|
-
require 'pdd'
|
24
|
-
require 'pdd/source'
|
25
23
|
require 'shellwords'
|
26
24
|
require 'English'
|
25
|
+
require_relative '../pdd'
|
26
|
+
require_relative 'source'
|
27
27
|
|
28
28
|
module PDD
|
29
29
|
# Code base abstraction
|
data/lib/pdd/version.rb
CHANGED
data/pdd.gemspec
CHANGED
@@ -22,7 +22,7 @@
|
|
22
22
|
|
23
23
|
lib = File.expand_path('../lib', __FILE__)
|
24
24
|
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
25
|
-
|
25
|
+
require_relative 'lib/pdd/version'
|
26
26
|
|
27
27
|
Gem::Specification.new do |s|
|
28
28
|
s.specification_version = 2 if s.respond_to? :specification_version=
|
@@ -45,7 +45,7 @@ Gem::Specification.new do |s|
|
|
45
45
|
s.rdoc_options = ['--charset=UTF-8']
|
46
46
|
s.extra_rdoc_files = ['README.md', 'LICENSE.txt']
|
47
47
|
s.add_runtime_dependency 'nokogiri', '~>1.6'
|
48
|
-
s.add_runtime_dependency 'slop', '~>
|
48
|
+
s.add_runtime_dependency 'slop', '~>4.4.1'
|
49
49
|
s.add_development_dependency 'rake', '10.5.0'
|
50
50
|
s.add_development_dependency 'coveralls', '0.7.2'
|
51
51
|
s.add_development_dependency 'rdoc', '4.2.0'
|
data/test/test__helper.rb
CHANGED
data/test/test_duplicates.rb
CHANGED
data/test/test_estimates.rb
CHANGED
data/test/test_pdd.rb
CHANGED
@@ -22,9 +22,9 @@
|
|
22
22
|
|
23
23
|
require 'minitest/autorun'
|
24
24
|
require 'nokogiri'
|
25
|
-
require 'pdd'
|
26
25
|
require 'tmpdir'
|
27
26
|
require 'slop'
|
27
|
+
require_relative '../lib/pdd'
|
28
28
|
|
29
29
|
# PDD main module test.
|
30
30
|
# Author:: Yegor Bugayenko (yegor@teamed.io)
|
@@ -68,8 +68,13 @@ class TestPDD < Minitest::Test
|
|
68
68
|
git init .
|
69
69
|
git config user.email test@teamed.io
|
70
70
|
git config user.name 'Mr. Tester'
|
71
|
-
|
72
|
-
|
71
|
+
mkdir 'a long dir name'
|
72
|
+
cd 'a long dir name'
|
73
|
+
mkdir 'a kid'
|
74
|
+
cd 'a kid'
|
75
|
+
echo '@todo #1 this is the puzzle' > '.это файл.txt'
|
76
|
+
cd ../..
|
77
|
+
git add -f .
|
73
78
|
git commit -am 'first version'
|
74
79
|
")
|
75
80
|
matches(
|
@@ -77,7 +82,7 @@ class TestPDD < Minitest::Test
|
|
77
82
|
[
|
78
83
|
'/puzzles[count(puzzle)=1]',
|
79
84
|
'/puzzles/puzzle[id]',
|
80
|
-
'/puzzles/puzzle[file="
|
85
|
+
'/puzzles/puzzle[file="a long dir name/a kid/.это файл.txt"]',
|
81
86
|
'/puzzles/puzzle[author="Mr. Tester"]',
|
82
87
|
'/puzzles/puzzle[email="test@teamed.io"]',
|
83
88
|
'/puzzles/puzzle[time]'
|
@@ -89,11 +94,11 @@ class TestPDD < Minitest::Test
|
|
89
94
|
private
|
90
95
|
|
91
96
|
def opts(args)
|
92
|
-
Slop.parse args do
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
+
Slop.parse args do |o|
|
98
|
+
o.bool '-v', '--verbose'
|
99
|
+
o.string '-s', '--source'
|
100
|
+
o.array '-e', '--exclude'
|
101
|
+
o.array '-r', '--rule'
|
97
102
|
end
|
98
103
|
end
|
99
104
|
|
data/test/test_roles.rb
CHANGED
data/test/test_source.rb
CHANGED
data/test/test_sources.rb
CHANGED
data/test/test_text.rb
CHANGED
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.4
|
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-04-
|
11
|
+
date: 2017-04-17 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: nokogiri
|
@@ -30,14 +30,14 @@ dependencies:
|
|
30
30
|
requirements:
|
31
31
|
- - "~>"
|
32
32
|
- !ruby/object:Gem::Version
|
33
|
-
version:
|
33
|
+
version: 4.4.1
|
34
34
|
type: :runtime
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
38
|
- - "~>"
|
39
39
|
- !ruby/object:Gem::Version
|
40
|
-
version:
|
40
|
+
version: 4.4.1
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
42
|
name: rake
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|