Class: VimDiff::Generator

Inherits:
Object
  • Object
show all
Defined in:
lib/vim_diff.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(left_file_path, right_file_path, html_diff_path) ⇒ Generator

Returns a new instance of Generator.



10
11
12
13
14
# File 'lib/vim_diff.rb', line 10

def initialize(left_file_path, right_file_path, html_diff_path)
  self.left_file_path  = left_file_path
  self.right_file_path = right_file_path
  self.html_diff_path  = html_diff_path
end

Instance Attribute Details

#html_diff_pathObject

Returns the value of attribute html_diff_path.



8
9
10
# File 'lib/vim_diff.rb', line 8

def html_diff_path
  @html_diff_path
end

#left_file_pathObject

Returns the value of attribute left_file_path.



6
7
8
# File 'lib/vim_diff.rb', line 6

def left_file_path
  @left_file_path
end

#right_file_pathObject

Returns the value of attribute right_file_path.



7
8
9
# File 'lib/vim_diff.rb', line 7

def right_file_path
  @right_file_path
end

Instance Method Details

#generateObject



16
17
18
19
20
# File 'lib/vim_diff.rb', line 16

def generate
  command = ("nohup vimdiff #{self.left_file_path} #{self.right_file_path} -c TOhtml  -c 'w! #{self.html_diff_path}' -c 'qa!'")
  say `#{command}`
  say "Generated file to #{self.html_diff_path}"
end