Class: ChangeLogFileSystem
- Inherits:
-
Object
- Object
- ChangeLogFileSystem
- Defined in:
- lib/change_log_file_system.rb
Instance Method Summary collapse
- #cp(from, to) ⇒ Object
-
#initialize(io) ⇒ ChangeLogFileSystem
constructor
A new instance of ChangeLogFileSystem.
- #rm(path) ⇒ Object
Constructor Details
#initialize(io) ⇒ ChangeLogFileSystem
Returns a new instance of ChangeLogFileSystem.
2 3 4 |
# File 'lib/change_log_file_system.rb', line 2 def initialize io @io = io end |
Instance Method Details
#cp(from, to) ⇒ Object
6 7 8 9 10 |
# File 'lib/change_log_file_system.rb', line 6 def cp from, to to_dir = File.dirname to @io.puts "mkdir -p \"#{to_dir}\"" unless File.exist? to_dir @io.puts "cp -p \"#{from}\" \"#{to}\"" end |
#rm(path) ⇒ Object
12 13 14 |
# File 'lib/change_log_file_system.rb', line 12 def rm path @io.puts "rm \"#{path}\"" end |