Class: CM::Sequence::Default

Inherits:
Object
  • Object
show all
Defined in:
lib/CM/sequence/default.rb

Instance Method Summary collapse

Instance Method Details

#forward(operation) ⇒ Object


Operations



23
24
25
26
27
28
29
30
31
32
33
34
35
36
# File 'lib/CM/sequence/default.rb', line 23

def forward(operation)
  super do |success|
    resources.each do |resource|
      resource.execute(operation)
      success = false unless resource.status == code.success

      myself.quit = resource.quit ||
        (((resource.plugin_type == :batch && !Nucleon.parallel?) ||
        resource.plugin_provider != :variables) && plan.trap && plan.step)
      break if quit
    end
    success
  end
end

#normalize(reload) ⇒ Object


Plugin interface



9
10
11
12
# File 'lib/CM/sequence/default.rb', line 9

def normalize(reload)
  super
  yield if block_given?
end

#reverse(operation) ⇒ Object




40
41
42
43
44
45
46
47
48
49
50
51
52
53
# File 'lib/CM/sequence/default.rb', line 40

def reverse(operation)
  super do |success|
    resources.reverse.each do |resource|
      resource.execute(operation)
      success = false unless resource.status == code.success

      myself.quit = resource.quit ||
        (((resource.plugin_type == :batch && !Nucleon.parallel?) ||
        resource.plugin_provider != :variables) && plan.trap && plan.step)
      break if quit
    end
    success
  end
end