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.
Files changed (225) hide show
  1. checksums.yaml +4 -4
  2. data/.rspec +4 -0
  3. data/.rubocop.yml +1 -0
  4. data/Rakefile +1 -1
  5. data/bin/cloud-templates-runner.rb +5 -0
  6. data/cloud-templates.gemspec +9 -4
  7. data/examples/lib/user_directory.rb +0 -10
  8. data/examples/lib/user_directory/artifacts.rb +8 -0
  9. data/examples/lib/user_directory/artifacts/catalogized.rb +8 -7
  10. data/examples/lib/user_directory/artifacts/group.rb +27 -30
  11. data/examples/lib/user_directory/artifacts/ided.rb +8 -7
  12. data/examples/lib/user_directory/artifacts/organization.rb +10 -11
  13. data/examples/lib/user_directory/artifacts/pathed.rb +17 -17
  14. data/examples/lib/user_directory/artifacts/person.rb +20 -15
  15. data/examples/lib/user_directory/artifacts/team.rb +26 -21
  16. data/examples/lib/user_directory/artifacts/unit.rb +15 -17
  17. data/examples/lib/user_directory/artifacts/user.rb +26 -23
  18. data/examples/lib/user_directory/render.rb +8 -0
  19. data/examples/lib/user_directory/render/etc.rb +2 -0
  20. data/examples/lib/user_directory/render/etc/artifact_view.rb +2 -2
  21. data/examples/lib/user_directory/render/etc/composite_view.rb +1 -2
  22. data/examples/lib/user_directory/render/etc/group_view.rb +3 -3
  23. data/examples/lib/user_directory/render/etc/person_view.rb +2 -2
  24. data/examples/lib/user_directory/render/etc/registry.rb +4 -6
  25. data/examples/lib/user_directory/render/etc/user_view.rb +2 -3
  26. data/examples/lib/user_directory/render/ldap.rb +2 -0
  27. data/examples/lib/user_directory/render/ldap/artifact_view.rb +3 -4
  28. data/examples/lib/user_directory/render/ldap/composite_view.rb +3 -4
  29. data/examples/lib/user_directory/render/ldap/group_view.rb +3 -4
  30. data/examples/lib/user_directory/render/ldap/organization_view.rb +3 -4
  31. data/examples/lib/user_directory/render/ldap/person_view.rb +3 -4
  32. data/examples/lib/user_directory/render/ldap/registry.rb +3 -4
  33. data/examples/lib/user_directory/render/ldap/unit_view.rb +3 -4
  34. data/examples/lib/user_directory/render/ldap/user_view.rb +3 -4
  35. data/examples/lib/user_directory/utils.rb +1 -1
  36. data/examples/spec/user_directory_spec.rb +24 -25
  37. data/lib/aws/templates.rb +0 -8
  38. data/lib/aws/templates/artifact.rb +20 -12
  39. data/lib/aws/templates/cli.rb +14 -0
  40. data/lib/aws/templates/cli/formatter.rb +21 -0
  41. data/lib/aws/templates/cli/formatter/json.rb +20 -0
  42. data/lib/aws/templates/cli/interface.rb +92 -0
  43. data/lib/aws/templates/composite.rb +6 -9
  44. data/lib/aws/templates/exception.rb +8 -0
  45. data/lib/aws/templates/exception/nested_parameter_exception.rb +19 -0
  46. data/lib/aws/templates/exception/option_error.rb +14 -0
  47. data/lib/aws/templates/exception/option_scalar_on_the_way.rb +26 -0
  48. data/lib/aws/templates/exception/option_should_be_recursive.rb +20 -0
  49. data/lib/aws/templates/exception/option_value_deleted.rb +22 -0
  50. data/lib/aws/templates/exception/parameter_already_exist.rb +26 -0
  51. data/lib/aws/templates/exception/parameter_exception.rb +26 -0
  52. data/lib/aws/templates/exception/parameter_getter_is_not_defined.rb +23 -0
  53. data/lib/aws/templates/exception/parameter_method_name_conflict.rb +26 -0
  54. data/lib/aws/templates/exception/parameter_specification_is_invalid.rb +30 -0
  55. data/lib/aws/templates/exception/parameter_value_invalid.rb +37 -0
  56. data/lib/aws/templates/exception/parametrized_dsl_error.rb +14 -0
  57. data/lib/aws/templates/exception/view_not_found.rb +26 -0
  58. data/lib/aws/templates/help.rb +43 -0
  59. data/lib/aws/templates/help/aggregate.rb +74 -0
  60. data/lib/aws/templates/help/dsl.rb +30 -0
  61. data/lib/aws/templates/help/provider.rb +15 -0
  62. data/lib/aws/templates/help/rdoc.rb +105 -0
  63. data/lib/aws/templates/help/rdoc/artifact.rb +50 -0
  64. data/lib/aws/templates/help/rdoc/composite.rb +20 -0
  65. data/lib/aws/templates/help/rdoc/contextualized.rb +12 -0
  66. data/lib/aws/templates/help/rdoc/contextualized/filter.rb +19 -0
  67. data/lib/aws/templates/help/rdoc/contextualized/filters.rb +14 -0
  68. data/lib/aws/templates/help/rdoc/contextualized/filters/add.rb +21 -0
  69. data/lib/aws/templates/help/rdoc/contextualized/filters/chain.rb +33 -0
  70. data/lib/aws/templates/help/rdoc/contextualized/filters/copy.rb +23 -0
  71. data/lib/aws/templates/help/rdoc/contextualized/filters/identity.rb +23 -0
  72. data/lib/aws/templates/help/rdoc/contextualized/filters/override.rb +29 -0
  73. data/lib/aws/templates/help/rdoc/contextualized/filters/proxy.rb +28 -0
  74. data/lib/aws/templates/help/rdoc/contextualized/filters/recursive_schema_filter.rb +28 -0
  75. data/lib/aws/templates/help/rdoc/contextualized/filters/remove.rb +21 -0
  76. data/lib/aws/templates/help/rdoc/contextualized/filters/scoped.rb +29 -0
  77. data/lib/aws/templates/help/rdoc/contextualized/provider.rb +28 -0
  78. data/lib/aws/templates/help/rdoc/default.rb +12 -0
  79. data/lib/aws/templates/help/rdoc/default/definition.rb +89 -0
  80. data/lib/aws/templates/help/rdoc/default/provider.rb +25 -0
  81. data/lib/aws/templates/help/rdoc/dsl.rb +20 -0
  82. data/lib/aws/templates/help/rdoc/inheritable.rb +48 -0
  83. data/lib/aws/templates/help/rdoc/parametrized.rb +12 -0
  84. data/lib/aws/templates/help/rdoc/parametrized/constraint.rb +31 -0
  85. data/lib/aws/templates/help/rdoc/parametrized/constraints.rb +14 -0
  86. data/lib/aws/templates/help/rdoc/parametrized/constraints/all_of.rb +39 -0
  87. data/lib/aws/templates/help/rdoc/parametrized/constraints/condition.rb +44 -0
  88. data/lib/aws/templates/help/rdoc/parametrized/constraints/depends_on_value.rb +41 -0
  89. data/lib/aws/templates/help/rdoc/parametrized/constraints/enum.rb +33 -0
  90. data/lib/aws/templates/help/rdoc/parametrized/constraints/matches.rb +27 -0
  91. data/lib/aws/templates/help/rdoc/parametrized/constraints/not_nil.rb +27 -0
  92. data/lib/aws/templates/help/rdoc/parametrized/constraints/requires.rb +33 -0
  93. data/lib/aws/templates/help/rdoc/parametrized/constraints/satisfies_condition.rb +28 -0
  94. data/lib/aws/templates/help/rdoc/parametrized/getter.rb +17 -0
  95. data/lib/aws/templates/help/rdoc/parametrized/getters.rb +14 -0
  96. data/lib/aws/templates/help/rdoc/parametrized/nested.rb +32 -0
  97. data/lib/aws/templates/help/rdoc/parametrized/parameter.rb +55 -0
  98. data/lib/aws/templates/help/rdoc/parametrized/provider.rb +32 -0
  99. data/lib/aws/templates/help/rdoc/parametrized/transformation.rb +17 -0
  100. data/lib/aws/templates/help/rdoc/parametrized/transformations.rb +14 -0
  101. data/lib/aws/templates/help/rdoc/parametrized/transformations/as_boolean.rb +25 -0
  102. data/lib/aws/templates/help/rdoc/parametrized/transformations/as_chain.rb +34 -0
  103. data/lib/aws/templates/help/rdoc/parametrized/transformations/as_hash.rb +40 -0
  104. data/lib/aws/templates/help/rdoc/parametrized/transformations/as_integer.rb +26 -0
  105. data/lib/aws/templates/help/rdoc/parametrized/transformations/as_list.rb +32 -0
  106. data/lib/aws/templates/help/rdoc/parametrized/transformations/as_module.rb +25 -0
  107. data/lib/aws/templates/help/rdoc/parametrized/transformations/as_object.rb +32 -0
  108. data/lib/aws/templates/help/rdoc/parametrized/transformations/as_rendered.rb +28 -0
  109. data/lib/aws/templates/help/rdoc/parametrized/transformations/as_string.rb +25 -0
  110. data/lib/aws/templates/help/rdoc/provider.rb +20 -0
  111. data/lib/aws/templates/help/rdoc/routing.rb +104 -0
  112. data/lib/aws/templates/help/rdoc/texting.rb +42 -0
  113. data/lib/aws/templates/processor.rb +53 -0
  114. data/lib/aws/templates/processor/handler.rb +104 -0
  115. data/lib/aws/templates/processor/registry.rb +74 -0
  116. data/lib/aws/templates/processor/routing.rb +27 -0
  117. data/lib/aws/templates/render.rb +27 -25
  118. data/lib/aws/templates/render/basic_view.rb +47 -0
  119. data/lib/aws/templates/render/utils.rb +14 -0
  120. data/lib/aws/templates/render/utils/base_type_views.rb +12 -19
  121. data/lib/aws/templates/render/utils/inspect.rb +2 -4
  122. data/lib/aws/templates/render/utils/stringify.rb +2 -5
  123. data/lib/aws/templates/render/view.rb +3 -100
  124. data/lib/aws/templates/utils.rb +39 -15
  125. data/lib/aws/templates/utils/artifact_storage.rb +2 -3
  126. data/lib/aws/templates/utils/{named.rb → as_named.rb} +2 -3
  127. data/lib/aws/templates/utils/autoload.rb +224 -0
  128. data/lib/aws/templates/utils/contextualized.rb +8 -17
  129. data/lib/aws/templates/utils/contextualized/filter.rb +62 -0
  130. data/lib/aws/templates/utils/contextualized/filter/add.rb +67 -0
  131. data/lib/aws/templates/utils/contextualized/filter/chain.rb +56 -0
  132. data/lib/aws/templates/utils/contextualized/filter/copy.rb +38 -0
  133. data/lib/aws/templates/utils/contextualized/filter/dsl.rb +50 -0
  134. data/lib/aws/templates/utils/contextualized/filter/identity.rb +45 -0
  135. data/lib/aws/templates/utils/contextualized/filter/override.rb +62 -0
  136. data/lib/aws/templates/utils/contextualized/filter/proxy.rb +29 -0
  137. data/lib/aws/templates/utils/contextualized/filter/recursive_schema_filter.rb +46 -0
  138. data/lib/aws/templates/utils/contextualized/filter/remove.rb +66 -0
  139. data/lib/aws/templates/utils/contextualized/filter/scoped.rb +42 -0
  140. data/lib/aws/templates/utils/contextualized/refinements.rb +51 -0
  141. data/lib/aws/templates/utils/default.rb +258 -50
  142. data/lib/aws/templates/utils/dependency.rb +7 -6
  143. data/lib/aws/templates/utils/dependency/refinements.rb +80 -0
  144. data/lib/aws/templates/utils/dependent.rb +6 -3
  145. data/lib/aws/templates/utils/guarded.rb +30 -0
  146. data/lib/aws/templates/utils/inheritable.rb +21 -16
  147. data/lib/aws/templates/utils/inspectable.rb +4 -4
  148. data/lib/aws/templates/utils/late_bound.rb +2 -2
  149. data/lib/aws/templates/utils/memoized.rb +2 -0
  150. data/lib/aws/templates/utils/options.rb +49 -35
  151. data/lib/aws/templates/utils/parametrized.rb +32 -25
  152. data/lib/aws/templates/utils/parametrized/constraint.rb +95 -0
  153. data/lib/aws/templates/utils/parametrized/constraint/all_of.rb +51 -0
  154. data/lib/aws/templates/utils/parametrized/constraint/condition.rb +93 -0
  155. data/lib/aws/templates/utils/parametrized/constraint/depends_on_value.rb +60 -0
  156. data/lib/aws/templates/utils/parametrized/constraint/dsl.rb +86 -0
  157. data/lib/aws/templates/utils/parametrized/constraint/enum.rb +45 -0
  158. data/lib/aws/templates/utils/parametrized/constraint/matches.rb +44 -0
  159. data/lib/aws/templates/utils/parametrized/constraint/not_nil.rb +38 -0
  160. data/lib/aws/templates/utils/parametrized/constraint/requires.rb +54 -0
  161. data/lib/aws/templates/utils/parametrized/constraint/satisfies_condition.rb +55 -0
  162. data/lib/aws/templates/utils/parametrized/getter.rb +67 -0
  163. data/lib/aws/templates/utils/parametrized/getter/as_instance_variable.rb +41 -0
  164. data/lib/aws/templates/utils/parametrized/getter/as_is.rb +37 -0
  165. data/lib/aws/templates/utils/parametrized/getter/dsl.rb +62 -0
  166. data/lib/aws/templates/utils/parametrized/getter/one_of.rb +48 -0
  167. data/lib/aws/templates/utils/parametrized/getter/path.rb +53 -0
  168. data/lib/aws/templates/utils/parametrized/getter/value.rb +50 -0
  169. data/lib/aws/templates/utils/parametrized/nested.rb +9 -16
  170. data/lib/aws/templates/utils/parametrized/transformation.rb +74 -0
  171. data/lib/aws/templates/utils/parametrized/transformation/as_boolean.rb +42 -0
  172. data/lib/aws/templates/utils/parametrized/transformation/as_chain.rb +57 -0
  173. data/lib/aws/templates/utils/parametrized/transformation/as_hash.rb +89 -0
  174. data/lib/aws/templates/utils/parametrized/transformation/as_integer.rb +39 -0
  175. data/lib/aws/templates/utils/parametrized/transformation/as_list.rb +97 -0
  176. data/lib/aws/templates/utils/parametrized/transformation/as_module.rb +42 -0
  177. data/lib/aws/templates/utils/parametrized/transformation/as_object.rb +76 -0
  178. data/lib/aws/templates/utils/parametrized/transformation/as_rendered.rb +100 -0
  179. data/lib/aws/templates/utils/parametrized/transformation/as_string.rb +39 -0
  180. data/lib/aws/templates/utils/parametrized/transformation/dsl.rb +94 -0
  181. data/lib/aws/templates/utils/recursive.rb +22 -0
  182. data/spec/aws/templates/artifact_spec.rb +10 -10
  183. data/spec/aws/templates/cli_spec.rb +83 -0
  184. data/spec/aws/templates/composite_spec.rb +6 -4
  185. data/spec/aws/templates/help/rdoc/artifact_spec.rb +94 -0
  186. data/spec/aws/templates/help/rdoc/composite_spec.rb +53 -0
  187. data/spec/aws/templates/help/rdoc/parametrized/constraints/all_of_spec.rb +17 -0
  188. data/spec/aws/templates/help/rdoc/parametrized/constraints/depends_on_value_spec.rb +21 -0
  189. data/spec/aws/templates/help/rdoc/parametrized/constraints/enum_spec.rb +17 -0
  190. data/spec/aws/templates/help/rdoc/parametrized/constraints/matches_spec.rb +17 -0
  191. data/spec/aws/templates/help/rdoc/parametrized/constraints/satisfies_condition_spec.rb +17 -0
  192. data/spec/aws/templates/help/rdoc/parametrized/transformations/as_boolean_spec.rb +17 -0
  193. data/spec/aws/templates/help/rdoc/parametrized/transformations/as_chain_spec.rb +17 -0
  194. data/spec/aws/templates/help/rdoc/parametrized/transformations/as_hash_spec.rb +72 -0
  195. data/spec/aws/templates/help/rdoc/parametrized/transformations/as_integer_spec.rb +17 -0
  196. data/spec/aws/templates/help/rdoc/parametrized/transformations/as_list_spec.rb +39 -0
  197. data/spec/aws/templates/help/rdoc/parametrized/transformations/as_module_spec.rb +17 -0
  198. data/spec/aws/templates/help/rdoc/parametrized/transformations/as_object_spec.rb +38 -0
  199. data/spec/aws/templates/help/rdoc/parametrized/transformations/as_rendered_spec.rb +17 -0
  200. data/spec/aws/templates/render/utils/base_type_views_spec.rb +9 -11
  201. data/spec/aws/templates/render_spec.rb +1 -1
  202. data/spec/aws/templates/utils/as_named_spec.rb +0 -2
  203. data/spec/aws/templates/utils/autoload_spec.rb +14 -0
  204. data/spec/aws/templates/utils/contextualized_spec.rb +5 -5
  205. data/spec/aws/templates/utils/late_bound_spec.rb +2 -2
  206. data/spec/aws/templates/utils/parametrized/constraint_spec.rb +8 -10
  207. data/spec/aws/templates/utils/parametrized/getters_spec.rb +6 -7
  208. data/spec/aws/templates/utils/parametrized/transformation_spec.rb +3 -6
  209. data/spec/aws/templates/utils/parametrized_spec.rb +9 -10
  210. data/spec/aws/templates/utils_spec.rb +18 -0
  211. data/spec/test_empty/stuff.rb +4 -0
  212. data/spec/test_empty/stuff/here/test.rb +9 -0
  213. metadata +235 -19
  214. data/lib/aws/templates/exceptions.rb +0 -221
  215. data/lib/aws/templates/render/registry.rb +0 -60
  216. data/lib/aws/templates/utils/contextualized/filters.rb +0 -437
  217. data/lib/aws/templates/utils/contextualized/hash.rb +0 -13
  218. data/lib/aws/templates/utils/contextualized/nil.rb +0 -13
  219. data/lib/aws/templates/utils/contextualized/proc.rb +0 -13
  220. data/lib/aws/templates/utils/dependency/enumerable.rb +0 -13
  221. data/lib/aws/templates/utils/dependency/object.rb +0 -46
  222. data/lib/aws/templates/utils/parametrized/constraints.rb +0 -423
  223. data/lib/aws/templates/utils/parametrized/getters.rb +0 -293
  224. data/lib/aws/templates/utils/parametrized/guarded.rb +0 -32
  225. data/lib/aws/templates/utils/parametrized/transformations.rb +0 -652
@@ -1,6 +1,5 @@
1
1
  require 'spec_helper'
2
2
  require 'aws/templates/utils/parametrized'
3
- require 'aws/templates/utils/parametrized/getters'
4
3
 
5
4
  module Getters
6
5
  include Aws::Templates::Utils::Parametrized
@@ -78,7 +77,7 @@ describe Aws::Templates::Utils::Parametrized::Getter do
78
77
  hash
79
78
  end
80
79
 
81
- context 'static path is specified' do
80
+ context 'with static path' do
82
81
  let(:getter) { Getters.path(:object, :something) }
83
82
 
84
83
  it 'returns value correctly' do
@@ -86,7 +85,7 @@ describe Aws::Templates::Utils::Parametrized::Getter do
86
85
  end
87
86
  end
88
87
 
89
- context 'dynamic path is specified' do
88
+ context 'with dynamic path' do
90
89
  let(:getter) { Getters.path { %i[object something] } }
91
90
 
92
91
  it 'returns value correctly' do
@@ -98,7 +97,7 @@ describe Aws::Templates::Utils::Parametrized::Getter do
98
97
  describe 'value' do
99
98
  let(:options_hash) { { something: 3 } }
100
99
 
101
- context 'static value is specified' do
100
+ context 'with static value' do
102
101
  let(:getter) { Getters.value(1) }
103
102
 
104
103
  it 'returns value correctly' do
@@ -106,7 +105,7 @@ describe Aws::Templates::Utils::Parametrized::Getter do
106
105
  end
107
106
  end
108
107
 
109
- context 'dynamic calculation is specified' do
108
+ context 'with dynamic calculation' do
110
109
  let(:getter) { Getters.value { options[:something] + 2 } }
111
110
 
112
111
  it 'returns value correctly' do
@@ -120,7 +119,7 @@ describe Aws::Templates::Utils::Parametrized::Getter do
120
119
  Getters.one_of(->(p) { options[p.name] }, ->(_) { options[:default] })
121
120
  end
122
121
 
123
- context 'first option value is specified' do
122
+ context 'with first option value' do
124
123
  let(:options_hash) { { something: 'a' } }
125
124
 
126
125
  it 'returns the value' do
@@ -128,7 +127,7 @@ describe Aws::Templates::Utils::Parametrized::Getter do
128
127
  end
129
128
  end
130
129
 
131
- context 'another options value is specified' do
130
+ context 'with another options value' do
132
131
  let(:options_hash) { { default: 'a' } }
133
132
 
134
133
  it 'returns the value' do
@@ -1,8 +1,5 @@
1
1
  require 'spec_helper'
2
2
  require 'aws/templates/utils/parametrized'
3
- require 'aws/templates/utils/parametrized/transformations'
4
- require 'aws/templates/utils/parametrized/constraints'
5
- require 'aws/templates/utils/parametrized/getters'
6
3
  require 'aws/templates/render'
7
4
 
8
5
  module TestRender
@@ -65,7 +62,7 @@ describe Aws::Templates::Utils::Parametrized::Transformation do
65
62
  it 'throws an error if sub-parameter constraint is not satisfied' do
66
63
  i = test_class.new(something: { a: 1, b: 2, c: nil })
67
64
  expect { [i.something.a, i.something.b, i.something.c] }
68
- .to raise_error Aws::Templates::ParameterValueInvalid
65
+ .to raise_error Aws::Templates::Exception::ParameterValueInvalid
69
66
  end
70
67
  end
71
68
 
@@ -106,7 +103,7 @@ describe Aws::Templates::Utils::Parametrized::Transformation do
106
103
 
107
104
  it 'fails if the value can be transformed to an array' do
108
105
  expect { test_class.new(something: 'abc').something }
109
- .to raise_error Aws::Templates::NestedParameterException
106
+ .to raise_error Aws::Templates::Exception::NestedParameterException
110
107
  end
111
108
 
112
109
  it 'returns correct value if sub-constraints are satisfied' do
@@ -158,7 +155,7 @@ describe Aws::Templates::Utils::Parametrized::Transformation do
158
155
 
159
156
  it 'fails on wrong value' do
160
157
  i = test_class.new(something: [])
161
- expect { i.something }.to raise_error Aws::Templates::NestedParameterException
158
+ expect { i.something }.to raise_error Aws::Templates::Exception::NestedParameterException
162
159
  end
163
160
  end
164
161
 
@@ -1,6 +1,5 @@
1
1
  require 'spec_helper'
2
2
  require 'aws/templates/utils/parametrized'
3
- require 'aws/templates/utils/parametrized/getters'
4
3
 
5
4
  describe Aws::Templates::Utils::Parametrized do
6
5
  let(:including_class) do
@@ -52,7 +51,7 @@ describe Aws::Templates::Utils::Parametrized do
52
51
  end
53
52
  end
54
53
 
55
- context 'Class is inherited and the module is included' do
54
+ context 'when class is inherited and the module is included' do
56
55
  let(:parametrized_class) do
57
56
  INCLUDING_MODULE = including_module
58
57
 
@@ -72,7 +71,7 @@ describe Aws::Templates::Utils::Parametrized do
72
71
  end
73
72
  end
74
73
 
75
- context 'Class is inherited and extended with parameters' do
74
+ context 'when class is inherited and extended with parameters' do
76
75
  let(:parametrized_class) do
77
76
  Class.new(including_class) do
78
77
  parameter :all_properties_parameter,
@@ -100,7 +99,7 @@ describe Aws::Templates::Utils::Parametrized do
100
99
  end
101
100
  end
102
101
 
103
- context 'Instance of the class created' do
102
+ context 'when instance of the class created' do
104
103
  let(:create_parameters) {}
105
104
 
106
105
  let(:instance) do
@@ -146,7 +145,7 @@ describe Aws::Templates::Utils::Parametrized do
146
145
  end
147
146
  end
148
147
 
149
- context 'Class is inherited and a parameter added' do
148
+ context 'when class is inherited and a parameter added' do
150
149
  let(:extending_class) do
151
150
  Class.new(parametrized_class) do
152
151
  parameter :just_addition,
@@ -165,7 +164,7 @@ describe Aws::Templates::Utils::Parametrized do
165
164
  end
166
165
  end
167
166
 
168
- context 'Instance of the class created' do
167
+ context 'when instance of the class created' do
169
168
  let(:create_parameters) do
170
169
  {
171
170
  all_properties_option: 2,
@@ -189,7 +188,7 @@ describe Aws::Templates::Utils::Parametrized do
189
188
  end
190
189
  end
191
190
 
192
- context 'Class inherited and parameter mixin added' do
191
+ context 'when class inherited and parameter mixin added' do
193
192
  let(:mixing_class) do
194
193
  k = Class.new(extending_class)
195
194
  k.send(:include, including_module)
@@ -222,10 +221,10 @@ describe Aws::Templates::Utils::Parametrized do
222
221
  Class.new(parametrized_class) do
223
222
  parameter :bare_minimum, description: 'Something existing'
224
223
  end
225
- end.to raise_error Aws::Templates::ParameterAlreadyExist
224
+ end.to raise_error Aws::Templates::Exception::ParameterAlreadyExist
226
225
  end
227
226
 
228
- context 'method is defined' do
227
+ context 'with method' do
229
228
  let(:failing_class) do
230
229
  Class.new(parametrized_class) do
231
230
  def a; end
@@ -234,7 +233,7 @@ describe Aws::Templates::Utils::Parametrized do
234
233
 
235
234
  it 'fails when adding a parameter with the same name as a method' do
236
235
  expect { failing_class.parameter(:a, description: 'Unexpected') }
237
- .to raise_error Aws::Templates::ParameterMethodNameConflict
236
+ .to raise_error Aws::Templates::Exception::ParameterMethodNameConflict
238
237
  end
239
238
  end
240
239
  end
@@ -0,0 +1,18 @@
1
+ require 'spec_helper'
2
+ require 'aws/templates/utils'
3
+
4
+ describe Aws::Templates::Utils do
5
+ describe 'lookup_module' do
6
+ let(:test_module) do
7
+ described_class.lookup_module('TestEmpty::Stuff::Here::Test')
8
+ end
9
+
10
+ it 'finds the test module' do
11
+ expect { test_module }.not_to raise_error
12
+ end
13
+
14
+ it 'finds the correct test module' do
15
+ expect(test_module).respond_to?(:test)
16
+ end
17
+ end
18
+ end
@@ -0,0 +1,4 @@
1
+ module TestEmpty
2
+ module Stuff
3
+ end
4
+ end
@@ -0,0 +1,9 @@
1
+ module TestEmpty
2
+ module Stuff
3
+ module Here
4
+ module Test
5
+ def self.test; end
6
+ end
7
+ end
8
+ end
9
+ end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cloud-templates
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ivan Matylitski
@@ -9,8 +9,68 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2017-10-17 00:00:00.000000000 Z
12
+ date: 2018-02-01 00:00:00.000000000 Z
13
13
  dependencies:
14
+ - !ruby/object:Gem::Dependency
15
+ name: facets
16
+ requirement: !ruby/object:Gem::Requirement
17
+ requirements:
18
+ - - ">="
19
+ - !ruby/object:Gem::Version
20
+ version: '3.0'
21
+ - - "~>"
22
+ - !ruby/object:Gem::Version
23
+ version: '3'
24
+ type: :runtime
25
+ prerelease: false
26
+ version_requirements: !ruby/object:Gem::Requirement
27
+ requirements:
28
+ - - ">="
29
+ - !ruby/object:Gem::Version
30
+ version: '3.0'
31
+ - - "~>"
32
+ - !ruby/object:Gem::Version
33
+ version: '3'
34
+ - !ruby/object:Gem::Dependency
35
+ name: concurrent-ruby
36
+ requirement: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - ">="
39
+ - !ruby/object:Gem::Version
40
+ version: 1.0.4
41
+ - - "~>"
42
+ - !ruby/object:Gem::Version
43
+ version: '1.0'
44
+ type: :runtime
45
+ prerelease: false
46
+ version_requirements: !ruby/object:Gem::Requirement
47
+ requirements:
48
+ - - ">="
49
+ - !ruby/object:Gem::Version
50
+ version: 1.0.4
51
+ - - "~>"
52
+ - !ruby/object:Gem::Version
53
+ version: '1.0'
54
+ - !ruby/object:Gem::Dependency
55
+ name: thor
56
+ requirement: !ruby/object:Gem::Requirement
57
+ requirements:
58
+ - - ">="
59
+ - !ruby/object:Gem::Version
60
+ version: 0.20.0
61
+ - - "~>"
62
+ - !ruby/object:Gem::Version
63
+ version: '0.20'
64
+ type: :runtime
65
+ prerelease: false
66
+ version_requirements: !ruby/object:Gem::Requirement
67
+ requirements:
68
+ - - ">="
69
+ - !ruby/object:Gem::Version
70
+ version: 0.20.0
71
+ - - "~>"
72
+ - !ruby/object:Gem::Version
73
+ version: '0.20'
14
74
  - !ruby/object:Gem::Dependency
15
75
  name: rspec
16
76
  requirement: !ruby/object:Gem::Requirement
@@ -37,14 +97,14 @@ dependencies:
37
97
  requirements:
38
98
  - - "~>"
39
99
  - !ruby/object:Gem::Version
40
- version: '0.46'
100
+ version: '0.50'
41
101
  type: :development
42
102
  prerelease: false
43
103
  version_requirements: !ruby/object:Gem::Requirement
44
104
  requirements:
45
105
  - - "~>"
46
106
  - !ruby/object:Gem::Version
47
- version: '0.46'
107
+ version: '0.50'
48
108
  - !ruby/object:Gem::Dependency
49
109
  name: rubocop-rspec
50
110
  requirement: !ruby/object:Gem::Requirement
@@ -113,10 +173,12 @@ description: MVC-based templating framework for hierarchical data structures. It
113
173
  email:
114
174
  - buffovich@gmail.com
115
175
  - cp@corradoprimier.it
116
- executables: []
176
+ executables:
177
+ - cloud-templates-runner.rb
117
178
  extensions: []
118
179
  extra_rdoc_files: []
119
180
  files:
181
+ - ".rspec"
120
182
  - ".rubocop.yml"
121
183
  - ".simplecov"
122
184
  - Gemfile
@@ -124,8 +186,10 @@ files:
124
186
  - NOTICE
125
187
  - README.md
126
188
  - Rakefile
189
+ - bin/cloud-templates-runner.rb
127
190
  - cloud-templates.gemspec
128
191
  - examples/lib/user_directory.rb
192
+ - examples/lib/user_directory/artifacts.rb
129
193
  - examples/lib/user_directory/artifacts/catalogized.rb
130
194
  - examples/lib/user_directory/artifacts/group.rb
131
195
  - examples/lib/user_directory/artifacts/ided.rb
@@ -135,6 +199,7 @@ files:
135
199
  - examples/lib/user_directory/artifacts/team.rb
136
200
  - examples/lib/user_directory/artifacts/unit.rb
137
201
  - examples/lib/user_directory/artifacts/user.rb
202
+ - examples/lib/user_directory/render.rb
138
203
  - examples/lib/user_directory/render/etc.rb
139
204
  - examples/lib/user_directory/render/etc/artifact_view.rb
140
205
  - examples/lib/user_directory/render/etc/composite_view.rb
@@ -157,43 +222,171 @@ files:
157
222
  - examples/spec/user_directory_spec.rb
158
223
  - lib/aws/templates.rb
159
224
  - lib/aws/templates/artifact.rb
225
+ - lib/aws/templates/cli.rb
226
+ - lib/aws/templates/cli/formatter.rb
227
+ - lib/aws/templates/cli/formatter/json.rb
228
+ - lib/aws/templates/cli/interface.rb
160
229
  - lib/aws/templates/composite.rb
161
- - lib/aws/templates/exceptions.rb
230
+ - lib/aws/templates/exception.rb
231
+ - lib/aws/templates/exception/nested_parameter_exception.rb
232
+ - lib/aws/templates/exception/option_error.rb
233
+ - lib/aws/templates/exception/option_scalar_on_the_way.rb
234
+ - lib/aws/templates/exception/option_should_be_recursive.rb
235
+ - lib/aws/templates/exception/option_value_deleted.rb
236
+ - lib/aws/templates/exception/parameter_already_exist.rb
237
+ - lib/aws/templates/exception/parameter_exception.rb
238
+ - lib/aws/templates/exception/parameter_getter_is_not_defined.rb
239
+ - lib/aws/templates/exception/parameter_method_name_conflict.rb
240
+ - lib/aws/templates/exception/parameter_specification_is_invalid.rb
241
+ - lib/aws/templates/exception/parameter_value_invalid.rb
242
+ - lib/aws/templates/exception/parametrized_dsl_error.rb
243
+ - lib/aws/templates/exception/view_not_found.rb
244
+ - lib/aws/templates/help.rb
245
+ - lib/aws/templates/help/aggregate.rb
246
+ - lib/aws/templates/help/dsl.rb
247
+ - lib/aws/templates/help/provider.rb
248
+ - lib/aws/templates/help/rdoc.rb
249
+ - lib/aws/templates/help/rdoc/artifact.rb
250
+ - lib/aws/templates/help/rdoc/composite.rb
251
+ - lib/aws/templates/help/rdoc/contextualized.rb
252
+ - lib/aws/templates/help/rdoc/contextualized/filter.rb
253
+ - lib/aws/templates/help/rdoc/contextualized/filters.rb
254
+ - lib/aws/templates/help/rdoc/contextualized/filters/add.rb
255
+ - lib/aws/templates/help/rdoc/contextualized/filters/chain.rb
256
+ - lib/aws/templates/help/rdoc/contextualized/filters/copy.rb
257
+ - lib/aws/templates/help/rdoc/contextualized/filters/identity.rb
258
+ - lib/aws/templates/help/rdoc/contextualized/filters/override.rb
259
+ - lib/aws/templates/help/rdoc/contextualized/filters/proxy.rb
260
+ - lib/aws/templates/help/rdoc/contextualized/filters/recursive_schema_filter.rb
261
+ - lib/aws/templates/help/rdoc/contextualized/filters/remove.rb
262
+ - lib/aws/templates/help/rdoc/contextualized/filters/scoped.rb
263
+ - lib/aws/templates/help/rdoc/contextualized/provider.rb
264
+ - lib/aws/templates/help/rdoc/default.rb
265
+ - lib/aws/templates/help/rdoc/default/definition.rb
266
+ - lib/aws/templates/help/rdoc/default/provider.rb
267
+ - lib/aws/templates/help/rdoc/dsl.rb
268
+ - lib/aws/templates/help/rdoc/inheritable.rb
269
+ - lib/aws/templates/help/rdoc/parametrized.rb
270
+ - lib/aws/templates/help/rdoc/parametrized/constraint.rb
271
+ - lib/aws/templates/help/rdoc/parametrized/constraints.rb
272
+ - lib/aws/templates/help/rdoc/parametrized/constraints/all_of.rb
273
+ - lib/aws/templates/help/rdoc/parametrized/constraints/condition.rb
274
+ - lib/aws/templates/help/rdoc/parametrized/constraints/depends_on_value.rb
275
+ - lib/aws/templates/help/rdoc/parametrized/constraints/enum.rb
276
+ - lib/aws/templates/help/rdoc/parametrized/constraints/matches.rb
277
+ - lib/aws/templates/help/rdoc/parametrized/constraints/not_nil.rb
278
+ - lib/aws/templates/help/rdoc/parametrized/constraints/requires.rb
279
+ - lib/aws/templates/help/rdoc/parametrized/constraints/satisfies_condition.rb
280
+ - lib/aws/templates/help/rdoc/parametrized/getter.rb
281
+ - lib/aws/templates/help/rdoc/parametrized/getters.rb
282
+ - lib/aws/templates/help/rdoc/parametrized/nested.rb
283
+ - lib/aws/templates/help/rdoc/parametrized/parameter.rb
284
+ - lib/aws/templates/help/rdoc/parametrized/provider.rb
285
+ - lib/aws/templates/help/rdoc/parametrized/transformation.rb
286
+ - lib/aws/templates/help/rdoc/parametrized/transformations.rb
287
+ - lib/aws/templates/help/rdoc/parametrized/transformations/as_boolean.rb
288
+ - lib/aws/templates/help/rdoc/parametrized/transformations/as_chain.rb
289
+ - lib/aws/templates/help/rdoc/parametrized/transformations/as_hash.rb
290
+ - lib/aws/templates/help/rdoc/parametrized/transformations/as_integer.rb
291
+ - lib/aws/templates/help/rdoc/parametrized/transformations/as_list.rb
292
+ - lib/aws/templates/help/rdoc/parametrized/transformations/as_module.rb
293
+ - lib/aws/templates/help/rdoc/parametrized/transformations/as_object.rb
294
+ - lib/aws/templates/help/rdoc/parametrized/transformations/as_rendered.rb
295
+ - lib/aws/templates/help/rdoc/parametrized/transformations/as_string.rb
296
+ - lib/aws/templates/help/rdoc/provider.rb
297
+ - lib/aws/templates/help/rdoc/routing.rb
298
+ - lib/aws/templates/help/rdoc/texting.rb
299
+ - lib/aws/templates/processor.rb
300
+ - lib/aws/templates/processor/handler.rb
301
+ - lib/aws/templates/processor/registry.rb
302
+ - lib/aws/templates/processor/routing.rb
162
303
  - lib/aws/templates/render.rb
163
- - lib/aws/templates/render/registry.rb
304
+ - lib/aws/templates/render/basic_view.rb
305
+ - lib/aws/templates/render/utils.rb
164
306
  - lib/aws/templates/render/utils/base_type_views.rb
165
307
  - lib/aws/templates/render/utils/inspect.rb
166
308
  - lib/aws/templates/render/utils/stringify.rb
167
309
  - lib/aws/templates/render/view.rb
168
310
  - lib/aws/templates/utils.rb
169
311
  - lib/aws/templates/utils/artifact_storage.rb
312
+ - lib/aws/templates/utils/as_named.rb
313
+ - lib/aws/templates/utils/autoload.rb
170
314
  - lib/aws/templates/utils/contextualized.rb
171
- - lib/aws/templates/utils/contextualized/filters.rb
172
- - lib/aws/templates/utils/contextualized/hash.rb
173
- - lib/aws/templates/utils/contextualized/nil.rb
174
- - lib/aws/templates/utils/contextualized/proc.rb
315
+ - lib/aws/templates/utils/contextualized/filter.rb
316
+ - lib/aws/templates/utils/contextualized/filter/add.rb
317
+ - lib/aws/templates/utils/contextualized/filter/chain.rb
318
+ - lib/aws/templates/utils/contextualized/filter/copy.rb
319
+ - lib/aws/templates/utils/contextualized/filter/dsl.rb
320
+ - lib/aws/templates/utils/contextualized/filter/identity.rb
321
+ - lib/aws/templates/utils/contextualized/filter/override.rb
322
+ - lib/aws/templates/utils/contextualized/filter/proxy.rb
323
+ - lib/aws/templates/utils/contextualized/filter/recursive_schema_filter.rb
324
+ - lib/aws/templates/utils/contextualized/filter/remove.rb
325
+ - lib/aws/templates/utils/contextualized/filter/scoped.rb
326
+ - lib/aws/templates/utils/contextualized/refinements.rb
175
327
  - lib/aws/templates/utils/default.rb
176
328
  - lib/aws/templates/utils/dependency.rb
177
- - lib/aws/templates/utils/dependency/enumerable.rb
178
- - lib/aws/templates/utils/dependency/object.rb
329
+ - lib/aws/templates/utils/dependency/refinements.rb
179
330
  - lib/aws/templates/utils/dependent.rb
331
+ - lib/aws/templates/utils/guarded.rb
180
332
  - lib/aws/templates/utils/inheritable.rb
181
333
  - lib/aws/templates/utils/inspectable.rb
182
334
  - lib/aws/templates/utils/late_bound.rb
183
335
  - lib/aws/templates/utils/memoized.rb
184
- - lib/aws/templates/utils/named.rb
185
336
  - lib/aws/templates/utils/options.rb
186
337
  - lib/aws/templates/utils/parametrized.rb
187
- - lib/aws/templates/utils/parametrized/constraints.rb
188
- - lib/aws/templates/utils/parametrized/getters.rb
189
- - lib/aws/templates/utils/parametrized/guarded.rb
338
+ - lib/aws/templates/utils/parametrized/constraint.rb
339
+ - lib/aws/templates/utils/parametrized/constraint/all_of.rb
340
+ - lib/aws/templates/utils/parametrized/constraint/condition.rb
341
+ - lib/aws/templates/utils/parametrized/constraint/depends_on_value.rb
342
+ - lib/aws/templates/utils/parametrized/constraint/dsl.rb
343
+ - lib/aws/templates/utils/parametrized/constraint/enum.rb
344
+ - lib/aws/templates/utils/parametrized/constraint/matches.rb
345
+ - lib/aws/templates/utils/parametrized/constraint/not_nil.rb
346
+ - lib/aws/templates/utils/parametrized/constraint/requires.rb
347
+ - lib/aws/templates/utils/parametrized/constraint/satisfies_condition.rb
348
+ - lib/aws/templates/utils/parametrized/getter.rb
349
+ - lib/aws/templates/utils/parametrized/getter/as_instance_variable.rb
350
+ - lib/aws/templates/utils/parametrized/getter/as_is.rb
351
+ - lib/aws/templates/utils/parametrized/getter/dsl.rb
352
+ - lib/aws/templates/utils/parametrized/getter/one_of.rb
353
+ - lib/aws/templates/utils/parametrized/getter/path.rb
354
+ - lib/aws/templates/utils/parametrized/getter/value.rb
190
355
  - lib/aws/templates/utils/parametrized/nested.rb
191
- - lib/aws/templates/utils/parametrized/transformations.rb
356
+ - lib/aws/templates/utils/parametrized/transformation.rb
357
+ - lib/aws/templates/utils/parametrized/transformation/as_boolean.rb
358
+ - lib/aws/templates/utils/parametrized/transformation/as_chain.rb
359
+ - lib/aws/templates/utils/parametrized/transformation/as_hash.rb
360
+ - lib/aws/templates/utils/parametrized/transformation/as_integer.rb
361
+ - lib/aws/templates/utils/parametrized/transformation/as_list.rb
362
+ - lib/aws/templates/utils/parametrized/transformation/as_module.rb
363
+ - lib/aws/templates/utils/parametrized/transformation/as_object.rb
364
+ - lib/aws/templates/utils/parametrized/transformation/as_rendered.rb
365
+ - lib/aws/templates/utils/parametrized/transformation/as_string.rb
366
+ - lib/aws/templates/utils/parametrized/transformation/dsl.rb
367
+ - lib/aws/templates/utils/recursive.rb
192
368
  - spec/aws/templates/artifact_spec.rb
369
+ - spec/aws/templates/cli_spec.rb
193
370
  - spec/aws/templates/composite_spec.rb
371
+ - spec/aws/templates/help/rdoc/artifact_spec.rb
372
+ - spec/aws/templates/help/rdoc/composite_spec.rb
373
+ - spec/aws/templates/help/rdoc/parametrized/constraints/all_of_spec.rb
374
+ - spec/aws/templates/help/rdoc/parametrized/constraints/depends_on_value_spec.rb
375
+ - spec/aws/templates/help/rdoc/parametrized/constraints/enum_spec.rb
376
+ - spec/aws/templates/help/rdoc/parametrized/constraints/matches_spec.rb
377
+ - spec/aws/templates/help/rdoc/parametrized/constraints/satisfies_condition_spec.rb
378
+ - spec/aws/templates/help/rdoc/parametrized/transformations/as_boolean_spec.rb
379
+ - spec/aws/templates/help/rdoc/parametrized/transformations/as_chain_spec.rb
380
+ - spec/aws/templates/help/rdoc/parametrized/transformations/as_hash_spec.rb
381
+ - spec/aws/templates/help/rdoc/parametrized/transformations/as_integer_spec.rb
382
+ - spec/aws/templates/help/rdoc/parametrized/transformations/as_list_spec.rb
383
+ - spec/aws/templates/help/rdoc/parametrized/transformations/as_module_spec.rb
384
+ - spec/aws/templates/help/rdoc/parametrized/transformations/as_object_spec.rb
385
+ - spec/aws/templates/help/rdoc/parametrized/transformations/as_rendered_spec.rb
194
386
  - spec/aws/templates/render/utils/base_type_views_spec.rb
195
387
  - spec/aws/templates/render_spec.rb
196
388
  - spec/aws/templates/utils/as_named_spec.rb
389
+ - spec/aws/templates/utils/autoload_spec.rb
197
390
  - spec/aws/templates/utils/contextualized/filters_spec.rb
198
391
  - spec/aws/templates/utils/contextualized_spec.rb
199
392
  - spec/aws/templates/utils/late_bound_spec.rb
@@ -202,7 +395,10 @@ files:
202
395
  - spec/aws/templates/utils/parametrized/getters_spec.rb
203
396
  - spec/aws/templates/utils/parametrized/transformation_spec.rb
204
397
  - spec/aws/templates/utils/parametrized_spec.rb
398
+ - spec/aws/templates/utils_spec.rb
205
399
  - spec/spec_helper.rb
400
+ - spec/test_empty/stuff.rb
401
+ - spec/test_empty/stuff/here/test.rb
206
402
  homepage: https://rubygems.org/gems/cloud-templates
207
403
  licenses:
208
404
  - Apache 2.0
@@ -215,7 +411,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
215
411
  requirements:
216
412
  - - ">="
217
413
  - !ruby/object:Gem::Version
218
- version: 2.1.0
414
+ version: 2.4.0
219
415
  required_rubygems_version: !ruby/object:Gem::Requirement
220
416
  requirements:
221
417
  - - ">="
@@ -229,12 +425,32 @@ specification_version: 4
229
425
  summary: Hierarchical data templates
230
426
  test_files:
231
427
  - spec/spec_helper.rb
428
+ - spec/test_empty/stuff.rb
429
+ - spec/test_empty/stuff/here/test.rb
430
+ - spec/aws/templates/help/rdoc/artifact_spec.rb
431
+ - spec/aws/templates/help/rdoc/parametrized/constraints/matches_spec.rb
432
+ - spec/aws/templates/help/rdoc/parametrized/constraints/depends_on_value_spec.rb
433
+ - spec/aws/templates/help/rdoc/parametrized/constraints/all_of_spec.rb
434
+ - spec/aws/templates/help/rdoc/parametrized/constraints/enum_spec.rb
435
+ - spec/aws/templates/help/rdoc/parametrized/constraints/satisfies_condition_spec.rb
436
+ - spec/aws/templates/help/rdoc/parametrized/transformations/as_rendered_spec.rb
437
+ - spec/aws/templates/help/rdoc/parametrized/transformations/as_object_spec.rb
438
+ - spec/aws/templates/help/rdoc/parametrized/transformations/as_module_spec.rb
439
+ - spec/aws/templates/help/rdoc/parametrized/transformations/as_integer_spec.rb
440
+ - spec/aws/templates/help/rdoc/parametrized/transformations/as_hash_spec.rb
441
+ - spec/aws/templates/help/rdoc/parametrized/transformations/as_boolean_spec.rb
442
+ - spec/aws/templates/help/rdoc/parametrized/transformations/as_list_spec.rb
443
+ - spec/aws/templates/help/rdoc/parametrized/transformations/as_chain_spec.rb
444
+ - spec/aws/templates/help/rdoc/composite_spec.rb
445
+ - spec/aws/templates/utils_spec.rb
446
+ - spec/aws/templates/cli_spec.rb
232
447
  - spec/aws/templates/render/utils/base_type_views_spec.rb
233
448
  - spec/aws/templates/render_spec.rb
234
449
  - spec/aws/templates/artifact_spec.rb
235
450
  - spec/aws/templates/composite_spec.rb
236
451
  - spec/aws/templates/utils/parametrized_spec.rb
237
452
  - spec/aws/templates/utils/contextualized_spec.rb
453
+ - spec/aws/templates/utils/autoload_spec.rb
238
454
  - spec/aws/templates/utils/options_spec.rb
239
455
  - spec/aws/templates/utils/late_bound_spec.rb
240
456
  - spec/aws/templates/utils/as_named_spec.rb