Class: Ehbrs::Tools::RunnerWith::FilesystemRenamer::RenameFile
- Inherits:
-
Object
- Object
- Ehbrs::Tools::RunnerWith::FilesystemRenamer::RenameFile
- Defined in:
- lib/ehbrs/tools/runner_with/filesystem_renamer.rb
Constant Summary collapse
- CONFIRM_MESSAGE =
'Rename?'
Instance Method Summary collapse
Instance Method Details
#rename ⇒ Object
29 30 31 32 33 34 |
# File 'lib/ehbrs/tools/runner_with/filesystem_renamer.rb', line 29 def rename return unless rename? show do_rename if runner.confirm?(CONFIRM_MESSAGE) end |
#rename? ⇒ Boolean
37 38 39 |
# File 'lib/ehbrs/tools/runner_with/filesystem_renamer.rb', line 37 def rename? path.to_pathname != target_path.to_pathname end |
#show ⇒ Object
21 22 23 24 25 26 27 |
# File 'lib/ehbrs/tools/runner_with/filesystem_renamer.rb', line 21 def show if rename? puts [target_path_to_s, '<='.green, path_to_s].join(' ') else puts path_to_s end end |