Sha256: 2c4557bfc53c501937b71e8f6adafa6849954df6c256f4b4f5d415429ff372d6

Contents?: true

Size: 805 Bytes

Versions: 8

Compression:

Stored size: 805 Bytes

Contents

module Runbook::Generators
  class DslExtension < Thor::Group
    include ::Runbook::Generators::Base

    source_root File.dirname(__FILE__)

    def self.description
      "Generate a dsl_extension for adding custom runbook DSL functionality"
    end

    def self.long_description
      <<-LONG_DESC
      This generator provides a template for extending Runbook's DSL. Using a
      DSL extension, you can add custom commands to a book, section, or step
      that can be used in your runbooks.
      LONG_DESC
    end

    argument :name, desc: "The name of your dsl_extension, e.x. rollback_section"

    def create_dsl_extension
      target = File.join(
        parent_options[:root],
        "#{name.underscore}.rb",
      )
      template('templates/dsl_extension.tt', target)
    end
  end
end

Version data entries

8 entries across 8 versions & 2 rubygems

Version Path
careacademy-runbook-1.2.0 lib/runbook/generators/dsl_extension/dsl_extension.rb
runbook-1.1.0 lib/runbook/generators/dsl_extension/dsl_extension.rb
runbook-1.0.0 lib/runbook/generators/dsl_extension/dsl_extension.rb
runbook-0.16.1 lib/runbook/generators/dsl_extension/dsl_extension.rb
runbook-0.16.0 lib/runbook/generators/dsl_extension/dsl_extension.rb
runbook-0.15.0 lib/runbook/generators/dsl_extension/dsl_extension.rb
runbook-0.14.0 lib/runbook/generators/dsl_extension/dsl_extension.rb
runbook-0.13.0 lib/runbook/generators/dsl_extension/dsl_extension.rb