pdd 0.19.2 → 0.19.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/bin/pdd +4 -1
- data/lib/pdd/sources.rb +3 -5
- data/lib/pdd/version.rb +1 -1
- data/test/test_sources.rb +11 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8622ba0c2c8bd96bc34c573743c5c547d0b23793
|
4
|
+
data.tar.gz: '070296107be448d09103f0ebba885c3eafae10ec'
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 98595337e4d0da7ef8feb663fcaca35d812ddfcad03791cc75958293c047bcfbcf00bc341a9c632d7b1fc43b6add23070b697c3b965aa8d9a5fe10af180f4b48
|
7
|
+
data.tar.gz: 430ccd3afbcab4918a47d8acb4f64817249c86c98c3cb918efb2b511b0604ac50cf5ab7bf74abdb685754131eb60f5063eaf6ab0ab7f0b33bfcadb91360b6943
|
data/bin/pdd
CHANGED
@@ -97,6 +97,7 @@ https://github.com/yegor256/pdd/blob/master/README.md"
|
|
97
97
|
file << output
|
98
98
|
rescue SystemExit => ex
|
99
99
|
puts ex.message unless ex.success?
|
100
|
+
PDD.log.info "Exit code is #{ex.status}"
|
100
101
|
exit(ex.status)
|
101
102
|
rescue PDD::Error => ex
|
102
103
|
puts "#{Rainbow('ERROR').red}: #{ex.message}. \
|
@@ -105,8 +106,10 @@ how to fix it, please submit a GitHub issue, we will try to help you: \
|
|
105
106
|
https://github.com/yegor256/pdd/issues. This tool is still in its beta \
|
106
107
|
version and we will appreciate your feedback. Here is where you can find \
|
107
108
|
more documentation: https://github.com/yegor256/pdd/blob/master/README.md."
|
109
|
+
PDD.log.info 'Exit code is 1'
|
108
110
|
exit(1)
|
109
111
|
rescue StandardError => ex
|
110
112
|
puts "#{Rainbow('ERROR').red} (#{ex.class.name}): #{ex.message}"
|
111
|
-
|
113
|
+
PDD.log.info 'Exit code is 255'
|
114
|
+
exit(255)
|
112
115
|
end
|
data/lib/pdd/sources.rb
CHANGED
@@ -28,7 +28,7 @@ module PDD
|
|
28
28
|
# Ctor.
|
29
29
|
# +dir+:: Directory with source code files
|
30
30
|
def initialize(dir, ptns = [])
|
31
|
-
@dir = dir
|
31
|
+
@dir = File.absolute_path(dir)
|
32
32
|
@exclude = ptns + ['.git/**/*']
|
33
33
|
end
|
34
34
|
|
@@ -46,10 +46,8 @@ module PDD
|
|
46
46
|
end
|
47
47
|
PDD.log.info "#{files.size} file(s) found, #{excluded} excluded"
|
48
48
|
files.reject { |f| binary?(f) }.map do |file|
|
49
|
-
|
50
|
-
|
51
|
-
Source.new(file, file[@dir.length + 1, file.length])
|
52
|
-
)
|
49
|
+
path = file[@dir.length + 1, file.length]
|
50
|
+
VerboseSource.new(path, Source.new(file, path))
|
53
51
|
end
|
54
52
|
end
|
55
53
|
|
data/lib/pdd/version.rb
CHANGED
data/test/test_sources.rb
CHANGED
@@ -82,9 +82,19 @@ class TestSources < Minitest::Test
|
|
82
82
|
end
|
83
83
|
end
|
84
84
|
|
85
|
+
def test_fails_with_verbose_output
|
86
|
+
in_temp do |dir|
|
87
|
+
File.write(File.join(dir, 'z1.txt'), "\x40todobroken\n")
|
88
|
+
error = assert_raises PDD::Error do
|
89
|
+
PDD::Sources.new(dir).fetch[0].puzzles
|
90
|
+
end
|
91
|
+
assert error.message.start_with?('z1.txt; '), error.message
|
92
|
+
end
|
93
|
+
end
|
94
|
+
|
85
95
|
private
|
86
96
|
|
87
|
-
def in_temp(files)
|
97
|
+
def in_temp(files = [])
|
88
98
|
Dir.mktmpdir 'x' do |dir|
|
89
99
|
files.each do |path|
|
90
100
|
file = File.join(dir, path)
|
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.19.
|
4
|
+
version: 0.19.3
|
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-12-
|
11
|
+
date: 2017-12-11 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: nokogiri
|