Module: DaisyDiff

Defined in:
lib/daisydiff.rb,
lib/daisydiff/version.rb

Defined Under Namespace

Classes: Result

Constant Summary collapse

VERSION =
"0.0.2"

Class Method Summary collapse

Class Method Details

.strings(html_1, html_2) ⇒ Object



8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
# File 'lib/daisydiff.rb', line 8

def self.strings(html_1, html_2)
  begin
    file_1 = create_tempfile('html_1', html_1)
    file_2 = create_tempfile('html_2', html_2)
    output_file = create_tempfile('html_diff')

    line = Terrapin::CommandLine.new("java", "-jar :jar_path :file_1_path :file_2_path --file=:output_file_path")
    # puts line.command
    line.run(:jar_path => File.expand_path(File.dirname(__FILE__) + '/daisydiff/daisydiff.jar'), :file_1_path => file_1.path, :file_2_path => file_2.path, :output_file_path => output_file.path)

    results = output_file.read
  # rescue
    #handle the error here?
  ensure
    close_tempfile file_1
    close_tempfile file_2
    close_tempfile output_file
  end

end