Class: VirtFS::VPathname
- Inherits:
-
VfsRealPathname
- Object
- VirtFS::VPathname
- Defined in:
- lib/virtfs/v_pathname.rb
Class Method Summary collapse
Instance Method Summary collapse
-
#atime ⇒ Object
absolute? ascend.
-
#binread(*args) ⇒ Object
basename.
-
#expand_path(dirstring = nil) ⇒ Object
binwrite birthtime blockdev? chardev? children chmod chown cleanpath ctime delete descend directory? dirname each_child each_entry each_filename each_line empty? entries eql? executable? executable_real? exist?.
-
#file? ⇒ Boolean
extname.
-
#read(*args) ⇒ Object
find fnmatch fnmatch? freeze ftype grpowned? join lchmod lchown lstat make_link make_symlink mkdir mkpath mountpoint? mtime open opendir owned? parent pipe?.
Class Method Details
.getwd ⇒ Object
3 4 5 |
# File 'lib/virtfs/v_pathname.rb', line 3 def self.getwd new(::Dir.getwd) end |
.glob(*args) ⇒ Object
11 12 13 14 |
# File 'lib/virtfs/v_pathname.rb', line 11 def self.glob(*args) return ::Dir.glob(args).collect { |p| new(p) } unless block_given? ::Dir.glob(*args).each { |p| yield(new(p)) } end |
.pwd ⇒ Object
7 8 9 |
# File 'lib/virtfs/v_pathname.rb', line 7 def self.pwd getwd end |
Instance Method Details
#atime ⇒ Object
absolute? ascend
19 20 21 |
# File 'lib/virtfs/v_pathname.rb', line 19 def atime ::File.atime(to_path) end |
#binread(*args) ⇒ Object
basename
25 26 27 |
# File 'lib/virtfs/v_pathname.rb', line 25 def binread(*args) ::File.binread(to_path, *args) end |
#expand_path(dirstring = nil) ⇒ Object
binwrite birthtime blockdev? chardev? children chmod chown cleanpath ctime delete descend directory? dirname each_child each_entry each_filename each_line empty? entries eql? executable? executable_real? exist?
53 54 55 56 |
# File 'lib/virtfs/v_pathname.rb', line 53 def (dirstring = nil) return self if absolute? self.class.new(::File.(to_path, dirstring)) end |
#file? ⇒ Boolean
extname
60 61 62 |
# File 'lib/virtfs/v_pathname.rb', line 60 def file? ::File.file?(to_path) end |
#read(*args) ⇒ Object
find fnmatch fnmatch? freeze ftype grpowned? join lchmod lchown lstat make_link make_symlink mkdir mkpath mountpoint? mtime open opendir owned? parent pipe?
86 87 88 |
# File 'lib/virtfs/v_pathname.rb', line 86 def read(*args) ::File.open(to_path, "r") { |f| return f.read(*args) } end |