Class: HelloWorldPlugin
- Inherits:
-
Architect::Plugin
- Object
- Architect::Plugin
- HelloWorldPlugin
- 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
Instance Method Summary collapse
-
#check ⇒ Object
Check to see if any actions need to be taken, and return a list of Architect::ChangeRequest objects for each proposed action.
- #configure(config_hash) ⇒ Object
-
#design ⇒ Object
Ask questions during the design of a new plan; i.e.
-
#execute ⇒ Object
Execute the proposed actions based on the current plan.
-
#initialize ⇒ HelloWorldPlugin
constructor
A new instance of HelloWorldPlugin.
-
#plan(yaml) ⇒ Object
Parse a YAML plan file and perform validation.
Methods inherited from Architect::Plugin
Constructor Details
#initialize ⇒ HelloWorldPlugin
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
#check ⇒ Object
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 |
#design ⇒ Object
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 |
#execute ⇒ Object
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 |