class FileWrapper
Public Instance Methods
basename(path, extension=nil)
click to toggle source
# File lib/ceedling/file_wrapper.rb, line 13 def basename(path, extension=nil) return File.basename(path, extension) if extension return File.basename(path) end
compare(from, to)
click to toggle source
# File lib/ceedling/file_wrapper.rb, line 47 def compare(from, to) return FileUtils.compare_file(from, to) end
cp(source, destination, options={})
click to toggle source
# File lib/ceedling/file_wrapper.rb, line 43 def cp(source, destination, options={}) FileUtils.cp(source, destination, **options) end
directory?(path)
click to toggle source
# File lib/ceedling/file_wrapper.rb, line 23 def directory?(path) return File.directory?(path) end
directory_listing(glob)
click to toggle source
# File lib/ceedling/file_wrapper.rb, line 31 def directory_listing(glob) return Dir.glob(glob, File::FNM_PATHNAME) end
dirname(path)
click to toggle source
# File lib/ceedling/file_wrapper.rb, line 27 def dirname(path) return File.dirname(path) end
exist?(filepath)
click to toggle source
# File lib/ceedling/file_wrapper.rb, line 18 def exist?(filepath) return true if (filepath == NULL_FILE_PATH) return File.exist?(filepath) end
get_expanded_path(path)
click to toggle source
# File lib/ceedling/file_wrapper.rb, line 9 def get_expanded_path(path) return File.expand_path(path) end
instantiate_file_list(files=[])
click to toggle source
# File lib/ceedling/file_wrapper.rb, line 75 def instantiate_file_list(files=[]) return FileList.new(files) end
mkdir(folder)
click to toggle source
# File lib/ceedling/file_wrapper.rb, line 79 def mkdir(folder) return FileUtils.mkdir_p(folder) end
open(filepath, flags) { |file| ... }
click to toggle source
# File lib/ceedling/file_wrapper.rb, line 51 def open(filepath, flags) File.open(filepath, flags) do |file| yield(file) end end
read(filepath)
click to toggle source
# File lib/ceedling/file_wrapper.rb, line 57 def read(filepath) return File.read(filepath) end
readlines(filepath)
click to toggle source
# File lib/ceedling/file_wrapper.rb, line 71 def readlines(filepath) return File.readlines(filepath) end
rm_f(filepath, options={})
click to toggle source
# File lib/ceedling/file_wrapper.rb, line 35 def rm_f(filepath, options={}) FileUtils.rm_f(filepath, **options) end
rm_r(filepath, options={})
click to toggle source
# File lib/ceedling/file_wrapper.rb, line 39 def rm_r(filepath, options={}) FileUtils.rm_r(filepath, **options={}) end
touch(filepath, options={})
click to toggle source
# File lib/ceedling/file_wrapper.rb, line 61 def touch(filepath, options={}) FileUtils.touch(filepath, **options) end
write(filepath, contents, flags='w')
click to toggle source
# File lib/ceedling/file_wrapper.rb, line 65 def write(filepath, contents, flags='w') File.open(filepath, flags) do |file| file.write(contents) end end