Class: DotDiff::CommandWrapper

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#messageObject (readonly)

Returns the value of attribute message.



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

def message
  @message
end

#pixelsObject (readonly)

Returns the value of attribute pixels.



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

def pixels
  @pixels
end

Instance Method Details

#failed?Boolean

Returns:

  • (Boolean)


25
26
27
# File 'lib/dotdiff/command_wrapper.rb', line 25

def failed?
  @failed
end

#passed?Boolean

Returns:

  • (Boolean)


21
22
23
# File 'lib/dotdiff/command_wrapper.rb', line 21

def passed?
  !failed?
end

#run(base_image, new_image, diff_image_path) ⇒ Object



9
10
11
12
13
14
15
16
17
18
19
# File 'lib/dotdiff/command_wrapper.rb', line 9

def run(base_image, new_image, diff_image_path)
  output = run_command(base_image, new_image, diff_image_path)
  @message = output

  begin
    @pixels = Float(output)
    @failed = false
  rescue ArgumentError
    @failed = true
  end
end