pdd 0.16.1 → 0.16.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/pdd/sources.rb +7 -11
- data/lib/pdd/version.rb +1 -1
- data/pdd.gemspec +1 -1
- data/test/test_sources.rb +5 -2
- 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: f70d3268af6c4b7f6fdf1e6401a1f73ed26f85f8
|
4
|
+
data.tar.gz: d2dab3ed08b56b2b3c1999feb2135f525b10711a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7a5fd5f873c59f78657c92b611965267ff712d4d7b50fd57ee349873f560f5359cc52410b2166d0080fd0b33812e812203706dab4e09813ddbf9df5664a168ae
|
7
|
+
data.tar.gz: 62ecc9002f192fee996038406473803e659c92b7efea421c612903ad3344ddb50a393d3ee758a8d6b51ed01d2bec42a17c56245cde842867ba9d7e173cf82f4c
|
data/lib/pdd/sources.rb
CHANGED
@@ -21,7 +21,7 @@
|
|
21
21
|
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
22
22
|
# SOFTWARE.
|
23
23
|
|
24
|
-
require '
|
24
|
+
require 'ptools'
|
25
25
|
require 'pdd/source'
|
26
26
|
require 'rake/file_list'
|
27
27
|
|
@@ -33,7 +33,6 @@ module PDD
|
|
33
33
|
def initialize(dir, ptns = [])
|
34
34
|
@dir = dir
|
35
35
|
@exclude = ptns
|
36
|
-
@magic = FileMagic.new(FileMagic::MAGIC_MIME)
|
37
36
|
end
|
38
37
|
|
39
38
|
# Fetch all sources.
|
@@ -46,15 +45,12 @@ module PDD
|
|
46
45
|
end
|
47
46
|
end.to_a
|
48
47
|
PDD.log.info "#{files.size} file(s) found"
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
Source.new(file, file[@dir.length + 1, file.length])
|
56
|
-
)
|
57
|
-
end
|
48
|
+
files.select { |f| !File.directory?(f) && !File.binary?(f) }.map do |file|
|
49
|
+
VerboseSource.new(
|
50
|
+
file,
|
51
|
+
Source.new(file, file[@dir.length + 1, file.length])
|
52
|
+
)
|
53
|
+
end
|
58
54
|
end
|
59
55
|
|
60
56
|
def exclude(ptn)
|
data/lib/pdd/version.rb
CHANGED
data/pdd.gemspec
CHANGED
@@ -46,7 +46,7 @@ Gem::Specification.new do |s|
|
|
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'
|
49
|
-
s.add_runtime_dependency '
|
49
|
+
s.add_runtime_dependency 'ptools', '~>1.3'
|
50
50
|
s.add_runtime_dependency 'slop', '~>3.6'
|
51
51
|
s.add_development_dependency 'rake', '10.5.0'
|
52
52
|
s.add_development_dependency 'coveralls', '0.7.2'
|
data/test/test_sources.rb
CHANGED
@@ -23,6 +23,7 @@
|
|
23
23
|
|
24
24
|
require 'minitest/autorun'
|
25
25
|
require 'pdd/sources'
|
26
|
+
require 'fileutils'
|
26
27
|
require 'tmpdir'
|
27
28
|
|
28
29
|
# Sources test.
|
@@ -38,8 +39,8 @@ class TestSources < Minitest::Test
|
|
38
39
|
end
|
39
40
|
|
40
41
|
def test_ignores_binary_files
|
41
|
-
in_temp(['c'
|
42
|
-
|
42
|
+
in_temp(['c']) do |dir|
|
43
|
+
FileUtils.cp(File.join(Dir.pwd, '.git/index'), dir)
|
43
44
|
list = PDD::Sources.new(dir).fetch
|
44
45
|
assert_equal 1, list.size
|
45
46
|
end
|
@@ -71,6 +72,8 @@ class TestSources < Minitest::Test
|
|
71
72
|
end
|
72
73
|
end
|
73
74
|
|
75
|
+
private
|
76
|
+
|
74
77
|
def in_temp(files)
|
75
78
|
Dir.mktmpdir 'x' do |dir|
|
76
79
|
files.each do |path|
|
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.16.
|
4
|
+
version: 0.16.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Yegor Bugayenko
|
@@ -25,19 +25,19 @@ dependencies:
|
|
25
25
|
- !ruby/object:Gem::Version
|
26
26
|
version: '1.6'
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
|
-
name:
|
28
|
+
name: ptools
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
31
|
- - "~>"
|
32
32
|
- !ruby/object:Gem::Version
|
33
|
-
version: '
|
33
|
+
version: '1.3'
|
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: '1.3'
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
42
|
name: slop
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|