Sha256: 2c3945d6288c7ceb7c49c30f16602498e4c3460e3afd905cbd09412a2bde2070
Contents?: true
Size: 1.27 KB
Versions: 8
Compression:
Stored size: 1.27 KB
Contents
# Remember to require this file in a runbook config file # or in your project so it is available in your runbooks module Runbook::Statements class <%= name.classify %> < Runbook::Statement # Add all attributes for your statement attr_reader :attr1, :attr2 # Define the initialize method signature to # match the method signature of your dsl statement def initialize(attr1, attr2) @attr1 = attr1 @attr2 = attr2 end end end # scope this module using your project's namespace module MyProject::RunbookExtensions module <%= "#{name.underscore}_markdown".classify %> def runbook__statements__<%= name.underscore %>(object, output, metadata) # Format how your statement will be displayed when rendered with markdown output << "#{object.attr1}#{object.attr2}" end end Runbook::Views::Markdown.singleton_class.prepend(<%= "#{name.underscore}_markdown".classify %>) module <%= "#{name.underscore}_sshkit".classify %> def runbook__statements__<%= name.underscore %>(object, metadata) # Execute your behavior using object which is your instantiated statement # and the current metadata for this step of the execution end end Runbook::Runs::SSHKit.singleton_class.prepend(<%= "#{name.underscore}_sshkit".classify %>) end
Version data entries
8 entries across 8 versions & 2 rubygems