Class: DeployRubygem::InspecTestorResult

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

Overview

Using Inspec to deploy and manage Inspec

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(as_json) ⇒ InspecTestorResult

Returns a new instance of InspecTestorResult.



10
11
12
13
14
15
16
17
18
19
20
21
# File 'lib/deploy_rubygem/inspec_result.rb', line 10

def initialize(as_json)
  @as_json = as_json
  @success_control = 0
  @success_result = 0
  @failed_control = 0
  @failed_result = 0
  @pending_control = 0
  @pending_result = 0
  @success_profiles = []
  @failed_profiles = []
  results
end

Instance Attribute Details

#failed_controlObject (readonly)

Returns the value of attribute failed_control.



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

def failed_control
  @failed_control
end

#failed_profilesObject (readonly)

Returns the value of attribute failed_profiles.



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

def failed_profiles
  @failed_profiles
end

#failed_resultObject (readonly)

Returns the value of attribute failed_result.



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

def failed_result
  @failed_result
end

#pending_controlObject (readonly)

Returns the value of attribute pending_control.



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

def pending_control
  @pending_control
end

#pending_resultObject (readonly)

Returns the value of attribute pending_result.



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

def pending_result
  @pending_result
end

#success_controlObject (readonly)

Returns the value of attribute success_control.



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

def success_control
  @success_control
end

#success_profilesObject (readonly)

Returns the value of attribute success_profiles.



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

def success_profiles
  @success_profiles
end

#success_resultObject (readonly)

Returns the value of attribute success_result.



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

def success_result
  @success_result
end

Instance Method Details

#controlsObject



31
32
33
# File 'lib/deploy_rubygem/inspec_result.rb', line 31

def controls
  profile['controls']
end

#profileObject



23
24
25
# File 'lib/deploy_rubygem/inspec_result.rb', line 23

def profile
  @as_json['profiles'].first
end

#result_summaryObject



35
36
37
38
39
40
41
42
43
44
# File 'lib/deploy_rubygem/inspec_result.rb', line 35

def result_summary
  {
    success_control: success_control,
    success_result: success_result,
    failed_control: failed_control,
    failed_result: failed_result,
    pending_control: pending_control,
    pending_result: pending_result
  }
end

#statusObject



27
28
29
# File 'lib/deploy_rubygem/inspec_result.rb', line 27

def status
  profile['status']
end