avm 0.6.1 → 0.10.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (44) hide show
  1. checksums.yaml +4 -4
  2. data/lib/avm/data/package/dump.rb +3 -3
  3. data/lib/avm/data/rotate.rb +107 -0
  4. data/lib/avm/docker/runner.rb +8 -0
  5. data/lib/avm/instances/application.rb +25 -0
  6. data/lib/avm/instances/base/auto_values/access.rb +40 -0
  7. data/lib/avm/instances/base/auto_values/admin.rb +19 -0
  8. data/lib/avm/instances/base/auto_values/data.rb +26 -0
  9. data/lib/avm/instances/base/auto_values/database.rb +76 -0
  10. data/lib/avm/instances/base/auto_values/filesystem.rb +45 -0
  11. data/lib/avm/instances/base/auto_values/mailer.rb +34 -0
  12. data/lib/avm/instances/base/auto_values/ruby.rb +15 -0
  13. data/lib/avm/instances/base/auto_values/source.rb +15 -0
  14. data/lib/avm/instances/base/auto_values/system.rb +23 -0
  15. data/lib/avm/instances/base/auto_values/web.rb +46 -0
  16. data/lib/avm/instances/base/auto_values.rb +21 -0
  17. data/lib/avm/instances/base/dockerizable.rb +45 -0
  18. data/lib/avm/instances/base/entry_keys.rb +22 -0
  19. data/lib/avm/instances/base.rb +64 -0
  20. data/lib/avm/instances/entries.rb +43 -0
  21. data/lib/avm/instances/entry.rb +54 -0
  22. data/lib/avm/instances/entry_keys.rb +57 -0
  23. data/lib/avm/instances/runner.rb +38 -0
  24. data/lib/avm/instances.rb +8 -0
  25. data/lib/avm/registry/base.rb +12 -10
  26. data/lib/avm/registry.rb +1 -1
  27. data/lib/avm/runners/base.rb +31 -0
  28. data/lib/avm/scms/base.rb +5 -0
  29. data/lib/avm/scms/inflector.rb +22 -0
  30. data/lib/avm/self/docker_image.rb +14 -0
  31. data/lib/avm/self/instance/entry_keys.rb +12 -0
  32. data/lib/avm/self/instance.rb +24 -0
  33. data/lib/avm/sources/base/configuration.rb +37 -0
  34. data/lib/avm/sources/base/testing.rb +21 -0
  35. data/lib/avm/sources/base.rb +9 -25
  36. data/lib/avm/sources/tester.rb +24 -0
  37. data/lib/avm/sources/tests/builder.rb +83 -0
  38. data/lib/avm/sources/tests/performer.rb +35 -0
  39. data/lib/avm/sources/tests/result.rb +15 -0
  40. data/lib/avm/sources/tests/single.rb +56 -0
  41. data/lib/avm/sources/tests.rb +11 -0
  42. data/lib/avm/version.rb +1 -1
  43. metadata +58 -5
  44. data/lib/avm/source_stereotypes/base.rb +0 -21
@@ -0,0 +1,35 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'avm/sources/tests/result'
4
+ require 'eac_ruby_utils/core_ext'
5
+
6
+ module Avm
7
+ module Sources
8
+ module Tests
9
+ class Performer
10
+ enable_simple_cache
11
+
12
+ common_constructor(:owner)
13
+
14
+ def non_failed_units
15
+ units.reject(&:failed?)
16
+ end
17
+
18
+ def failed_units
19
+ units.select(&:failed?)
20
+ end
21
+
22
+ # @return [Boolean]
23
+ def successful?
24
+ failed_units.none?
25
+ end
26
+
27
+ protected
28
+
29
+ def units_uncached
30
+ owner.selected_units
31
+ end
32
+ end
33
+ end
34
+ end
35
+ end
@@ -0,0 +1,15 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'eac_cli/enum'
4
+
5
+ module Avm
6
+ module Sources
7
+ module Tests
8
+ class Result < ::EacCli::Enum
9
+ enum :failed, :red
10
+ enum :nonexistent, :white
11
+ enum :sucessful, :green
12
+ end
13
+ end
14
+ end
15
+ end
@@ -0,0 +1,56 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'avm/sources/tests/result'
4
+ require 'eac_ruby_utils/core_ext'
5
+ require 'eac_ruby_utils/fs/logs'
6
+
7
+ module Avm
8
+ module Sources
9
+ module Tests
10
+ class Single
11
+ MAIN_SOURCE_ID = '#main'
12
+
13
+ compare_by :order_group, :id
14
+ enable_simple_cache
15
+ enable_speaker
16
+
17
+ common_constructor :builder, :source
18
+
19
+ delegate :logs, :result, to: :tester
20
+ delegate :to_s, to: :id
21
+
22
+ def failed?
23
+ result == ::Avm::Sources::Tests::Result::FAILED
24
+ end
25
+
26
+ # @return [String]
27
+ def id
28
+ if main?
29
+ MAIN_SOURCE_ID
30
+ else
31
+ relative_path_from_main_source.to_s
32
+ end
33
+ end
34
+
35
+ def main?
36
+ relative_path_from_main_source.to_s == '.'
37
+ end
38
+
39
+ def order_group
40
+ main? ? 1 : 0
41
+ end
42
+
43
+ # @return [Pathname]
44
+ def relative_path_from_main_source
45
+ source.path.relative_path_from(builder.main_source.path)
46
+ end
47
+
48
+ private
49
+
50
+ def tester_uncached
51
+ source.tester
52
+ end
53
+ end
54
+ end
55
+ end
56
+ end
@@ -0,0 +1,11 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'eac_ruby_utils/core_ext'
4
+
5
+ module Avm
6
+ module Sources
7
+ module Tests
8
+ require_sub __FILE__
9
+ end
10
+ end
11
+ end
data/lib/avm/version.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Avm
4
- VERSION = '0.6.1'
4
+ VERSION = '0.10.0'
5
5
  end
metadata CHANGED
@@ -1,15 +1,35 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: avm
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.6.1
4
+ version: 0.10.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Eduardo H. Bogoni
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-10-17 00:00:00.000000000 Z
11
+ date: 2021-11-26 00:00:00.000000000 Z
12
12
  dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: eac_cli
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - "~>"
18
+ - !ruby/object:Gem::Version
19
+ version: '0.23'
20
+ - - ">="
21
+ - !ruby/object:Gem::Version
22
+ version: 0.23.1
23
+ type: :runtime
24
+ prerelease: false
25
+ version_requirements: !ruby/object:Gem::Requirement
26
+ requirements:
27
+ - - "~>"
28
+ - !ruby/object:Gem::Version
29
+ version: '0.23'
30
+ - - ">="
31
+ - !ruby/object:Gem::Version
32
+ version: 0.23.1
13
33
  - !ruby/object:Gem::Dependency
14
34
  name: eac_docker
15
35
  requirement: !ruby/object:Gem::Requirement
@@ -44,14 +64,14 @@ dependencies:
44
64
  requirements:
45
65
  - - "~>"
46
66
  - !ruby/object:Gem::Version
47
- version: '0.77'
67
+ version: '0.80'
48
68
  type: :runtime
49
69
  prerelease: false
50
70
  version_requirements: !ruby/object:Gem::Requirement
51
71
  requirements:
52
72
  - - "~>"
53
73
  - !ruby/object:Gem::Version
54
- version: '0.77'
74
+ version: '0.80'
55
75
  - !ruby/object:Gem::Dependency
56
76
  name: eac_templates
57
77
  requirement: !ruby/object:Gem::Requirement
@@ -168,13 +188,34 @@ files:
168
188
  - lib/avm/data/package.rb
169
189
  - lib/avm/data/package/dump.rb
170
190
  - lib/avm/data/package/load.rb
191
+ - lib/avm/data/rotate.rb
171
192
  - lib/avm/data/unit.rb
172
193
  - lib/avm/docker.rb
173
194
  - lib/avm/docker/container.rb
174
195
  - lib/avm/docker/image.rb
175
196
  - lib/avm/docker/runner.rb
176
197
  - lib/avm/executables.rb
198
+ - lib/avm/instances.rb
199
+ - lib/avm/instances/application.rb
200
+ - lib/avm/instances/base.rb
201
+ - lib/avm/instances/base/auto_values.rb
202
+ - lib/avm/instances/base/auto_values/access.rb
203
+ - lib/avm/instances/base/auto_values/admin.rb
204
+ - lib/avm/instances/base/auto_values/data.rb
205
+ - lib/avm/instances/base/auto_values/database.rb
206
+ - lib/avm/instances/base/auto_values/filesystem.rb
207
+ - lib/avm/instances/base/auto_values/mailer.rb
208
+ - lib/avm/instances/base/auto_values/ruby.rb
209
+ - lib/avm/instances/base/auto_values/source.rb
210
+ - lib/avm/instances/base/auto_values/system.rb
211
+ - lib/avm/instances/base/auto_values/web.rb
212
+ - lib/avm/instances/base/dockerizable.rb
213
+ - lib/avm/instances/base/entry_keys.rb
177
214
  - lib/avm/instances/docker_image.rb
215
+ - lib/avm/instances/entries.rb
216
+ - lib/avm/instances/entry.rb
217
+ - lib/avm/instances/entry_keys.rb
218
+ - lib/avm/instances/runner.rb
178
219
  - lib/avm/jobs.rb
179
220
  - lib/avm/jobs/base.rb
180
221
  - lib/avm/jobs/variables_source.rb
@@ -186,15 +227,27 @@ files:
186
227
  - lib/avm/rspec/setup.rb
187
228
  - lib/avm/rspec/shared_examples/in_avm_registry.rb
188
229
  - lib/avm/rspec/shared_examples/not_in_avm_registry.rb
230
+ - lib/avm/runners/base.rb
189
231
  - lib/avm/scms/base.rb
190
232
  - lib/avm/scms/commit.rb
191
- - lib/avm/source_stereotypes/base.rb
233
+ - lib/avm/scms/inflector.rb
234
+ - lib/avm/self/docker_image.rb
235
+ - lib/avm/self/instance.rb
236
+ - lib/avm/self/instance/entry_keys.rb
192
237
  - lib/avm/sources.rb
193
238
  - lib/avm/sources/base.rb
239
+ - lib/avm/sources/base/configuration.rb
240
+ - lib/avm/sources/base/testing.rb
194
241
  - lib/avm/sources/configuration.rb
195
242
  - lib/avm/sources/configuration/_locale.rb
196
243
  - lib/avm/sources/configuration/_rubocop.rb
197
244
  - lib/avm/sources/configuration/_tests.rb
245
+ - lib/avm/sources/tester.rb
246
+ - lib/avm/sources/tests.rb
247
+ - lib/avm/sources/tests/builder.rb
248
+ - lib/avm/sources/tests/performer.rb
249
+ - lib/avm/sources/tests/result.rb
250
+ - lib/avm/sources/tests/single.rb
198
251
  - lib/avm/sync.rb
199
252
  - lib/avm/version.rb
200
253
  - lib/avm/version_number.rb
@@ -1,21 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- require 'eac_ruby_utils/core_ext'
4
-
5
- module Avm
6
- module SourceStereotypes
7
- class Base
8
- enable_abstract_methods
9
- abstract_methods :valid?
10
- common_constructor :source
11
-
12
- def name
13
- self.class.name
14
- end
15
-
16
- def to_s
17
- name
18
- end
19
- end
20
- end
21
- end