rubysl-find 1.0.0 → 2.0.0
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.
- checksums.yaml +4 -4
- data/.travis.yml +5 -6
- data/lib/rubysl/find/find.rb +20 -20
- data/lib/rubysl/find/version.rb +1 -1
- data/rubysl-find.gemspec +1 -2
- metadata +3 -18
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: cf2a227cc5643e7a95d850d9abec8f35f737aff3
|
4
|
+
data.tar.gz: 9198cf07d5d1287c3245bf2ff9a616776fe99375
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8bf789232ee31993532da8646e8859ad184d6d15a16e2e74344fa6f7301e12d0e5eed70e3f8e84c529f778fbb578fe37de3c899d3d18661c876d6fa17a478c6e
|
7
|
+
data.tar.gz: f56b6bea0ad59a8b207deb2f1053172932f4db9a577da41a1552dd45abc9529072c27c87371a61c506c72677254779bcc320ecd9933fd9ccbd1244083320285d
|
data/.travis.yml
CHANGED
data/lib/rubysl/find/find.rb
CHANGED
@@ -30,34 +30,34 @@ module Find
|
|
30
30
|
# Calls the associated block with the name of every file and directory listed
|
31
31
|
# as arguments, then recursively on their subdirectories, and so on.
|
32
32
|
#
|
33
|
+
# Returns an enumerator if no block is given.
|
34
|
+
#
|
33
35
|
# See the +Find+ module documentation for an example.
|
34
36
|
#
|
35
37
|
def find(*paths) # :yield: path
|
36
|
-
paths
|
38
|
+
block_given? or return enum_for(__method__, *paths)
|
39
|
+
|
40
|
+
paths.collect!{|d| raise Errno::ENOENT unless File.exist?(d); d.dup}
|
37
41
|
while file = paths.shift
|
38
42
|
catch(:prune) do
|
39
43
|
yield file.dup.taint
|
40
|
-
next unless File.exist? file
|
41
44
|
begin
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
else
|
52
|
-
f = File.join(file, f)
|
53
|
-
end
|
54
|
-
paths.unshift f.untaint
|
55
|
-
end
|
56
|
-
ensure
|
57
|
-
d.close
|
58
|
-
end
|
45
|
+
s = File.lstat(file)
|
46
|
+
rescue Errno::ENOENT, Errno::EACCES, Errno::ENOTDIR, Errno::ELOOP, Errno::ENAMETOOLONG
|
47
|
+
next
|
48
|
+
end
|
49
|
+
if s.directory? then
|
50
|
+
begin
|
51
|
+
fs = Dir.entries(file)
|
52
|
+
rescue Errno::ENOENT, Errno::EACCES, Errno::ENOTDIR, Errno::ELOOP, Errno::ENAMETOOLONG
|
53
|
+
next
|
59
54
|
end
|
60
|
-
|
55
|
+
fs.sort!
|
56
|
+
fs.reverse_each {|f|
|
57
|
+
next if f == "." or f == ".."
|
58
|
+
f = File.join(file, f)
|
59
|
+
paths.unshift f.untaint
|
60
|
+
}
|
61
61
|
end
|
62
62
|
end
|
63
63
|
end
|
data/lib/rubysl/find/version.rb
CHANGED
data/rubysl-find.gemspec
CHANGED
@@ -19,5 +19,4 @@ Gem::Specification.new do |spec|
|
|
19
19
|
spec.add_development_dependency "bundler", "~> 1.3"
|
20
20
|
spec.add_development_dependency "rake", "~> 10.0"
|
21
21
|
spec.add_development_dependency "mspec", "~> 1.5"
|
22
|
-
|
23
|
-
end
|
22
|
+
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rubysl-find
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 2.0.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Brian Shirai
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2013-09-
|
11
|
+
date: 2013-09-03 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -52,20 +52,6 @@ dependencies:
|
|
52
52
|
- - ~>
|
53
53
|
- !ruby/object:Gem::Version
|
54
54
|
version: '1.5'
|
55
|
-
- !ruby/object:Gem::Dependency
|
56
|
-
name: rubysl-prettyprint
|
57
|
-
requirement: !ruby/object:Gem::Requirement
|
58
|
-
requirements:
|
59
|
-
- - ~>
|
60
|
-
- !ruby/object:Gem::Version
|
61
|
-
version: '1.0'
|
62
|
-
type: :development
|
63
|
-
prerelease: false
|
64
|
-
version_requirements: !ruby/object:Gem::Requirement
|
65
|
-
requirements:
|
66
|
-
- - ~>
|
67
|
-
- !ruby/object:Gem::Version
|
68
|
-
version: '1.0'
|
69
55
|
description: Ruby standard library find.
|
70
56
|
email:
|
71
57
|
- brixen@gmail.com
|
@@ -104,9 +90,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
104
90
|
version: '0'
|
105
91
|
requirements: []
|
106
92
|
rubyforge_project:
|
107
|
-
rubygems_version: 2.0.
|
93
|
+
rubygems_version: 2.0.7
|
108
94
|
signing_key:
|
109
95
|
specification_version: 4
|
110
96
|
summary: Ruby standard library find.
|
111
97
|
test_files: []
|
112
|
-
has_rdoc:
|