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

Version Path
careacademy-runbook-1.2.0 lib/runbook/generators/statement/templates/statement.tt
runbook-1.1.0 lib/runbook/generators/statement/templates/statement.tt
runbook-1.0.0 lib/runbook/generators/statement/templates/statement.tt
runbook-0.16.1 lib/runbook/generators/statement/templates/statement.tt
runbook-0.16.0 lib/runbook/generators/statement/templates/statement.tt
runbook-0.15.0 lib/runbook/generators/statement/templates/statement.tt
runbook-0.14.0 lib/runbook/generators/statement/templates/statement.tt
runbook-0.13.0 lib/runbook/generators/statement/templates/statement.tt