dir 0.1.1
Sign up to get free protection for your applications and to get access to all the features.
- data/Manifest +4 -0
- data/README +51 -0
- data/Rakefile +14 -0
- data/dir.gemspec +30 -0
- data/lib/dir.rb +22 -0
- metadata +78 -0
data/Manifest
ADDED
data/README
ADDED
@@ -0,0 +1,51 @@
|
|
1
|
+
= dir
|
2
|
+
|
3
|
+
http://github.com/careljonkhout/dir
|
4
|
+
|
5
|
+
== DESCRIPTION:
|
6
|
+
|
7
|
+
The dir gem overrides the Dir#entries and Dir#foreach methods to exclude the ".." and "." entries.
|
8
|
+
|
9
|
+
== SYNOPSIS:
|
10
|
+
|
11
|
+
To copy all files in directory 'foo' to directory 'bar'
|
12
|
+
|
13
|
+
require 'rubygems'
|
14
|
+
require 'dir'
|
15
|
+
|
16
|
+
Dir.foreach 'foo' do |file|
|
17
|
+
FileUtils::copy 'foo/' + file, 'bar/' + file
|
18
|
+
end
|
19
|
+
|
20
|
+
== REQUIREMENTS:
|
21
|
+
|
22
|
+
rubygems
|
23
|
+
|
24
|
+
== INSTALL:
|
25
|
+
|
26
|
+
sudo gem install dir
|
27
|
+
|
28
|
+
== LICENSE:
|
29
|
+
|
30
|
+
(The MIT License)
|
31
|
+
|
32
|
+
Copyright (c) 2010
|
33
|
+
|
34
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
35
|
+
a copy of this software and associated documentation files (the
|
36
|
+
'Software'), to deal in the Software without restriction, including
|
37
|
+
without limitation the rights to use, copy, modify, merge, publish,
|
38
|
+
distribute, sublicense, and/or sell copies of the Software, and to
|
39
|
+
permit persons to whom the Software is furnished to do so, subject to
|
40
|
+
the following conditions:
|
41
|
+
|
42
|
+
The above copyright notice and this permission notice shall be
|
43
|
+
included in all copies or substantial portions of the Software.
|
44
|
+
|
45
|
+
THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
|
46
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
47
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
48
|
+
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
|
49
|
+
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
|
50
|
+
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
51
|
+
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
data/Rakefile
ADDED
@@ -0,0 +1,14 @@
|
|
1
|
+
require 'rubygems'
|
2
|
+
require 'rake'
|
3
|
+
require 'echoe'
|
4
|
+
|
5
|
+
Echoe.new('dir', '0.1.1') do |p|
|
6
|
+
p.description = 'The dir gem overrides the Dir#entries and Dir#foreach methods to exclude the ".." and "." entries.'
|
7
|
+
p.url = "http://rubygems.org/gems/dir"
|
8
|
+
p.author = "Carel Jonkhout"
|
9
|
+
p.email = "carel.jonkhout@gmail.com"
|
10
|
+
p.ignore_pattern = ["tmp/*", "script/*"]
|
11
|
+
p.development_dependencies = []
|
12
|
+
end
|
13
|
+
|
14
|
+
Dir["#{File.dirname(__FILE__)}/tasks/*.rake"].sort.each { |ext| load ext }
|
data/dir.gemspec
ADDED
@@ -0,0 +1,30 @@
|
|
1
|
+
# -*- encoding: utf-8 -*-
|
2
|
+
|
3
|
+
Gem::Specification.new do |s|
|
4
|
+
s.name = %q{dir}
|
5
|
+
s.version = "0.1.1"
|
6
|
+
|
7
|
+
s.required_rubygems_version = Gem::Requirement.new(">= 1.2") if s.respond_to? :required_rubygems_version=
|
8
|
+
s.authors = ["Carel Jonkhout"]
|
9
|
+
s.date = %q{2010-06-27}
|
10
|
+
s.description = %q{The dir gem overrides the Dir#entries and Dir#foreach methods to exclude the ".." and "." entries.}
|
11
|
+
s.email = %q{carel.jonkhout@gmail.com}
|
12
|
+
s.extra_rdoc_files = ["README", "lib/dir.rb"]
|
13
|
+
s.files = ["README", "Rakefile", "lib/dir.rb", "Manifest", "dir.gemspec"]
|
14
|
+
s.homepage = %q{http://rubygems.org/gems/dir}
|
15
|
+
s.rdoc_options = ["--line-numbers", "--inline-source", "--title", "Dir", "--main", "README"]
|
16
|
+
s.require_paths = ["lib"]
|
17
|
+
s.rubyforge_project = %q{dir}
|
18
|
+
s.rubygems_version = %q{1.3.7}
|
19
|
+
s.summary = %q{The dir gem overrides the Dir#entries and Dir#foreach methods to exclude the ".." and "." entries.}
|
20
|
+
|
21
|
+
if s.respond_to? :specification_version then
|
22
|
+
current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION
|
23
|
+
s.specification_version = 3
|
24
|
+
|
25
|
+
if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
|
26
|
+
else
|
27
|
+
end
|
28
|
+
else
|
29
|
+
end
|
30
|
+
end
|
data/lib/dir.rb
ADDED
@@ -0,0 +1,22 @@
|
|
1
|
+
class Dir
|
2
|
+
VERSION='1.0.0'
|
3
|
+
|
4
|
+
class << self
|
5
|
+
alias_method :old_entries, :entries
|
6
|
+
|
7
|
+
def entries path
|
8
|
+
e = old_entries path
|
9
|
+
e.delete '..'
|
10
|
+
e.delete '.'
|
11
|
+
e
|
12
|
+
end
|
13
|
+
|
14
|
+
alias_method :old_foreach, :foreach
|
15
|
+
|
16
|
+
def foreach path
|
17
|
+
entries(path).each do |entry|
|
18
|
+
yield entry
|
19
|
+
end
|
20
|
+
end
|
21
|
+
end
|
22
|
+
end
|
metadata
ADDED
@@ -0,0 +1,78 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: dir
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
hash: 25
|
5
|
+
prerelease: false
|
6
|
+
segments:
|
7
|
+
- 0
|
8
|
+
- 1
|
9
|
+
- 1
|
10
|
+
version: 0.1.1
|
11
|
+
platform: ruby
|
12
|
+
authors:
|
13
|
+
- Carel Jonkhout
|
14
|
+
autorequire:
|
15
|
+
bindir: bin
|
16
|
+
cert_chain: []
|
17
|
+
|
18
|
+
date: 2010-06-27 00:00:00 -04:00
|
19
|
+
default_executable:
|
20
|
+
dependencies: []
|
21
|
+
|
22
|
+
description: The dir gem overrides the Dir#entries and Dir#foreach methods to exclude the ".." and "." entries.
|
23
|
+
email: carel.jonkhout@gmail.com
|
24
|
+
executables: []
|
25
|
+
|
26
|
+
extensions: []
|
27
|
+
|
28
|
+
extra_rdoc_files:
|
29
|
+
- README
|
30
|
+
- lib/dir.rb
|
31
|
+
files:
|
32
|
+
- README
|
33
|
+
- Rakefile
|
34
|
+
- lib/dir.rb
|
35
|
+
- Manifest
|
36
|
+
- dir.gemspec
|
37
|
+
has_rdoc: true
|
38
|
+
homepage: http://rubygems.org/gems/dir
|
39
|
+
licenses: []
|
40
|
+
|
41
|
+
post_install_message:
|
42
|
+
rdoc_options:
|
43
|
+
- --line-numbers
|
44
|
+
- --inline-source
|
45
|
+
- --title
|
46
|
+
- Dir
|
47
|
+
- --main
|
48
|
+
- README
|
49
|
+
require_paths:
|
50
|
+
- lib
|
51
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
52
|
+
none: false
|
53
|
+
requirements:
|
54
|
+
- - ">="
|
55
|
+
- !ruby/object:Gem::Version
|
56
|
+
hash: 3
|
57
|
+
segments:
|
58
|
+
- 0
|
59
|
+
version: "0"
|
60
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
61
|
+
none: false
|
62
|
+
requirements:
|
63
|
+
- - ">="
|
64
|
+
- !ruby/object:Gem::Version
|
65
|
+
hash: 11
|
66
|
+
segments:
|
67
|
+
- 1
|
68
|
+
- 2
|
69
|
+
version: "1.2"
|
70
|
+
requirements: []
|
71
|
+
|
72
|
+
rubyforge_project: dir
|
73
|
+
rubygems_version: 1.3.7
|
74
|
+
signing_key:
|
75
|
+
specification_version: 3
|
76
|
+
summary: The dir gem overrides the Dir#entries and Dir#foreach methods to exclude the ".." and "." entries.
|
77
|
+
test_files: []
|
78
|
+
|