cloud-templates 0.2.0 → 0.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.rspec +4 -0
- data/.rubocop.yml +1 -0
- data/Rakefile +1 -1
- data/bin/cloud-templates-runner.rb +5 -0
- data/cloud-templates.gemspec +9 -4
- data/examples/lib/user_directory.rb +0 -10
- data/examples/lib/user_directory/artifacts.rb +8 -0
- data/examples/lib/user_directory/artifacts/catalogized.rb +8 -7
- data/examples/lib/user_directory/artifacts/group.rb +27 -30
- data/examples/lib/user_directory/artifacts/ided.rb +8 -7
- data/examples/lib/user_directory/artifacts/organization.rb +10 -11
- data/examples/lib/user_directory/artifacts/pathed.rb +17 -17
- data/examples/lib/user_directory/artifacts/person.rb +20 -15
- data/examples/lib/user_directory/artifacts/team.rb +26 -21
- data/examples/lib/user_directory/artifacts/unit.rb +15 -17
- data/examples/lib/user_directory/artifacts/user.rb +26 -23
- data/examples/lib/user_directory/render.rb +8 -0
- data/examples/lib/user_directory/render/etc.rb +2 -0
- data/examples/lib/user_directory/render/etc/artifact_view.rb +2 -2
- data/examples/lib/user_directory/render/etc/composite_view.rb +1 -2
- data/examples/lib/user_directory/render/etc/group_view.rb +3 -3
- data/examples/lib/user_directory/render/etc/person_view.rb +2 -2
- data/examples/lib/user_directory/render/etc/registry.rb +4 -6
- data/examples/lib/user_directory/render/etc/user_view.rb +2 -3
- data/examples/lib/user_directory/render/ldap.rb +2 -0
- data/examples/lib/user_directory/render/ldap/artifact_view.rb +3 -4
- data/examples/lib/user_directory/render/ldap/composite_view.rb +3 -4
- data/examples/lib/user_directory/render/ldap/group_view.rb +3 -4
- data/examples/lib/user_directory/render/ldap/organization_view.rb +3 -4
- data/examples/lib/user_directory/render/ldap/person_view.rb +3 -4
- data/examples/lib/user_directory/render/ldap/registry.rb +3 -4
- data/examples/lib/user_directory/render/ldap/unit_view.rb +3 -4
- data/examples/lib/user_directory/render/ldap/user_view.rb +3 -4
- data/examples/lib/user_directory/utils.rb +1 -1
- data/examples/spec/user_directory_spec.rb +24 -25
- data/lib/aws/templates.rb +0 -8
- data/lib/aws/templates/artifact.rb +20 -12
- data/lib/aws/templates/cli.rb +14 -0
- data/lib/aws/templates/cli/formatter.rb +21 -0
- data/lib/aws/templates/cli/formatter/json.rb +20 -0
- data/lib/aws/templates/cli/interface.rb +92 -0
- data/lib/aws/templates/composite.rb +6 -9
- data/lib/aws/templates/exception.rb +8 -0
- data/lib/aws/templates/exception/nested_parameter_exception.rb +19 -0
- data/lib/aws/templates/exception/option_error.rb +14 -0
- data/lib/aws/templates/exception/option_scalar_on_the_way.rb +26 -0
- data/lib/aws/templates/exception/option_should_be_recursive.rb +20 -0
- data/lib/aws/templates/exception/option_value_deleted.rb +22 -0
- data/lib/aws/templates/exception/parameter_already_exist.rb +26 -0
- data/lib/aws/templates/exception/parameter_exception.rb +26 -0
- data/lib/aws/templates/exception/parameter_getter_is_not_defined.rb +23 -0
- data/lib/aws/templates/exception/parameter_method_name_conflict.rb +26 -0
- data/lib/aws/templates/exception/parameter_specification_is_invalid.rb +30 -0
- data/lib/aws/templates/exception/parameter_value_invalid.rb +37 -0
- data/lib/aws/templates/exception/parametrized_dsl_error.rb +14 -0
- data/lib/aws/templates/exception/view_not_found.rb +26 -0
- data/lib/aws/templates/help.rb +43 -0
- data/lib/aws/templates/help/aggregate.rb +74 -0
- data/lib/aws/templates/help/dsl.rb +30 -0
- data/lib/aws/templates/help/provider.rb +15 -0
- data/lib/aws/templates/help/rdoc.rb +105 -0
- data/lib/aws/templates/help/rdoc/artifact.rb +50 -0
- data/lib/aws/templates/help/rdoc/composite.rb +20 -0
- data/lib/aws/templates/help/rdoc/contextualized.rb +12 -0
- data/lib/aws/templates/help/rdoc/contextualized/filter.rb +19 -0
- data/lib/aws/templates/help/rdoc/contextualized/filters.rb +14 -0
- data/lib/aws/templates/help/rdoc/contextualized/filters/add.rb +21 -0
- data/lib/aws/templates/help/rdoc/contextualized/filters/chain.rb +33 -0
- data/lib/aws/templates/help/rdoc/contextualized/filters/copy.rb +23 -0
- data/lib/aws/templates/help/rdoc/contextualized/filters/identity.rb +23 -0
- data/lib/aws/templates/help/rdoc/contextualized/filters/override.rb +29 -0
- data/lib/aws/templates/help/rdoc/contextualized/filters/proxy.rb +28 -0
- data/lib/aws/templates/help/rdoc/contextualized/filters/recursive_schema_filter.rb +28 -0
- data/lib/aws/templates/help/rdoc/contextualized/filters/remove.rb +21 -0
- data/lib/aws/templates/help/rdoc/contextualized/filters/scoped.rb +29 -0
- data/lib/aws/templates/help/rdoc/contextualized/provider.rb +28 -0
- data/lib/aws/templates/help/rdoc/default.rb +12 -0
- data/lib/aws/templates/help/rdoc/default/definition.rb +89 -0
- data/lib/aws/templates/help/rdoc/default/provider.rb +25 -0
- data/lib/aws/templates/help/rdoc/dsl.rb +20 -0
- data/lib/aws/templates/help/rdoc/inheritable.rb +48 -0
- data/lib/aws/templates/help/rdoc/parametrized.rb +12 -0
- data/lib/aws/templates/help/rdoc/parametrized/constraint.rb +31 -0
- data/lib/aws/templates/help/rdoc/parametrized/constraints.rb +14 -0
- data/lib/aws/templates/help/rdoc/parametrized/constraints/all_of.rb +39 -0
- data/lib/aws/templates/help/rdoc/parametrized/constraints/condition.rb +44 -0
- data/lib/aws/templates/help/rdoc/parametrized/constraints/depends_on_value.rb +41 -0
- data/lib/aws/templates/help/rdoc/parametrized/constraints/enum.rb +33 -0
- data/lib/aws/templates/help/rdoc/parametrized/constraints/matches.rb +27 -0
- data/lib/aws/templates/help/rdoc/parametrized/constraints/not_nil.rb +27 -0
- data/lib/aws/templates/help/rdoc/parametrized/constraints/requires.rb +33 -0
- data/lib/aws/templates/help/rdoc/parametrized/constraints/satisfies_condition.rb +28 -0
- data/lib/aws/templates/help/rdoc/parametrized/getter.rb +17 -0
- data/lib/aws/templates/help/rdoc/parametrized/getters.rb +14 -0
- data/lib/aws/templates/help/rdoc/parametrized/nested.rb +32 -0
- data/lib/aws/templates/help/rdoc/parametrized/parameter.rb +55 -0
- data/lib/aws/templates/help/rdoc/parametrized/provider.rb +32 -0
- data/lib/aws/templates/help/rdoc/parametrized/transformation.rb +17 -0
- data/lib/aws/templates/help/rdoc/parametrized/transformations.rb +14 -0
- data/lib/aws/templates/help/rdoc/parametrized/transformations/as_boolean.rb +25 -0
- data/lib/aws/templates/help/rdoc/parametrized/transformations/as_chain.rb +34 -0
- data/lib/aws/templates/help/rdoc/parametrized/transformations/as_hash.rb +40 -0
- data/lib/aws/templates/help/rdoc/parametrized/transformations/as_integer.rb +26 -0
- data/lib/aws/templates/help/rdoc/parametrized/transformations/as_list.rb +32 -0
- data/lib/aws/templates/help/rdoc/parametrized/transformations/as_module.rb +25 -0
- data/lib/aws/templates/help/rdoc/parametrized/transformations/as_object.rb +32 -0
- data/lib/aws/templates/help/rdoc/parametrized/transformations/as_rendered.rb +28 -0
- data/lib/aws/templates/help/rdoc/parametrized/transformations/as_string.rb +25 -0
- data/lib/aws/templates/help/rdoc/provider.rb +20 -0
- data/lib/aws/templates/help/rdoc/routing.rb +104 -0
- data/lib/aws/templates/help/rdoc/texting.rb +42 -0
- data/lib/aws/templates/processor.rb +53 -0
- data/lib/aws/templates/processor/handler.rb +104 -0
- data/lib/aws/templates/processor/registry.rb +74 -0
- data/lib/aws/templates/processor/routing.rb +27 -0
- data/lib/aws/templates/render.rb +27 -25
- data/lib/aws/templates/render/basic_view.rb +47 -0
- data/lib/aws/templates/render/utils.rb +14 -0
- data/lib/aws/templates/render/utils/base_type_views.rb +12 -19
- data/lib/aws/templates/render/utils/inspect.rb +2 -4
- data/lib/aws/templates/render/utils/stringify.rb +2 -5
- data/lib/aws/templates/render/view.rb +3 -100
- data/lib/aws/templates/utils.rb +39 -15
- data/lib/aws/templates/utils/artifact_storage.rb +2 -3
- data/lib/aws/templates/utils/{named.rb → as_named.rb} +2 -3
- data/lib/aws/templates/utils/autoload.rb +224 -0
- data/lib/aws/templates/utils/contextualized.rb +8 -17
- data/lib/aws/templates/utils/contextualized/filter.rb +62 -0
- data/lib/aws/templates/utils/contextualized/filter/add.rb +67 -0
- data/lib/aws/templates/utils/contextualized/filter/chain.rb +56 -0
- data/lib/aws/templates/utils/contextualized/filter/copy.rb +38 -0
- data/lib/aws/templates/utils/contextualized/filter/dsl.rb +50 -0
- data/lib/aws/templates/utils/contextualized/filter/identity.rb +45 -0
- data/lib/aws/templates/utils/contextualized/filter/override.rb +62 -0
- data/lib/aws/templates/utils/contextualized/filter/proxy.rb +29 -0
- data/lib/aws/templates/utils/contextualized/filter/recursive_schema_filter.rb +46 -0
- data/lib/aws/templates/utils/contextualized/filter/remove.rb +66 -0
- data/lib/aws/templates/utils/contextualized/filter/scoped.rb +42 -0
- data/lib/aws/templates/utils/contextualized/refinements.rb +51 -0
- data/lib/aws/templates/utils/default.rb +258 -50
- data/lib/aws/templates/utils/dependency.rb +7 -6
- data/lib/aws/templates/utils/dependency/refinements.rb +80 -0
- data/lib/aws/templates/utils/dependent.rb +6 -3
- data/lib/aws/templates/utils/guarded.rb +30 -0
- data/lib/aws/templates/utils/inheritable.rb +21 -16
- data/lib/aws/templates/utils/inspectable.rb +4 -4
- data/lib/aws/templates/utils/late_bound.rb +2 -2
- data/lib/aws/templates/utils/memoized.rb +2 -0
- data/lib/aws/templates/utils/options.rb +49 -35
- data/lib/aws/templates/utils/parametrized.rb +32 -25
- data/lib/aws/templates/utils/parametrized/constraint.rb +95 -0
- data/lib/aws/templates/utils/parametrized/constraint/all_of.rb +51 -0
- data/lib/aws/templates/utils/parametrized/constraint/condition.rb +93 -0
- data/lib/aws/templates/utils/parametrized/constraint/depends_on_value.rb +60 -0
- data/lib/aws/templates/utils/parametrized/constraint/dsl.rb +86 -0
- data/lib/aws/templates/utils/parametrized/constraint/enum.rb +45 -0
- data/lib/aws/templates/utils/parametrized/constraint/matches.rb +44 -0
- data/lib/aws/templates/utils/parametrized/constraint/not_nil.rb +38 -0
- data/lib/aws/templates/utils/parametrized/constraint/requires.rb +54 -0
- data/lib/aws/templates/utils/parametrized/constraint/satisfies_condition.rb +55 -0
- data/lib/aws/templates/utils/parametrized/getter.rb +67 -0
- data/lib/aws/templates/utils/parametrized/getter/as_instance_variable.rb +41 -0
- data/lib/aws/templates/utils/parametrized/getter/as_is.rb +37 -0
- data/lib/aws/templates/utils/parametrized/getter/dsl.rb +62 -0
- data/lib/aws/templates/utils/parametrized/getter/one_of.rb +48 -0
- data/lib/aws/templates/utils/parametrized/getter/path.rb +53 -0
- data/lib/aws/templates/utils/parametrized/getter/value.rb +50 -0
- data/lib/aws/templates/utils/parametrized/nested.rb +9 -16
- data/lib/aws/templates/utils/parametrized/transformation.rb +74 -0
- data/lib/aws/templates/utils/parametrized/transformation/as_boolean.rb +42 -0
- data/lib/aws/templates/utils/parametrized/transformation/as_chain.rb +57 -0
- data/lib/aws/templates/utils/parametrized/transformation/as_hash.rb +89 -0
- data/lib/aws/templates/utils/parametrized/transformation/as_integer.rb +39 -0
- data/lib/aws/templates/utils/parametrized/transformation/as_list.rb +97 -0
- data/lib/aws/templates/utils/parametrized/transformation/as_module.rb +42 -0
- data/lib/aws/templates/utils/parametrized/transformation/as_object.rb +76 -0
- data/lib/aws/templates/utils/parametrized/transformation/as_rendered.rb +100 -0
- data/lib/aws/templates/utils/parametrized/transformation/as_string.rb +39 -0
- data/lib/aws/templates/utils/parametrized/transformation/dsl.rb +94 -0
- data/lib/aws/templates/utils/recursive.rb +22 -0
- data/spec/aws/templates/artifact_spec.rb +10 -10
- data/spec/aws/templates/cli_spec.rb +83 -0
- data/spec/aws/templates/composite_spec.rb +6 -4
- data/spec/aws/templates/help/rdoc/artifact_spec.rb +94 -0
- data/spec/aws/templates/help/rdoc/composite_spec.rb +53 -0
- data/spec/aws/templates/help/rdoc/parametrized/constraints/all_of_spec.rb +17 -0
- data/spec/aws/templates/help/rdoc/parametrized/constraints/depends_on_value_spec.rb +21 -0
- data/spec/aws/templates/help/rdoc/parametrized/constraints/enum_spec.rb +17 -0
- data/spec/aws/templates/help/rdoc/parametrized/constraints/matches_spec.rb +17 -0
- data/spec/aws/templates/help/rdoc/parametrized/constraints/satisfies_condition_spec.rb +17 -0
- data/spec/aws/templates/help/rdoc/parametrized/transformations/as_boolean_spec.rb +17 -0
- data/spec/aws/templates/help/rdoc/parametrized/transformations/as_chain_spec.rb +17 -0
- data/spec/aws/templates/help/rdoc/parametrized/transformations/as_hash_spec.rb +72 -0
- data/spec/aws/templates/help/rdoc/parametrized/transformations/as_integer_spec.rb +17 -0
- data/spec/aws/templates/help/rdoc/parametrized/transformations/as_list_spec.rb +39 -0
- data/spec/aws/templates/help/rdoc/parametrized/transformations/as_module_spec.rb +17 -0
- data/spec/aws/templates/help/rdoc/parametrized/transformations/as_object_spec.rb +38 -0
- data/spec/aws/templates/help/rdoc/parametrized/transformations/as_rendered_spec.rb +17 -0
- data/spec/aws/templates/render/utils/base_type_views_spec.rb +9 -11
- data/spec/aws/templates/render_spec.rb +1 -1
- data/spec/aws/templates/utils/as_named_spec.rb +0 -2
- data/spec/aws/templates/utils/autoload_spec.rb +14 -0
- data/spec/aws/templates/utils/contextualized_spec.rb +5 -5
- data/spec/aws/templates/utils/late_bound_spec.rb +2 -2
- data/spec/aws/templates/utils/parametrized/constraint_spec.rb +8 -10
- data/spec/aws/templates/utils/parametrized/getters_spec.rb +6 -7
- data/spec/aws/templates/utils/parametrized/transformation_spec.rb +3 -6
- data/spec/aws/templates/utils/parametrized_spec.rb +9 -10
- data/spec/aws/templates/utils_spec.rb +18 -0
- data/spec/test_empty/stuff.rb +4 -0
- data/spec/test_empty/stuff/here/test.rb +9 -0
- metadata +235 -19
- data/lib/aws/templates/exceptions.rb +0 -221
- data/lib/aws/templates/render/registry.rb +0 -60
- data/lib/aws/templates/utils/contextualized/filters.rb +0 -437
- data/lib/aws/templates/utils/contextualized/hash.rb +0 -13
- data/lib/aws/templates/utils/contextualized/nil.rb +0 -13
- data/lib/aws/templates/utils/contextualized/proc.rb +0 -13
- data/lib/aws/templates/utils/dependency/enumerable.rb +0 -13
- data/lib/aws/templates/utils/dependency/object.rb +0 -46
- data/lib/aws/templates/utils/parametrized/constraints.rb +0 -423
- data/lib/aws/templates/utils/parametrized/getters.rb +0 -293
- data/lib/aws/templates/utils/parametrized/guarded.rb +0 -32
- data/lib/aws/templates/utils/parametrized/transformations.rb +0 -652
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
require 'aws/templates/utils'
|
|
2
|
+
|
|
3
|
+
module Aws
|
|
4
|
+
module Templates
|
|
5
|
+
module Help
|
|
6
|
+
module Rdoc
|
|
7
|
+
module Parametrized
|
|
8
|
+
##
|
|
9
|
+
# Parameter documentation provider
|
|
10
|
+
#
|
|
11
|
+
# Combines parameter description and documentation blocks for constraint, getter and
|
|
12
|
+
# transformation if they are assigned to the parameter.
|
|
13
|
+
class Parameter < Rdoc::Provider
|
|
14
|
+
for_entity Templates::Utils::Parametrized::Parameter
|
|
15
|
+
|
|
16
|
+
def provide
|
|
17
|
+
sub(description) do |s|
|
|
18
|
+
s << list(:BULLET) do |l|
|
|
19
|
+
add_transformation(l)
|
|
20
|
+
add_constraint(l)
|
|
21
|
+
end
|
|
22
|
+
end
|
|
23
|
+
end
|
|
24
|
+
|
|
25
|
+
private
|
|
26
|
+
|
|
27
|
+
def description
|
|
28
|
+
desc = "_#{context.name}_ "
|
|
29
|
+
desc.concat(context.description) if context.description
|
|
30
|
+
text(desc)
|
|
31
|
+
end
|
|
32
|
+
|
|
33
|
+
def add_transformation(l)
|
|
34
|
+
return unless context.transform
|
|
35
|
+
|
|
36
|
+
l << sub(
|
|
37
|
+
text('transformation:'),
|
|
38
|
+
processed_for(context.transform)
|
|
39
|
+
)
|
|
40
|
+
end
|
|
41
|
+
|
|
42
|
+
def add_constraint(l)
|
|
43
|
+
return unless context.constraint
|
|
44
|
+
|
|
45
|
+
l << sub(
|
|
46
|
+
text('constraint:'),
|
|
47
|
+
processed_for(context.constraint)
|
|
48
|
+
)
|
|
49
|
+
end
|
|
50
|
+
end
|
|
51
|
+
end
|
|
52
|
+
end
|
|
53
|
+
end
|
|
54
|
+
end
|
|
55
|
+
end
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
require 'aws/templates/utils'
|
|
2
|
+
|
|
3
|
+
module Aws
|
|
4
|
+
module Templates
|
|
5
|
+
module Help
|
|
6
|
+
module Rdoc
|
|
7
|
+
module Parametrized
|
|
8
|
+
##
|
|
9
|
+
# Parametrized documentation aspect provider
|
|
10
|
+
#
|
|
11
|
+
# Composes documentation blocks of all parameters assigned to the class or its' parents.
|
|
12
|
+
class Provider < Rdoc::Inheritable
|
|
13
|
+
for_entity Templates::Utils::Parametrized
|
|
14
|
+
|
|
15
|
+
header 'Parameters'
|
|
16
|
+
|
|
17
|
+
protected
|
|
18
|
+
|
|
19
|
+
def description_for(mod)
|
|
20
|
+
return if mod.parameters.empty?
|
|
21
|
+
|
|
22
|
+
list do |l|
|
|
23
|
+
mod.parameters
|
|
24
|
+
.each_value { |parameter| l << processed_for(parameter) }
|
|
25
|
+
end
|
|
26
|
+
end
|
|
27
|
+
end
|
|
28
|
+
end
|
|
29
|
+
end
|
|
30
|
+
end
|
|
31
|
+
end
|
|
32
|
+
end
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
require 'aws/templates/utils'
|
|
2
|
+
|
|
3
|
+
module Aws
|
|
4
|
+
module Templates
|
|
5
|
+
module Help
|
|
6
|
+
module Rdoc
|
|
7
|
+
module Parametrized
|
|
8
|
+
##
|
|
9
|
+
# Abstract transformation provider
|
|
10
|
+
class Transformation < Rdoc::Provider
|
|
11
|
+
for_entity Templates::Utils::Parametrized::Transformation
|
|
12
|
+
end
|
|
13
|
+
end
|
|
14
|
+
end
|
|
15
|
+
end
|
|
16
|
+
end
|
|
17
|
+
end
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
require 'aws/templates/utils'
|
|
2
|
+
|
|
3
|
+
module Aws
|
|
4
|
+
module Templates
|
|
5
|
+
module Help
|
|
6
|
+
module Rdoc
|
|
7
|
+
module Parametrized
|
|
8
|
+
module Transformations
|
|
9
|
+
##
|
|
10
|
+
# Boolean transformation documentation
|
|
11
|
+
#
|
|
12
|
+
# Just prints the documentation blurb.
|
|
13
|
+
class AsBoolean < Rdoc::Parametrized::Transformation
|
|
14
|
+
for_entity Templates::Utils::Parametrized::Transformation::AsBoolean
|
|
15
|
+
|
|
16
|
+
def provide
|
|
17
|
+
sub(text('to boolean'))
|
|
18
|
+
end
|
|
19
|
+
end
|
|
20
|
+
end
|
|
21
|
+
end
|
|
22
|
+
end
|
|
23
|
+
end
|
|
24
|
+
end
|
|
25
|
+
end
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
require 'aws/templates/utils'
|
|
2
|
+
|
|
3
|
+
module Aws
|
|
4
|
+
module Templates
|
|
5
|
+
module Help
|
|
6
|
+
module Rdoc
|
|
7
|
+
module Parametrized
|
|
8
|
+
module Transformations
|
|
9
|
+
##
|
|
10
|
+
# Chained transformation documentation
|
|
11
|
+
#
|
|
12
|
+
# Generates documentation blocks for all transformation steps in the chain.
|
|
13
|
+
class AsChain < Rdoc::Parametrized::Transformation
|
|
14
|
+
for_entity Templates::Utils::Parametrized::Transformation::AsChain
|
|
15
|
+
|
|
16
|
+
def provide
|
|
17
|
+
sub(text('as chain of transformations:'), transformations)
|
|
18
|
+
end
|
|
19
|
+
|
|
20
|
+
private
|
|
21
|
+
|
|
22
|
+
def transformations
|
|
23
|
+
context.components
|
|
24
|
+
.lazy
|
|
25
|
+
.map { |c| processed_for(c) }
|
|
26
|
+
.each_with_object(list) { |part, l| l << part }
|
|
27
|
+
end
|
|
28
|
+
end
|
|
29
|
+
end
|
|
30
|
+
end
|
|
31
|
+
end
|
|
32
|
+
end
|
|
33
|
+
end
|
|
34
|
+
end
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
require 'aws/templates/utils'
|
|
2
|
+
|
|
3
|
+
module Aws
|
|
4
|
+
module Templates
|
|
5
|
+
module Help
|
|
6
|
+
module Rdoc
|
|
7
|
+
module Parametrized
|
|
8
|
+
module Transformations
|
|
9
|
+
##
|
|
10
|
+
# Hash transformation documentation
|
|
11
|
+
#
|
|
12
|
+
# Outputs documentation blocks for key and value sub-parameters.
|
|
13
|
+
class AsHash < Rdoc::Parametrized::Transformation
|
|
14
|
+
for_entity Templates::Utils::Parametrized::Transformation::AsHash
|
|
15
|
+
|
|
16
|
+
def provide
|
|
17
|
+
sub(text('as a hash where:'), key_value_description)
|
|
18
|
+
end
|
|
19
|
+
|
|
20
|
+
private
|
|
21
|
+
|
|
22
|
+
def key_value_description
|
|
23
|
+
list(
|
|
24
|
+
:BULLET,
|
|
25
|
+
description_for('key', context.key_parameter),
|
|
26
|
+
description_for('value', context.value_parameter)
|
|
27
|
+
)
|
|
28
|
+
end
|
|
29
|
+
|
|
30
|
+
def description_for(name, value)
|
|
31
|
+
return sub(text("_#{name}_ can be anything")) if value.nil?
|
|
32
|
+
processed_for(value)
|
|
33
|
+
end
|
|
34
|
+
end
|
|
35
|
+
end
|
|
36
|
+
end
|
|
37
|
+
end
|
|
38
|
+
end
|
|
39
|
+
end
|
|
40
|
+
end
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
require 'aws/templates/utils'
|
|
2
|
+
|
|
3
|
+
module Aws
|
|
4
|
+
module Templates
|
|
5
|
+
module Help
|
|
6
|
+
module Rdoc
|
|
7
|
+
module Parametrized
|
|
8
|
+
module Transformations
|
|
9
|
+
##
|
|
10
|
+
# Integer transformation documentation
|
|
11
|
+
#
|
|
12
|
+
# Just prints the blurb since the transformation is not parametrizable.
|
|
13
|
+
class AsInteger < Rdoc::Parametrized::Transformation
|
|
14
|
+
register_in Rdoc
|
|
15
|
+
for_entity Templates::Utils::Parametrized::Transformation::AsInteger
|
|
16
|
+
|
|
17
|
+
def provide
|
|
18
|
+
sub(text('to integer'))
|
|
19
|
+
end
|
|
20
|
+
end
|
|
21
|
+
end
|
|
22
|
+
end
|
|
23
|
+
end
|
|
24
|
+
end
|
|
25
|
+
end
|
|
26
|
+
end
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
require 'aws/templates/utils'
|
|
2
|
+
|
|
3
|
+
module Aws
|
|
4
|
+
module Templates
|
|
5
|
+
module Help
|
|
6
|
+
module Rdoc
|
|
7
|
+
module Parametrized
|
|
8
|
+
module Transformations
|
|
9
|
+
##
|
|
10
|
+
# List transformation documentation
|
|
11
|
+
#
|
|
12
|
+
# Outputs documentation for sub-parameter (element).
|
|
13
|
+
class AsList < Rdoc::Parametrized::Transformation
|
|
14
|
+
for_entity Templates::Utils::Parametrized::Transformation::AsList
|
|
15
|
+
|
|
16
|
+
def provide
|
|
17
|
+
parameter = context.sub_parameter
|
|
18
|
+
sub do |s|
|
|
19
|
+
if parameter.nil?
|
|
20
|
+
s << text('as a list where elements can be anything')
|
|
21
|
+
else
|
|
22
|
+
s << text('as a list where elements are:') << processed_for(parameter)
|
|
23
|
+
end
|
|
24
|
+
end
|
|
25
|
+
end
|
|
26
|
+
end
|
|
27
|
+
end
|
|
28
|
+
end
|
|
29
|
+
end
|
|
30
|
+
end
|
|
31
|
+
end
|
|
32
|
+
end
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
require 'aws/templates/utils'
|
|
2
|
+
|
|
3
|
+
module Aws
|
|
4
|
+
module Templates
|
|
5
|
+
module Help
|
|
6
|
+
module Rdoc
|
|
7
|
+
module Parametrized
|
|
8
|
+
module Transformations
|
|
9
|
+
##
|
|
10
|
+
# Module transformation documentation
|
|
11
|
+
#
|
|
12
|
+
# Just prints documentation blurb since the transformation is not parametrizable.
|
|
13
|
+
class AsModule < Rdoc::Parametrized::Transformation
|
|
14
|
+
for_entity Templates::Utils::Parametrized::Transformation::AsModule
|
|
15
|
+
|
|
16
|
+
def provide
|
|
17
|
+
sub(text('lookup as a module'))
|
|
18
|
+
end
|
|
19
|
+
end
|
|
20
|
+
end
|
|
21
|
+
end
|
|
22
|
+
end
|
|
23
|
+
end
|
|
24
|
+
end
|
|
25
|
+
end
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
require 'aws/templates/utils'
|
|
2
|
+
|
|
3
|
+
module Aws
|
|
4
|
+
module Templates
|
|
5
|
+
module Help
|
|
6
|
+
module Rdoc
|
|
7
|
+
module Parametrized
|
|
8
|
+
module Transformations
|
|
9
|
+
##
|
|
10
|
+
# Object transformation documentation
|
|
11
|
+
#
|
|
12
|
+
# Prints documentation for the transformation of a parameter where nested structure is
|
|
13
|
+
# defined. Nested class description is provided.
|
|
14
|
+
class AsObject < Rdoc::Parametrized::Transformation
|
|
15
|
+
for_entity Templates::Utils::Parametrized::Transformation::AsObject
|
|
16
|
+
|
|
17
|
+
def provide
|
|
18
|
+
klass = processed_for(context.klass)
|
|
19
|
+
|
|
20
|
+
if klass.nil?
|
|
21
|
+
sub(text('as an object'))
|
|
22
|
+
else
|
|
23
|
+
sub(text('as an object with:'), processed_for(context.klass))
|
|
24
|
+
end
|
|
25
|
+
end
|
|
26
|
+
end
|
|
27
|
+
end
|
|
28
|
+
end
|
|
29
|
+
end
|
|
30
|
+
end
|
|
31
|
+
end
|
|
32
|
+
end
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
require 'aws/templates/utils'
|
|
2
|
+
|
|
3
|
+
module Aws
|
|
4
|
+
module Templates
|
|
5
|
+
module Help
|
|
6
|
+
module Rdoc
|
|
7
|
+
module Parametrized
|
|
8
|
+
module Transformations
|
|
9
|
+
##
|
|
10
|
+
# Render transformation documentation
|
|
11
|
+
#
|
|
12
|
+
# Prints Render type and assigned parameters.
|
|
13
|
+
class AsRendered < Rdoc::Parametrized::Transformation
|
|
14
|
+
for_entity Templates::Utils::Parametrized::Transformation::AsRendered
|
|
15
|
+
|
|
16
|
+
def provide
|
|
17
|
+
description = "render with #{context.type}"
|
|
18
|
+
description.concat(" (#{context.parameters})") if context.parameters
|
|
19
|
+
|
|
20
|
+
sub(text(description))
|
|
21
|
+
end
|
|
22
|
+
end
|
|
23
|
+
end
|
|
24
|
+
end
|
|
25
|
+
end
|
|
26
|
+
end
|
|
27
|
+
end
|
|
28
|
+
end
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
require 'aws/templates/utils'
|
|
2
|
+
|
|
3
|
+
module Aws
|
|
4
|
+
module Templates
|
|
5
|
+
module Help
|
|
6
|
+
module Rdoc
|
|
7
|
+
module Parametrized
|
|
8
|
+
module Transformations
|
|
9
|
+
##
|
|
10
|
+
# String transformation documentation
|
|
11
|
+
#
|
|
12
|
+
# Just prints the documentation blurb since the transformation is not parametrizable.
|
|
13
|
+
class AsString < Rdoc::Parametrized::Transformation
|
|
14
|
+
for_entity Templates::Utils::Parametrized::Transformation::AsRendered
|
|
15
|
+
|
|
16
|
+
def provide
|
|
17
|
+
sub(text('to string'))
|
|
18
|
+
end
|
|
19
|
+
end
|
|
20
|
+
end
|
|
21
|
+
end
|
|
22
|
+
end
|
|
23
|
+
end
|
|
24
|
+
end
|
|
25
|
+
end
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
require 'aws/templates/utils'
|
|
2
|
+
|
|
3
|
+
module Aws
|
|
4
|
+
module Templates
|
|
5
|
+
module Help
|
|
6
|
+
module Rdoc
|
|
7
|
+
##
|
|
8
|
+
# Abstract Rdoc provider
|
|
9
|
+
class Provider < Help::Provider
|
|
10
|
+
register_in Rdoc
|
|
11
|
+
include Rdoc::Texting
|
|
12
|
+
|
|
13
|
+
def provide
|
|
14
|
+
text "#{context.class.name} (No specific documentation found)"
|
|
15
|
+
end
|
|
16
|
+
end
|
|
17
|
+
end
|
|
18
|
+
end
|
|
19
|
+
end
|
|
20
|
+
end
|
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
require 'aws/templates/utils'
|
|
2
|
+
|
|
3
|
+
module Aws
|
|
4
|
+
module Templates
|
|
5
|
+
module Help
|
|
6
|
+
module Rdoc
|
|
7
|
+
##
|
|
8
|
+
# Lazy provider-entity routing
|
|
9
|
+
#
|
|
10
|
+
# It is used to avoid loading too much code into the memory even when it's not required.
|
|
11
|
+
module Routing
|
|
12
|
+
extend Templates::Processor::Routing
|
|
13
|
+
|
|
14
|
+
register Templates.lazy::Help::Dsl, Rdoc.lazy::Dsl
|
|
15
|
+
register Templates.lazy::Artifact, Rdoc.lazy::Artifact
|
|
16
|
+
register Templates.lazy::Composite, Rdoc.lazy::Composite
|
|
17
|
+
|
|
18
|
+
register Templates.lazy::Utils::Default, Rdoc.lazy::Default::Provider
|
|
19
|
+
register Templates.lazy::Utils::Default::Definition, Rdoc.lazy::Default::Definition
|
|
20
|
+
register Templates.lazy::Utils::Default::Definition::Empty,
|
|
21
|
+
Rdoc.lazy::Default::Definition::Empty
|
|
22
|
+
register Templates.lazy::Utils::Default::Definition::Pair,
|
|
23
|
+
Rdoc.lazy::Default::Definition::Pair
|
|
24
|
+
register Templates.lazy::Utils::Default::Definition::Calculable,
|
|
25
|
+
Rdoc.lazy::Default::Definition::Calculable
|
|
26
|
+
register Templates.lazy::Utils::Default::Definition::Scheme,
|
|
27
|
+
Rdoc.lazy::Default::Definition::Scheme
|
|
28
|
+
|
|
29
|
+
register Templates.lazy::Utils::Parametrized, Rdoc.lazy::Parametrized::Provider
|
|
30
|
+
register Templates.lazy::Utils::Parametrized::Parameter,
|
|
31
|
+
Rdoc.lazy::Parametrized::Parameter
|
|
32
|
+
register Templates.lazy::Utils::Parametrized::Nested, Rdoc.lazy::Parametrized::Nested
|
|
33
|
+
register Templates.lazy::Utils::Parametrized::Constraint,
|
|
34
|
+
Rdoc.lazy::Parametrized::Constraint
|
|
35
|
+
register Templates.lazy::Utils::Parametrized::Constraint::AllOf,
|
|
36
|
+
Rdoc.lazy::Parametrized::Constraints::AllOf
|
|
37
|
+
register Templates.lazy::Utils::Parametrized::Constraint::DependsOnValue,
|
|
38
|
+
Rdoc.lazy::Parametrized::Constraints::DependsOnValue
|
|
39
|
+
register Templates.lazy::Utils::Parametrized::Constraint::Enum,
|
|
40
|
+
Rdoc.lazy::Parametrized::Constraints::Enum
|
|
41
|
+
register Templates.lazy::Utils::Parametrized::Constraint::Matches,
|
|
42
|
+
Rdoc.lazy::Parametrized::Constraints::Matches
|
|
43
|
+
register Templates.lazy::Utils::Parametrized::Constraint::NotNil,
|
|
44
|
+
Rdoc.lazy::Parametrized::Constraints::NotNil
|
|
45
|
+
register Templates.lazy::Utils::Parametrized::Constraint::Requires,
|
|
46
|
+
Rdoc.lazy::Parametrized::Constraints::Requires
|
|
47
|
+
register Templates.lazy::Utils::Parametrized::Constraint::SatisfiesCondition,
|
|
48
|
+
Rdoc.lazy::Parametrized::Constraints::SatisfiesCondition
|
|
49
|
+
|
|
50
|
+
register Templates.lazy::Utils::Parametrized::Constraint::Condition,
|
|
51
|
+
Rdoc.lazy::Parametrized::Constraints::Condition
|
|
52
|
+
register Templates.lazy::Utils::Parametrized::Constraint::Condition::Equal,
|
|
53
|
+
Rdoc.lazy::Parametrized::Constraints::Condition::Equal
|
|
54
|
+
register Templates.lazy::Utils::Parametrized::Constraint::Condition::Conditional,
|
|
55
|
+
Rdoc.lazy::Parametrized::Constraints::Condition::Conditional
|
|
56
|
+
|
|
57
|
+
register Templates.lazy::Utils::Parametrized::Getter,
|
|
58
|
+
Rdoc.lazy::Parametrized::Getter
|
|
59
|
+
|
|
60
|
+
register Templates.lazy::Utils::Parametrized::Transformation,
|
|
61
|
+
Rdoc.lazy::Parametrized::Transformation
|
|
62
|
+
register Templates.lazy::Utils::Parametrized::Transformation::AsBoolean,
|
|
63
|
+
Rdoc.lazy::Parametrized::Transformations::AsBoolean
|
|
64
|
+
register Templates.lazy::Utils::Parametrized::Transformation::AsChain,
|
|
65
|
+
Rdoc.lazy::Parametrized::Transformations::AsChain
|
|
66
|
+
register Templates.lazy::Utils::Parametrized::Transformation::AsHash,
|
|
67
|
+
Rdoc.lazy::Parametrized::Transformations::AsHash
|
|
68
|
+
register Templates.lazy::Utils::Parametrized::Transformation::AsInteger,
|
|
69
|
+
Rdoc.lazy::Parametrized::Transformations::AsInteger
|
|
70
|
+
register Templates.lazy::Utils::Parametrized::Transformation::AsList,
|
|
71
|
+
Rdoc.lazy::Parametrized::Transformations::AsList
|
|
72
|
+
register Templates.lazy::Utils::Parametrized::Transformation::AsModule,
|
|
73
|
+
Rdoc.lazy::Parametrized::Transformations::AsModule
|
|
74
|
+
register Templates.lazy::Utils::Parametrized::Transformation::AsObject,
|
|
75
|
+
Rdoc.lazy::Parametrized::Transformations::AsObject
|
|
76
|
+
register Templates.lazy::Utils::Parametrized::Transformation::AsRendered,
|
|
77
|
+
Rdoc.lazy::Parametrized::Transformations::AsRendered
|
|
78
|
+
register Templates.lazy::Utils::Parametrized::Transformation::AsString,
|
|
79
|
+
Rdoc.lazy::Parametrized::Transformations::AsString
|
|
80
|
+
|
|
81
|
+
register Templates.lazy::Utils::Contextualized, Rdoc.lazy::Contextualized::Provider
|
|
82
|
+
register Templates.lazy::Utils::Contextualized::Filter,
|
|
83
|
+
Rdoc.lazy::Contextualized::Filter
|
|
84
|
+
register Templates.lazy::Utils::Contextualized::Filter::Add,
|
|
85
|
+
Rdoc.lazy::Contextualized::Filters::Add
|
|
86
|
+
register Templates.lazy::Utils::Contextualized::Filter::Chain,
|
|
87
|
+
Rdoc.lazy::Contextualized::Filters::Chain
|
|
88
|
+
register Templates.lazy::Utils::Contextualized::Filter::Copy,
|
|
89
|
+
Rdoc.lazy::Contextualized::Filters::Copy
|
|
90
|
+
register Templates.lazy::Utils::Contextualized::Filter::Identity,
|
|
91
|
+
Rdoc.lazy::Contextualized::Filters::Identity
|
|
92
|
+
register Templates.lazy::Utils::Contextualized::Filter::Override,
|
|
93
|
+
Rdoc.lazy::Contextualized::Filters::Override
|
|
94
|
+
register Templates.lazy::Utils::Contextualized::Filter::Proxy,
|
|
95
|
+
Rdoc.lazy::Contextualized::Filters::Proxy
|
|
96
|
+
register Templates.lazy::Utils::Contextualized::Filter::Remove,
|
|
97
|
+
Rdoc.lazy::Contextualized::Filters::Remove
|
|
98
|
+
register Templates.lazy::Utils::Contextualized::Filter::Scoped,
|
|
99
|
+
Rdoc.lazy::Contextualized::Filters::Scoped
|
|
100
|
+
end
|
|
101
|
+
end
|
|
102
|
+
end
|
|
103
|
+
end
|
|
104
|
+
end
|