Class: NCRENAME_RENAME_VARIABLE_cmd
- Inherits:
-
InplaceCommand
- Object
- FileCommand
- InplaceCommand
- NCRENAME_RENAME_VARIABLE_cmd
- Includes:
- NCO_warning_filter
- Defined in:
- lib/file_command.rb
Instance Method Summary collapse
- #cmd_txt_inplace(file) ⇒ Object
-
#initialize(old_name, new_name) ⇒ NCRENAME_RENAME_VARIABLE_cmd
constructor
A new instance of NCRENAME_RENAME_VARIABLE_cmd.
Methods included from NCO_warning_filter
Methods inherited from InplaceCommand
Methods inherited from FileCommand
Constructor Details
#initialize(old_name, new_name) ⇒ NCRENAME_RENAME_VARIABLE_cmd
Returns a new instance of NCRENAME_RENAME_VARIABLE_cmd.
317 318 319 |
# File 'lib/file_command.rb', line 317 def initialize(old_name, new_name) @old_name, @new_name = old_name, new_name end |
Instance Method Details
#cmd_txt_inplace(file) ⇒ Object
321 322 323 324 325 326 327 |
# File 'lib/file_command.rb', line 321 def cmd_txt_inplace(file) if @old_name == @new_name %Q(#{SYSTEM_COMMANDS::SHELLNOOP}) # shell noop as ncrename fails with an error if the new name is the same as the old name else %Q(#{SYSTEM_COMMANDS::NCRENAME} -h -v #{@old_name},#{@new_name} #{file}) end end |