rubysl-find 1.0.0 → 2.0.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 98261a884ba226f4edc3b5ca5a6dec07c8be575b
4
- data.tar.gz: db68078ee0626c07546f99fd85751acfe3241699
3
+ metadata.gz: cf2a227cc5643e7a95d850d9abec8f35f737aff3
4
+ data.tar.gz: 9198cf07d5d1287c3245bf2ff9a616776fe99375
5
5
  SHA512:
6
- metadata.gz: b0b565be6cd0f0f74db1a8946d2b11d37e7be61a54c2f3e3d5d4939b953bb8c6ff4c47b31c5269d978e67dd025d7049de1deba3356acb3192ec7952a6548d9a3
7
- data.tar.gz: ce82fd4483ad0d87ab9210c97c5fad0badf2511ed7ffcaffc7e4ff53fc71a0eb9c36d98870112f529442da3b52308c941598b5d71232236a81b8475387b6ffc7
6
+ metadata.gz: 8bf789232ee31993532da8646e8859ad184d6d15a16e2e74344fa6f7301e12d0e5eed70e3f8e84c529f778fbb578fe37de3c899d3d18661c876d6fa17a478c6e
7
+ data.tar.gz: f56b6bea0ad59a8b207deb2f1053172932f4db9a577da41a1552dd45abc9529072c27c87371a61c506c72677254779bcc320ecd9933fd9ccbd1244083320285d
data/.travis.yml CHANGED
@@ -1,8 +1,7 @@
1
1
  language: ruby
2
- before_install:
3
- - gem update --system
4
- - gem --version
5
- - gem install rubysl-bundler
6
- script: bundle exec mspec spec
2
+ env:
3
+ - RUBYLIB=lib
4
+ script: bundle exec mspec
7
5
  rvm:
8
- - rbx-nightly-18mode
6
+ - 1.9.3
7
+ - rbx-nightly-19mode
@@ -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.collect!{|d| d.dup}
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
- if File.lstat(file).directory? then
43
- d = Dir.open(file)
44
- begin
45
- for f in d
46
- next if f == "." or f == ".."
47
- if File::ALT_SEPARATOR and file =~ /^(?:[\/\\]|[A-Za-z]:[\/\\]?)$/ then
48
- f = file + f
49
- elsif file == "/" then
50
- f = "/" + f
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
- rescue Errno::ENOENT, Errno::EACCES
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
@@ -1,5 +1,5 @@
1
1
  module RubySL
2
2
  module Find
3
- VERSION = "1.0.0"
3
+ VERSION = "2.0.0"
4
4
  end
5
5
  end
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
- spec.add_development_dependency "rubysl-prettyprint", "~> 1.0"
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: 1.0.0
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-16 00:00:00.000000000 Z
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.3
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: