Module: Aikido::Zen::Sinks::File::Extensions

Defined in:
lib/aikido/zen/sinks/file.rb

Defined Under Namespace

Modules: Initiliazer

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.scan_path(filepath, operation) ⇒ Object



11
12
13
14
15
16
# File 'lib/aikido/zen/sinks/file.rb', line 11

def self.scan_path(filepath, operation)
  SINK.scan(
    filepath: filepath,
    operation: operation
  )
end

Instance Method Details

#chmod(mode, *paths) ⇒ Object



47
48
49
50
# File 'lib/aikido/zen/sinks/file.rb', line 47

def chmod(mode, *paths)
  paths.each { |path| Extensions.scan_path(path, "chmod") }
  super
end

#chown(user, group, *paths) ⇒ Object



52
53
54
55
# File 'lib/aikido/zen/sinks/file.rb', line 52

def chown(user, group, *paths)
  paths.each { |path| Extensions.scan_path(path, "chown") }
  super
end

#delete(*args) ⇒ Object



81
82
83
84
85
86
# File 'lib/aikido/zen/sinks/file.rb', line 81

def delete(*args)
  args.each do |arg|
    Extensions.scan_path(arg, "delete")
  end
  super
end

#expand_path(filename) ⇒ Object



95
96
97
98
# File 'lib/aikido/zen/sinks/file.rb', line 95

def expand_path(filename, *)
  Extensions.scan_path(filename, "expand_path")
  super
end

#joinObject



41
42
43
44
45
# File 'lib/aikido/zen/sinks/file.rb', line 41

def join(*)
  joined = super
  Extensions.scan_path(joined, "join")
  joined
end

#open(filename) ⇒ Object



26
27
28
29
# File 'lib/aikido/zen/sinks/file.rb', line 26

def open(filename, *, **)
  Extensions.scan_path(filename, "open")
  super
end

#read(filename) ⇒ Object



31
32
33
34
# File 'lib/aikido/zen/sinks/file.rb', line 31

def read(filename, *)
  Extensions.scan_path(filename, "read")
  super
end

#realdirpath(filename) ⇒ Object



105
106
107
108
# File 'lib/aikido/zen/sinks/file.rb', line 105

def realdirpath(filename, *)
  Extensions.scan_path(filename, "realdirpath")
  super
end

#realpath(filename) ⇒ Object



100
101
102
103
# File 'lib/aikido/zen/sinks/file.rb', line 100

def realpath(filename, *)
  Extensions.scan_path(filename, "realpath")
  super
end

#rename(from, to) ⇒ Object



57
58
59
60
61
# File 'lib/aikido/zen/sinks/file.rb', line 57

def rename(from, to)
  Extensions.scan_path(from, "rename")
  Extensions.scan_path(to, "rename")
  super
end


63
64
65
66
67
# File 'lib/aikido/zen/sinks/file.rb', line 63

def symlink(from, to)
  Extensions.scan_path(from, "symlink")
  Extensions.scan_path(to, "symlink")
  super
end

#truncate(file_name) ⇒ Object



69
70
71
72
# File 'lib/aikido/zen/sinks/file.rb', line 69

def truncate(file_name, *)
  Extensions.scan_path(file_name, "truncate")
  super
end


74
75
76
77
78
79
# File 'lib/aikido/zen/sinks/file.rb', line 74

def unlink(*args)
  args.each do |arg|
    Extensions.scan_path(arg, "unlink")
  end
  super
end

#utime(atime, mtime, *args) ⇒ Object



88
89
90
91
92
93
# File 'lib/aikido/zen/sinks/file.rb', line 88

def utime(atime, mtime, *args)
  args.each do |arg|
    Extensions.scan_path(arg, "utime")
  end
  super
end

#write(filename) ⇒ Object



36
37
38
39
# File 'lib/aikido/zen/sinks/file.rb', line 36

def write(filename, *, **)
  Extensions.scan_path(filename, "write")
  super
end