Module: Cuboid::Application::PrependMethods

Defined in:
lib/cuboid/application.rb

Instance Method Summary collapse

Instance Method Details

#clean_upObject

Cleans up the framework; should be called after running the audit or after canceling a running scan.

[View source]

53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
# File 'lib/cuboid/application.rb', line 53

def clean_up
    return if @cleaned_up
    @cleaned_up = true

    state.resume

    state.status = :cleanup

    @finish_datetime  = Time.now
    @start_datetime ||= Time.now

    state.running = false

    super if defined? super

    true
end

#runObject

[View source]

31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
# File 'lib/cuboid/application.rb', line 31

def run
    if !self.class.valid_options?( options )
        fail ArgumentError, 'Invalid options!'
    end

    prepare
    return if aborted? || suspended?

    state.status = :running

    super if defined? super

    return if aborted? || suspended?

    clean_up
    state.status = :done

    true
end

#shutdownObject

[View source]

71
72
73
# File 'lib/cuboid/application.rb', line 71

def shutdown
    super if defined? super
end