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.



5
6
7
# File 'lib/dotdiff/command_wrapper.rb', line 5

def message
  @message
end

Instance Method Details

#failed?Boolean

Returns:

  • (Boolean)


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

def failed?
  @ran_checks && @failed
end

#passed?Boolean

Returns:

  • (Boolean)


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

def passed?
  !failed?
end

#ran_checksObject



28
29
30
# File 'lib/dotdiff/command_wrapper.rb', line 28

def ran_checks
  @ran_checks
end

#run(base_image, new_image) ⇒ Object



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

def run(base_image, new_image)
  output = `#{command(base_image, new_image)}`

  @ran_checks = true

  if output.include?('PASS:')
    @failed = false
  else
    @failed = true
    @message = output.split("\n").join(' ')
  end
end