Class: HelloWorldPlugin

Inherits:
Architect::Plugin show all
Defined in:
lib/architect/plugin/hello_world.rb

Overview

A sample plugin to say “hello world” at every opportunity

Instance Attribute Summary

Attributes inherited from Architect::Plugin

#config, #name

Instance Method Summary collapse

Methods inherited from Architect::Plugin

#register

Constructor Details

#initializeHelloWorldPlugin

Returns a new instance of HelloWorldPlugin.



6
7
8
# File 'lib/architect/plugin/hello_world.rb', line 6

def initialize
  @name = 'hello_world'
end

Instance Method Details

#checkObject

Check to see if any actions need to be taken, and return a list of Architect::ChangeRequest objects for each proposed action



19
20
21
22
# File 'lib/architect/plugin/hello_world.rb', line 19

def check
  say 'hello_world: checking'
  []
end

#configure(config_hash) ⇒ Object



10
11
12
13
14
# File 'lib/architect/plugin/hello_world.rb', line 10

def configure(config_hash)
  @config = OpenStruct.new({ hello: 'world', quiet: false }.merge(config_hash))
  @quiet = @config[:quiet]
  say 'hello_world: configured'
end

#designObject

Ask questions during the design of a new plan; i.e. when architect –design is called.



26
27
28
# File 'lib/architect/plugin/hello_world.rb', line 26

def design
  say 'hello_world: designing'
end

#executeObject

Execute the proposed actions based on the current plan.



36
37
38
# File 'lib/architect/plugin/hello_world.rb', line 36

def execute
  say 'hello_world: executing'
end

#plan(yaml) ⇒ Object

Parse a YAML plan file and perform validation.



31
32
33
# File 'lib/architect/plugin/hello_world.rb', line 31

def plan(yaml)
  say 'hello_world: planning'
end