Module: Runbook
- Defined in:
- lib/runbook.rb,
lib/runbook/cli.rb,
lib/runbook/dsl.rb,
lib/runbook/run.rb,
lib/runbook/node.rb,
lib/runbook/view.rb,
lib/runbook/hooks.rb,
lib/runbook/entity.rb,
lib/runbook/errors.rb,
lib/runbook/runner.rb,
lib/runbook/viewer.rb,
lib/runbook/toolbox.rb,
lib/runbook/version.rb,
lib/runbook/generator.rb,
lib/runbook/statement.rb,
lib/runbook/initializer.rb,
lib/runbook/util/runbook.rb,
lib/runbook/configuration.rb,
lib/runbook/airbrussh_context.rb
Defined Under Namespace
Modules: CLIBase, DSL, Entities, Extensions, Generators, Helpers, Hooks, Run, Runs, Statements, Util, View, Views
Classes: AirbrusshContext, CLI, Configuration, Entity, Generator, Initializer, Node, Runner, Statement, Toolbox, Viewer
Constant Summary
collapse
- StandardError =
Class.new(::StandardError)
- VERSION =
"1.0.0"
Class Attribute Summary collapse
Class Method Summary
collapse
-
._child_classes(mod) ⇒ Object
-
._child_modules(mod) ⇒ Object
-
.book(title, *tags, labels: {}, &block) ⇒ Object
-
.books ⇒ Object
-
.config ⇒ Object
-
.configure {|configuration| ... } ⇒ Object
-
.deprecator ⇒ Object
-
.entities ⇒ Object
-
.generators ⇒ Object
-
.register(book) ⇒ Object
-
.reset_configuration ⇒ Object
-
.runs ⇒ Object
-
.runtime_methods ⇒ Object
-
.section(title, *tags, labels: {}, &block) ⇒ Object
-
.setup(*tags, labels: {}, &block) ⇒ Object
-
.statements ⇒ Object
-
.step(title = nil, *tags, labels: {}, &block) ⇒ Object
-
.views ⇒ Object
Class Attribute Details
.configuration ⇒ Object
Returns the value of attribute configuration.
3
4
5
|
# File 'lib/runbook/configuration.rb', line 3
def configuration
@configuration
end
|
Class Method Details
._child_classes(mod) ⇒ Object
32
33
34
35
36
|
# File 'lib/runbook/util/runbook.rb', line 32
def self._child_classes(mod)
mod.constants.map { |const|
"#{mod.to_s}::#{const}".constantize
}.select { |const| const.is_a?(Class) }
end
|
._child_modules(mod) ⇒ Object
38
39
40
41
42
|
# File 'lib/runbook/util/runbook.rb', line 38
def self._child_modules(mod)
mod.constants.map { |const|
"#{mod.to_s}::#{const}".constantize
}.select { |const| const.is_a?(Module) }
end
|
.book(title, *tags, labels: {}, &block) ⇒ Object
93
94
95
96
97
98
99
|
# File 'lib/runbook.rb', line 93
def self.book(title, *tags, labels: {}, &block)
Configuration.load_config
Entities::Book.new(title, tags: tags, labels: labels).tap do |book|
book.dsl.instance_eval(&block)
register(book)
end
end
|
.books ⇒ Object
131
132
133
|
# File 'lib/runbook.rb', line 131
def self.books
@books ||= []
end
|
.config ⇒ Object
5
6
7
|
# File 'lib/runbook/configuration.rb', line 5
def config
@configuration
end
|
.deprecator ⇒ Object
22
23
24
25
26
27
28
29
30
|
# File 'lib/runbook/util/runbook.rb', line 22
def self.deprecator
return @deprecator if @deprecator
major_version = Gem::Version.new(Runbook::VERSION).segments[0]
next_major_version = major_version + 1
@deprecator = ActiveSupport::Deprecation.new(
"#{next_major_version}.0",
"Runbook"
)
end
|
.entities ⇒ Object
2
3
4
|
# File 'lib/runbook/util/runbook.rb', line 2
def self.entities
_child_classes(Runbook::Entities)
end
|
.generators ⇒ Object
18
19
20
|
# File 'lib/runbook/util/runbook.rb', line 18
def self.generators
_child_classes(Runbook::Generators)
end
|
.register(book) ⇒ Object
127
128
129
|
# File 'lib/runbook.rb', line 127
def self.register(book)
books << book
end
|
.reset_configuration ⇒ Object
.runs ⇒ Object
10
11
12
|
# File 'lib/runbook/util/runbook.rb', line 10
def self.runs
_child_modules(Runbook::Runs)
end
|
.runtime_methods ⇒ Object
135
136
137
|
# File 'lib/runbook.rb', line 135
def self.runtime_methods
@runtime_methods ||= []
end
|
.section(title, *tags, labels: {}, &block) ⇒ Object
101
102
103
104
105
106
|
# File 'lib/runbook.rb', line 101
def self.section(title, *tags, labels: {}, &block)
Configuration.load_config
Entities::Section.new(title, tags: tags, labels: labels).tap do |section|
section.dsl.instance_eval(&block)
end
end
|
.setup(*tags, labels: {}, &block) ⇒ Object
108
109
110
111
112
113
|
# File 'lib/runbook.rb', line 108
def self.setup(*tags, labels: {}, &block)
Configuration.load_config
Entities::Setup.new(tags: tags, labels: labels).tap do |setup|
setup.dsl.instance_eval(&block)
end
end
|
.statements ⇒ Object
6
7
8
|
# File 'lib/runbook/util/runbook.rb', line 6
def self.statements
_child_classes(Runbook::Statements)
end
|
.step(title = nil, *tags, labels: {}, &block) ⇒ Object
115
116
117
118
119
120
121
122
123
124
125
|
# File 'lib/runbook.rb', line 115
def self.step(title=nil, *tags, labels: {}, &block)
if title.is_a?(Symbol)
tags.unshift(title)
title = nil
end
Configuration.load_config
Entities::Step.new(title, tags: tags, labels: labels).tap do |step|
step.dsl.instance_eval(&block) if block
end
end
|
.views ⇒ Object
14
15
16
|
# File 'lib/runbook/util/runbook.rb', line 14
def self.views
_child_modules(Runbook::Views)
end
|