Module: Bovem::ShellMethods::Write
- Included in:
- Bovem::Shell
- Defined in:
- lib/bovem/shell.rb
Overview
Methods to copy or move entries.
Instance Method Summary (collapse)
-
- (Boolean) copy(src, dst, run = true, show_errors = false, fatal = true)
Copies a set of files or directory to another location.
-
- (Boolean) copy_or_move(src, dst, operation, run = true, show_errors = true, fatal = true)
Copies or moves a set of files or directory to another location.
-
- (Boolean) move(src, dst, run = true, show_errors = false, fatal = true)
Moves a set of files or directory to another location.
Instance Method Details
- (Boolean) copy(src, dst, run = true, show_errors = false, fatal = true)
Copies a set of files or directory to another location.
163 164 165 |
# File 'lib/bovem/shell.rb', line 163 def copy(src, dst, run = true, show_errors = false, fatal = true) copy_or_move(src, dst, :copy, run, show_errors, fatal) end |
- (Boolean) copy_or_move(src, dst, operation, run = true, show_errors = true, fatal = true)
Copies or moves a set of files or directory to another location.
188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 |
# File 'lib/bovem/shell.rb', line 188 def copy_or_move(src, dst, operation, run = true, show_errors = true, fatal = true) rv = true operation, operation_s, single, src, dst = sanitize_copy_or_move(operation, src, dst) if !run then dry_run_copy_or_move(single, operation_s, src, dst) else rv = catch(:rv) do dst_dir = prepare_destination(single, src, dst, operation_s, show_errors, fatal) check_sources(src, operation_s, fatal) execute_copy_or_move(src, dst, dst_dir, single, operation, operation_s, show_errors, fatal) true end end rv end |
- (Boolean) move(src, dst, run = true, show_errors = false, fatal = true)
Moves a set of files or directory to another location.
175 176 177 |
# File 'lib/bovem/shell.rb', line 175 def move(src, dst, run = true, show_errors = false, fatal = true) copy_or_move(src, dst, :move, run, show_errors, fatal) end |