Module: Ask::Tools::Shell::EditOperations

Included in:
DefaultEditOperations
Defined in:
lib/ask/tools/shell/edit.rb

Overview

Pluggable operations for the Edit tool.

Instance Method Summary collapse

Instance Method Details

#expand_path(path) ⇒ Object



28
29
30
# File 'lib/ask/tools/shell/edit.rb', line 28

def expand_path(path)
  File.expand_path(path)
end

#file?(path) ⇒ Boolean

Returns:

  • (Boolean)


20
21
22
# File 'lib/ask/tools/shell/edit.rb', line 20

def file?(path)
  File.file?(path)
end

#file_exist?(path) ⇒ Boolean

Returns:

  • (Boolean)


16
17
18
# File 'lib/ask/tools/shell/edit.rb', line 16

def file_exist?(path)
  File.exist?(path)
end

#file_size(path) ⇒ Object



24
25
26
# File 'lib/ask/tools/shell/edit.rb', line 24

def file_size(path)
  File.size(path)
end

#read_file(path) ⇒ Object



8
9
10
# File 'lib/ask/tools/shell/edit.rb', line 8

def read_file(path)
  File.read(path)
end

#write_file(path, content) ⇒ Object



12
13
14
# File 'lib/ask/tools/shell/edit.rb', line 12

def write_file(path, content)
  File.write(path, content)
end