Class: Fitting::Action
- Inherits:
-
Object
show all
- Defined in:
- lib/fitting/action.rb
Defined Under Namespace
Classes: Empty, NotFound, Skip
Class Method Summary
collapse
Instance Method Summary
collapse
Constructor Details
#initialize(action) ⇒ Action
Returns a new instance of Action.
18
19
20
|
# File 'lib/fitting/action.rb', line 18
def initialize(action)
@action = action
end
|
Class Method Details
.all ⇒ Object
26
27
28
|
# File 'lib/fitting/action.rb', line 26
def self.all
[]
end
|
.find!(actions, log) ⇒ Object
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
|
# File 'lib/fitting/action.rb', line 30
def self.find!(actions, log)
host = Fitting::Host.find!(log)
host.cover!
prefix = Fitting::Prefix.find(host: host, log: log)
prefix.cover!
new(prefix.actions.find!(log))
rescue Fitting::Report::Actions::Empty,
Fitting::Host::Skip,
Fitting::Prefix::Skip
raise Skip
rescue Fitting::Report::Combinations::Empty,
Fitting::Report::Combinations::NotFound
raise Skip
rescue Fitting::Host::NotFound,
Fitting::Prefix::NotFound,
Fitting::Report::Actions::NotFound,
Fitting::Report::Responses::NotFound => e
raise NotFound.new(e.message, log)
end
|
.report(actions) ⇒ Object
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
|
# File 'lib/fitting/action.rb', line 73
def self.report(actions)
all = 0
cover = 0
puts
puts "Coverage #{(cover.to_f / all.to_f * 100).round(2)}%"
exit 1 unless false
exit 0
end
|
Instance Method Details
#action ⇒ Object
22
23
24
|
# File 'lib/fitting/action.rb', line 22
def action
@action
end
|