christiank-entries_visible 1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (2) hide show
  1. data/entries_visible.rb +17 -0
  2. metadata +53 -0
@@ -0,0 +1,17 @@
1
+ #
2
+ # entries_visible
3
+ # by Christian Koch
4
+ #
5
+ # Dir.entries() lists all the contents of a directory,
6
+ # even the invisible files. OS X sticks a '.DS_STORE'
7
+ # as well as '.' and '..' in every directory.
8
+ #
9
+ # I made this method so I wouldn't have to deal with
10
+ # invisible files ever again.
11
+ #
12
+
13
+ class Dir
14
+ def Dir.entries_visible dir
15
+ return Dir.entries(dir).delete_if { |entry| entry[0, 1] == '.' }
16
+ end
17
+ end
metadata ADDED
@@ -0,0 +1,53 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: christiank-entries_visible
3
+ version: !ruby/object:Gem::Version
4
+ version: "1.0"
5
+ platform: ruby
6
+ authors:
7
+ - Christian Koch
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+
12
+ date: 2009-05-23 00:00:00 -07:00
13
+ default_executable:
14
+ dependencies: []
15
+
16
+ description:
17
+ email: ckoch002@student.ucr.edu
18
+ executables: []
19
+
20
+ extensions: []
21
+
22
+ extra_rdoc_files: []
23
+
24
+ files:
25
+ - entries_visible.rb
26
+ has_rdoc: false
27
+ homepage: http://github.com/christiank/entries_visible
28
+ post_install_message:
29
+ rdoc_options: []
30
+
31
+ require_paths:
32
+ - .
33
+ required_ruby_version: !ruby/object:Gem::Requirement
34
+ requirements:
35
+ - - ">="
36
+ - !ruby/object:Gem::Version
37
+ version: "0"
38
+ version:
39
+ required_rubygems_version: !ruby/object:Gem::Requirement
40
+ requirements:
41
+ - - ">="
42
+ - !ruby/object:Gem::Version
43
+ version: "0"
44
+ version:
45
+ requirements: []
46
+
47
+ rubyforge_project:
48
+ rubygems_version: 1.2.0
49
+ signing_key:
50
+ specification_version: 2
51
+ summary: List only the visible contents in a directory.
52
+ test_files: []
53
+