Class: Hiiro::Effects::Filesystem
- Inherits:
-
Object
- Object
- Hiiro::Effects::Filesystem
- Defined in:
- lib/hiiro/effects.rb
Overview
Real filesystem implementation.
Instance Method Summary collapse
- #exist?(path) ⇒ Boolean
- #glob(pattern) ⇒ Object
- #mkdir_p(path) ⇒ Object
- #mv(src, dst) ⇒ Object
- #read(path) ⇒ Object
- #rename(src, dst) ⇒ Object
- #rm(path) ⇒ Object
- #write(path, content) ⇒ Object
Instance Method Details
#exist?(path) ⇒ Boolean
86 |
# File 'lib/hiiro/effects.rb', line 86 def exist?(path) = File.exist?(path) |
#glob(pattern) ⇒ Object
88 |
# File 'lib/hiiro/effects.rb', line 88 def glob(pattern) = Dir.glob(pattern) |
#mkdir_p(path) ⇒ Object
87 |
# File 'lib/hiiro/effects.rb', line 87 def mkdir_p(path) = FileUtils.mkdir_p(path) |
#mv(src, dst) ⇒ Object
90 |
# File 'lib/hiiro/effects.rb', line 90 def mv(src, dst) = FileUtils.mv(src, dst) |
#read(path) ⇒ Object
85 |
# File 'lib/hiiro/effects.rb', line 85 def read(path) = File.read(path) |
#rename(src, dst) ⇒ Object
91 |
# File 'lib/hiiro/effects.rb', line 91 def rename(src, dst) = File.rename(src, dst) |
#rm(path) ⇒ Object
89 |
# File 'lib/hiiro/effects.rb', line 89 def rm(path) = File.exist?(path) ? File.delete(path) : nil |
#write(path, content) ⇒ Object
80 81 82 83 |
# File 'lib/hiiro/effects.rb', line 80 def write(path, content) FileUtils.mkdir_p(File.dirname(path)) File.write(path, content) end |