Class: BatchRename::Editor::DiffMerge

Inherits:
EditorBase
  • Object
show all
Defined in:
lib/batch_rename/editor/diff_merge.rb

Constant Summary collapse

PATH =
'diffmerge'

Instance Attribute Summary

Attributes inherited from EditorBase

#caption, #catalogs

Instance Method Summary collapse

Methods inherited from EditorBase

#result

Instance Method Details

#argsObject



14
15
16
17
18
19
20
21
22
23
24
# File 'lib/batch_rename/editor/diff_merge.rb', line 14

def args
  args = ['--nosplash']
  args << "-c=#{ caption }" if caption

  catalogs.each_with_index do |catalog, index|
    args << "-t#{ index+1 }=#{ catalog.title }"
    args << catalog.file_name
  end

  args
end

#launch!Object



7
8
9
10
11
12
# File 'lib/batch_rename/editor/diff_merge.rb', line 7

def launch!
  unless system(PATH, *args)
    raise(Editor::EditorNotFoundError.new(PATH))
  end
  self
end