Class: Dir
Class Method Summary collapse
- .couch_orig_entries ⇒ Object
- .couch_orig_foreach ⇒ Object
- .couch_orig_mkdir ⇒ Object
- .couch_orig_rmdir ⇒ Object
- .entries(dirname) ⇒ Object
- .foreach(dirname, &block) ⇒ Object
- .mkdir(dirname, *args) ⇒ Object
- .rmdir(dirname) ⇒ Object (also: unlink, delete)
Methods included from CouchOpen
Class Method Details
.couch_orig_entries ⇒ Object
7 |
# File 'lib/couchio/core_ext/dir.rb', line 7 alias couch_orig_entries entries |
.couch_orig_foreach ⇒ Object
16 |
# File 'lib/couchio/core_ext/dir.rb', line 16 alias couch_orig_foreach foreach |
.couch_orig_mkdir ⇒ Object
36 |
# File 'lib/couchio/core_ext/dir.rb', line 36 alias couch_orig_mkdir mkdir |
.couch_orig_rmdir ⇒ Object
25 |
# File 'lib/couchio/core_ext/dir.rb', line 25 alias couch_orig_rmdir rmdir |
.entries(dirname) ⇒ Object
8 9 10 11 12 13 14 |
# File 'lib/couchio/core_ext/dir.rb', line 8 def entries(dirname) if dirname.index("couch://") == 0 CouchDatabase.new(dirname).map else couch_orig_entries(dirname) end end |
.foreach(dirname, &block) ⇒ Object
17 18 19 20 21 22 23 |
# File 'lib/couchio/core_ext/dir.rb', line 17 def foreach(dirname, &block) if dirname.index("couch://") == 0 CouchDatabase.new(dirname).each {|f| yield f } else couch_orig_foreach(dirname, &block) end end |
.mkdir(dirname, *args) ⇒ Object
37 38 39 40 41 42 43 |
# File 'lib/couchio/core_ext/dir.rb', line 37 def mkdir(dirname, *args) if dirname.index("couch://") == 0 CouchDatabase.new(dirname).create else couch_orig_mkdir(dirname, *args) end end |
.rmdir(dirname) ⇒ Object Also known as: unlink, delete
26 27 28 29 30 31 32 |
# File 'lib/couchio/core_ext/dir.rb', line 26 def rmdir(dirname) if dirname.index("couch://") == 0 CouchDatabase.new(dirname).delete else couch_orig_rmdir(dirname) end end |