Module: Superhosting::Patches::PathMapper::FileNode

Includes:
Helper::Logger
Defined in:
lib/superhosting/patches/path_mapper/file_node.rb

Instance Method Summary collapse

Methods included from Helper::Logger

#__debug, #__dry_run, #__dry_run=, #__logger, #__logger=, #debug, #debug_block, #debug_operation, #indent, #indent=, #indent_reset, #indent_step, #indent_step_back, #info, #storage, #t, #with_dry_run, #with_indent, #with_logger

Instance Method Details

#_append_line!(content) ⇒ Object



25
26
27
28
29
# File 'lib/superhosting/patches/path_mapper/file_node.rb', line 25

def _append_line!(content)
  self.debug_operation(desc: { code: :file, data: { path: @path } }) do |&blk|
    super.tap {|res| blk.call(code: res[:code], diff: res[:d][:diff]) }
  end
end

#_delete!(full: false) ⇒ Object



37
38
39
40
41
# File 'lib/superhosting/patches/path_mapper/file_node.rb', line 37

def _delete!(full: false)
  self.debug_operation(desc: { code: :file, data: { path: @path } }) do |&blk|
    super.tap {|res| blk.call(code: res[:code], diff: res[:d][:diff]) }
  end
end

#_put!(content) ⇒ Object



7
8
9
10
11
# File 'lib/superhosting/patches/path_mapper/file_node.rb', line 7

def _put!(content)
  self.debug_operation(desc: { code: :file, data: { path: @path } }) do |&blk|
    super.tap {|res| blk.call(code: res[:code], diff: res[:d][:diff]) }
  end
end

#_remove_line!(line) ⇒ Object



19
20
21
22
23
# File 'lib/superhosting/patches/path_mapper/file_node.rb', line 19

def _remove_line!(line)
  self.debug_operation(desc: { code: :file, data: { path: @path } }) do |&blk|
    super.tap {|res| blk.call(code: res[:code], diff: res[:d][:diff]) }
  end
end

#_rename!(new_path) ⇒ Object



31
32
33
34
35
# File 'lib/superhosting/patches/path_mapper/file_node.rb', line 31

def _rename!(new_path)
  self.debug_operation(desc: { code: :file, data: { path: @path, to: new_path } }) do |&blk|
    super.tap {|res| blk.call(code: res[:code], diff: res[:d][:diff]) }
  end
end

#_safe_put!(content) ⇒ Object



13
14
15
16
17
# File 'lib/superhosting/patches/path_mapper/file_node.rb', line 13

def _safe_put!(content)
  self.debug_operation(desc: { code: :file, data: { path: @path } }) do |&blk|
    super.tap {|res| blk.call(code: res[:code], diff: res[:d][:diff]) }
  end
end