Class: GDSync::DryRunFileSystem::Dir

Inherits:
AbstractDir
  • Object
show all
Defined in:
lib/file_system/dry_run.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(_fs, _path) ⇒ Dir


57
58
59
60
# File 'lib/file_system/dry_run.rb', line 57

def initialize(_fs, _path)
  @fs = _fs
  @path = _path
end

Instance Attribute Details

#fsObject (readonly)

Returns the value of attribute fs


54
55
56
# File 'lib/file_system/dry_run.rb', line 54

def fs
  @fs
end

#pathObject (readonly)

Returns the value of attribute path


55
56
57
# File 'lib/file_system/dry_run.rb', line 55

def path
  @path
end

Instance Method Details

#create_dir!(_title) ⇒ Object


69
70
71
# File 'lib/file_system/dry_run.rb', line 69

def create_dir!(_title)
  Dir.new(fs, ::File.join(path, _title))
end

#create_file_with_read_io!(_io, _title, _mtime, _birthtime) ⇒ Object


73
74
75
# File 'lib/file_system/dry_run.rb', line 73

def create_file_with_read_io!(_io, _title, _mtime, _birthtime)
  File.new(fs, ::File.join(path, _title))
end

#create_write_io!(_title) ⇒ Object

Raises:


77
78
79
# File 'lib/file_system/dry_run.rb', line 77

def create_write_io!(_title)
  raise NotSupportedError.new
end

#delete!Object


81
82
# File 'lib/file_system/dry_run.rb', line 81

def delete!
end

#entries(&block) ⇒ Object


66
67
# File 'lib/file_system/dry_run.rb', line 66

def entries(&block)
end

#titleObject


62
63
64
# File 'lib/file_system/dry_run.rb', line 62

def title
  ::File.basename(path)
end