eac_tools 0.9.0 → 0.11.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (59) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile.lock +23 -18
  3. data/lib/eac_tools/version.rb +1 -1
  4. data/sub/avm/lib/avm/applications/base/stereotype.rb +31 -0
  5. data/sub/avm/lib/avm/applications/base.rb +17 -0
  6. data/sub/avm/lib/avm/docker/image.rb +12 -2
  7. data/sub/avm/lib/avm/registry/application_stereotypes.rb +26 -10
  8. data/sub/avm/lib/avm/registry/instances.rb +1 -1
  9. data/sub/avm/lib/avm/scms/base.rb +2 -0
  10. data/sub/avm/lib/avm/version.rb +1 -1
  11. data/sub/avm-eac_generic_base0/avm-eac_generic_base0.gemspec +2 -2
  12. data/sub/avm-eac_generic_base0/lib/avm/eac_generic_base0/sources/docker/runner.rb +61 -0
  13. data/sub/avm-eac_generic_base0/lib/avm/eac_generic_base0/sources/docker.rb +13 -0
  14. data/sub/avm-eac_generic_base0/lib/avm/eac_generic_base0/version.rb +1 -1
  15. data/sub/avm-eac_redmine_base0/avm-eac_redmine_base0.gemspec +2 -0
  16. data/sub/avm-eac_redmine_base0/lib/avm/eac_redmine_base0/instances/base.rb +14 -0
  17. data/sub/{avm-tools/lib/avm/tools/runner/eac_redmine_base0 → avm-eac_redmine_base0/lib/avm/eac_redmine_base0/instances/runners}/docker.rb +3 -3
  18. data/sub/{avm-tools/lib/avm/tools/runner/eac_redmine_base0 → avm-eac_redmine_base0/lib/avm/eac_redmine_base0/instances/runners}/project_rename.rb +3 -3
  19. data/sub/avm-eac_redmine_base0/lib/avm/eac_redmine_base0/instances/runners.rb +13 -0
  20. data/sub/avm-eac_redmine_base0/lib/avm/eac_redmine_base0/runners/base.rb +25 -0
  21. data/sub/avm-eac_redmine_base0/lib/avm/eac_redmine_base0/sources/runners/core_update.rb +1 -3
  22. data/sub/avm-eac_redmine_base0/lib/avm/eac_redmine_base0/sources/runners/docker.rb +19 -0
  23. data/sub/avm-eac_redmine_base0/lib/avm/eac_redmine_base0/version.rb +1 -1
  24. data/sub/avm-tools/README.textile +0 -11
  25. data/sub/avm-tools/avm-tools.gemspec +0 -2
  26. data/sub/avm-tools/lib/avm/tools/runner/instance/info.rb +1 -0
  27. data/sub/avm-tools/lib/avm/tools/runner/instance.rb +6 -1
  28. data/sub/avm-tools/lib/avm/tools/version.rb +1 -1
  29. data/sub/eac_docker/Gemfile +8 -0
  30. data/sub/{avm-tools/sub/eac_docker → eac_docker}/eac_docker.gemspec +3 -3
  31. data/sub/{avm-tools/sub/eac_docker → eac_docker}/lib/eac_docker/container.rb +4 -3
  32. data/sub/{avm-tools/sub/eac_docker → eac_docker}/lib/eac_docker/debug.rb +0 -0
  33. data/sub/{avm-tools/sub/eac_docker → eac_docker}/lib/eac_docker/executables.rb +0 -0
  34. data/sub/{avm-tools/sub/eac_docker → eac_docker}/lib/eac_docker/images/base.rb +0 -0
  35. data/sub/{avm-tools/sub/eac_docker → eac_docker}/lib/eac_docker/images/coded.rb +0 -0
  36. data/sub/{avm-tools/sub/eac_docker → eac_docker}/lib/eac_docker/images/named.rb +0 -0
  37. data/sub/{avm-tools/sub/eac_docker → eac_docker}/lib/eac_docker/images/templatized.rb +0 -0
  38. data/sub/{avm-tools/sub/eac_docker → eac_docker}/lib/eac_docker/images.rb +0 -0
  39. data/sub/{avm-tools/sub/eac_docker → eac_docker}/lib/eac_docker/registry.rb +0 -0
  40. data/sub/{avm-tools/sub/eac_docker → eac_docker}/lib/eac_docker/rspec/setup.rb +0 -0
  41. data/sub/{avm-tools/sub/eac_docker → eac_docker}/lib/eac_docker/rspec.rb +0 -0
  42. data/sub/{avm-tools/sub/eac_docker → eac_docker}/lib/eac_docker/version.rb +1 -1
  43. data/sub/{avm-tools/sub/eac_docker → eac_docker}/lib/eac_docker.rb +0 -0
  44. data/sub/{avm-tools/sub/eac_docker → eac_docker}/spec/lib/eac_docker/executables_spec.rb +0 -0
  45. data/sub/{avm-tools/sub/eac_docker → eac_docker}/spec/lib/eac_docker/images/coded_spec.rb +0 -0
  46. data/sub/{avm-tools/sub/eac_docker → eac_docker}/spec/lib/eac_docker/images/coded_spec_files/image1/Dockerfile +0 -0
  47. data/sub/{avm-tools/sub/eac_docker → eac_docker}/spec/lib/eac_docker/images/templatized_spec.rb +0 -0
  48. data/sub/{avm-tools/sub/eac_docker → eac_docker}/spec/lib/eac_docker/images/templatized_spec_files/stub_docker_image/Dockerfile +0 -0
  49. data/sub/{avm-tools/sub/eac_docker → eac_docker}/spec/rubocop_spec.rb +0 -0
  50. data/sub/{avm-tools/sub/eac_docker → eac_docker}/spec/spec_helper.rb +0 -0
  51. data/sub/eac_ruby_utils/lib/eac_ruby_utils/immutable/array_accessor.rb +22 -5
  52. data/sub/eac_ruby_utils/lib/eac_ruby_utils/version.rb +1 -1
  53. data/sub/eac_ruby_utils/spec/lib/eac_ruby_utils/immutable_spec.rb +34 -0
  54. metadata +42 -44
  55. data/sub/avm/lib/avm/application_stereotypes/base/by_gem.rb +0 -17
  56. data/sub/avm/lib/avm/application_stereotypes/base/detection.rb +0 -34
  57. data/sub/avm-tools/lib/avm/tools/runner/eac_redmine_base0/dev_docker.rb +0 -17
  58. data/sub/avm-tools/lib/avm/tools/runner/eac_redmine_base0.rb +0 -15
  59. data/sub/avm-tools/sub/eac_docker/Gemfile +0 -5
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 3fa70fea2f112e1a4e35f04e36403b48e783741ef6422889bf1ff331ebeb9cea
4
- data.tar.gz: cb5448c31e2221ae342b292d95c8110d0ec7d31a7cd71c864db87e8e26923059
3
+ metadata.gz: 38f984e803945d01e0bd9befc7b53c3cbca3950a924195d50b50558f69812578
4
+ data.tar.gz: 781bef8a0c526d89f19c70c042cbf6e6ddb461e297ca81cc64034288b2ebe3f4
5
5
  SHA512:
6
- metadata.gz: 35ff38d368bbbb072bbada779c08d9979cda147c3c15ffee5d4c9525942673ef9d94185c306bf23134bc85a69ea7b591c5fb099dc8ec584a41476c71c71f49d2
7
- data.tar.gz: 7e91d791b04fee2aca1f883a4a72b7862c40cb24a574bebf8c61c5cfa54b12476bb312eb5494cc9e48a9379229ae6c140f06009ab332c55868810a2361dd2201
6
+ metadata.gz: 90ede8646c864d11fa0ccf495fc95307fca6e7707f5cb5649ab6b716cd95485a13dbe2db5d27ad80c0579e321b7cf6085be44e6784233a2b2f59bad63b877021
7
+ data.tar.gz: d3c0986c5fcd2e5f89a8383974b2793f23e33a613c7a5e6cb76f6ee595a5fe3e635db49aff507bdd271343b9317ee0bab9a0b3669dc049beec18f3788027264d
data/Gemfile.lock CHANGED
@@ -1,22 +1,22 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- eac_tools (0.9.0)
5
- avm-eac_generic_base0 (~> 0.3)
4
+ eac_tools (0.11.1)
5
+ avm-eac_generic_base0 (~> 0.4)
6
6
  avm-eac_rails_base0 (~> 0.5)
7
7
  avm-eac_rails_base1 (~> 0.4, >= 0.4.1)
8
- avm-eac_redmine_base0 (~> 0.9)
8
+ avm-eac_redmine_base0 (~> 0.11)
9
9
  avm-eac_redmine_plugin_base0 (~> 0.3)
10
10
  avm-eac_ruby_base1 (~> 0.11)
11
- avm-tools (~> 0.123)
12
- eac_ruby_utils (~> 0.95, >= 0.95.2)
11
+ avm-tools (~> 0.126)
12
+ eac_ruby_utils (~> 0.96)
13
13
 
14
14
  PATH
15
15
  remote: sub/avm-eac_generic_base0
16
16
  specs:
17
- avm-eac_generic_base0 (0.3.0)
18
- avm (~> 0.24)
19
- eac_ruby_utils (~> 0.05, >= 0.95.2)
17
+ avm-eac_generic_base0 (0.4.0)
18
+ avm (~> 0.28)
19
+ eac_ruby_utils (~> 0.96)
20
20
 
21
21
  PATH
22
22
  remote: sub/avm-eac_rails_base0
@@ -36,7 +36,9 @@ PATH
36
36
  PATH
37
37
  remote: sub/avm-eac_redmine_base0
38
38
  specs:
39
- avm-eac_redmine_base0 (0.9.1)
39
+ avm-eac_redmine_base0 (0.11.0)
40
+ avm (~> 0.29)
41
+ avm-eac_generic_base0 (~> 0.4)
40
42
  avm-eac_rails_base1 (~> 0.4, >= 0.4.1)
41
43
  avm-eac_ubuntu_base0 (~> 0.3)
42
44
  curb (~> 0.9.11)
@@ -62,12 +64,10 @@ PATH
62
64
  PATH
63
65
  remote: sub/avm-tools
64
66
  specs:
65
- avm-tools (0.123.0)
67
+ avm-tools (0.126.0)
66
68
  aranha-parsers (~> 0.4)
67
69
  avm (~> 0.27)
68
70
  avm-eac_asciidoctor_base0 (~> 0.3, >= 0.3.4)
69
- avm-eac_rails_base0 (~> 0.3)
70
- avm-eac_redmine_base0 (~> 0.5, >= 0.5.2)
71
71
  avm-eac_ruby_base1 (~> 0.8)
72
72
  avm-eac_ubuntu_base0 (~> 0.3)
73
73
  avm-files (~> 0.1)
@@ -81,7 +81,7 @@ PATH
81
81
  PATH
82
82
  remote: sub/avm
83
83
  specs:
84
- avm (0.27.0)
84
+ avm (0.29.0)
85
85
  eac_cli (~> 0.27, >= 0.27.6)
86
86
  eac_config (~> 0.9)
87
87
  eac_docker (~> 0.3)
@@ -107,6 +107,13 @@ PATH
107
107
  addressable
108
108
  eac_ruby_utils (~> 0.83)
109
109
 
110
+ PATH
111
+ remote: sub/eac_docker
112
+ specs:
113
+ eac_docker (0.4.2)
114
+ eac_ruby_utils (~> 0.96)
115
+ eac_templates (~> 0.3, >= 0.3.1)
116
+
110
117
  PATH
111
118
  remote: sub/eac_fs
112
119
  specs:
@@ -127,7 +134,7 @@ PATH
127
134
  PATH
128
135
  remote: sub/eac_ruby_utils
129
136
  specs:
130
- eac_ruby_utils (0.95.3)
137
+ eac_ruby_utils (0.96.0)
131
138
  activesupport (>= 4, < 7)
132
139
  addressable (~> 2.6)
133
140
  bundler
@@ -191,9 +198,6 @@ GEM
191
198
  parslet (~> 2.0)
192
199
  curb (0.9.11)
193
200
  diff-lcs (1.5.0)
194
- eac_docker (0.4.1)
195
- eac_ruby_utils (~> 0.74)
196
- eac_templates (~> 0.1)
197
201
  eac_git (0.12.1)
198
202
  eac_ruby_utils (~> 0.83)
199
203
  parseconfig (~> 1.0, >= 1.0.8)
@@ -248,7 +252,7 @@ GEM
248
252
  minitest (5.16.2)
249
253
  multipart-post (2.2.3)
250
254
  net-ssh (4.2.0)
251
- nokogiri (1.13.7-x86_64-linux)
255
+ nokogiri (1.13.8-x86_64-linux)
252
256
  racc (~> 1.4)
253
257
  ofx-parser (1.1.0)
254
258
  hpricot (>= 0.6)
@@ -314,6 +318,7 @@ DEPENDENCIES
314
318
  avm-tools!
315
319
  eac_cli!
316
320
  eac_config!
321
+ eac_docker!
317
322
  eac_fs!
318
323
  eac_ruby_base0!
319
324
  eac_ruby_gem_support (~> 0.5.1)
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module EacTools
4
- VERSION = '0.9.0'
4
+ VERSION = '0.11.1'
5
5
  end
@@ -0,0 +1,31 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'avm/registry'
4
+
5
+ module Avm
6
+ module Applications
7
+ class Base
8
+ module Stereotype
9
+ # @return [Avm::ApplicationStereotypes::Base, nil]
10
+ def stereotype_by_configuration
11
+ entry('stereotype').optional_value.if_present do |v|
12
+ ::Avm::Registry.application_stereotypes.detect(v)
13
+ end
14
+ end
15
+
16
+ # @return [Avm::ApplicationStereotypes::Base, nil]
17
+ def stereotype_by_source
18
+ ::Avm::Registry.application_stereotypes.detect_optional(local_source.class)
19
+ end
20
+
21
+ private
22
+
23
+ # @return [Avm::ApplicationStereotypes::Base]
24
+ def stereotype_uncached
25
+ stereotype_by_configuration || stereotype_by_source ||
26
+ raise("Could not find stereotype for application \"#{self}\"")
27
+ end
28
+ end
29
+ end
30
+ end
31
+ end
@@ -1,13 +1,18 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  require 'avm/instances/entries'
4
+ require 'avm/registry'
4
5
  require 'eac_ruby_utils/core_ext'
5
6
 
6
7
  module Avm
7
8
  module Applications
8
9
  class Base
10
+ enable_simple_cache
11
+ require_sub __FILE__, include_modules: true
9
12
  include ::Avm::Instances::Entries
10
13
 
14
+ LOCAL_INSTANCE_SUFFIX = 'dev'
15
+
11
16
  common_constructor :id do
12
17
  self.id = id.to_s
13
18
  end
@@ -23,6 +28,18 @@ module Avm
23
28
  def name
24
29
  entry(::Avm::Instances::EntryKeys::NAME).read
25
30
  end
31
+
32
+ private
33
+
34
+ # @return [Avm::Instances::Base]
35
+ def local_instance_uncached
36
+ instance(LOCAL_INSTANCE_SUFFIX)
37
+ end
38
+
39
+ # @return [Avm::Sources::Base]
40
+ def local_source_uncached
41
+ ::Avm::Registry.sources.detect(local_instance.fs_path)
42
+ end
26
43
  end
27
44
  end
28
45
  end
@@ -3,16 +3,26 @@
3
3
  require 'avm/version'
4
4
  require 'eac_ruby_utils/core_ext'
5
5
  require 'eac_docker/images/templatized'
6
+ require 'eac_docker/registry'
6
7
 
7
8
  module Avm
8
9
  module Docker
9
10
  class Image < ::EacDocker::Images::Templatized
11
+ DEFAULT_REGISTRY_NAME = 'local'
12
+
13
+ class << self
14
+ # @return [EacDocker::Registry]
15
+ def default_registry
16
+ ::EacDocker::Registry.new(DEFAULT_REGISTRY_NAME)
17
+ end
18
+ end
19
+
10
20
  attr_reader :registry
11
21
  attr_accessor :snapshot
12
22
  attr_accessor :version
13
23
 
14
- def initialize(registry)
15
- @registry = registry
24
+ def initialize(registry = nil)
25
+ @registry = registry || self.class.default_registry
16
26
  self.snapshot = true
17
27
  self.version = true
18
28
  end
@@ -1,5 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
+ require 'avm/instances/base'
4
+ require 'avm/sources/base'
3
5
  require 'eac_ruby_utils/core_ext'
4
6
 
5
7
  module Avm
@@ -10,26 +12,40 @@ module Avm
10
12
 
11
13
  common_constructor :module_suffix
12
14
 
15
+ def detect(obj)
16
+ detect_optional(obj) || raise_not_found(obj)
17
+ end
18
+
19
+ def detect_optional(obj)
20
+ detect_by_instance_class(obj) || detect_by_source_class(obj) || detecy_by_name(obj)
21
+ end
22
+
13
23
  private
14
24
 
15
25
  def available_uncached
16
26
  build_available
17
27
  end
18
28
 
19
- # @return [Avm::Instances::Base, nil]
20
- def class_detect(klass, detect_args)
21
- r = ::Avm::Instances::Base.by_id(*detect_args)
22
- r.application.stereotype.instance_class == klass ? r : nil
29
+ def detect_by_instance_class(obj)
30
+ return nil unless obj.is_a?(::Class) && obj < ::Avm::Instances::Base
31
+
32
+ available.find { |a| a.instance_class == obj }
23
33
  end
24
34
 
25
- def detect(*registered_initialize_args)
26
- detect_optional(*registered_initialize_args) ||
27
- raise_not_found(*registered_initialize_args)
35
+ def detecy_by_name(obj)
36
+ return nil unless obj.is_a?(::String)
37
+
38
+ available.find { |a| a.name == obj }
39
+ end
40
+
41
+ def detect_by_source_class(obj)
42
+ return nil unless obj.is_a?(::Class) && obj < ::Avm::Sources::Base
43
+
44
+ available.find { |a| a.source_class == obj }
28
45
  end
29
46
 
30
- def detect_optional(*registered_initialize_args)
31
- registered_modules.reverse.lazy
32
- .map { |klass| class_detect(klass, registered_initialize_args) }.find(&:present?)
47
+ def raise_not_found(obj)
48
+ raise("No registered module valid for #{obj} (Available: #{available.join(', ')})")
33
49
  end
34
50
  end
35
51
  end
@@ -9,7 +9,7 @@ module Avm
9
9
  # @return [Avm::Instances::Base, nil]
10
10
  def class_detect(klass, detect_args)
11
11
  r = ::Avm::Instances::Base.by_id(*detect_args)
12
- r.application.stereotype.instance_class == klass ? r : nil
12
+ r.application.stereotype.instance_class == klass ? klass.by_id(*detect_args) : nil
13
13
  end
14
14
  end
15
15
  end
@@ -1,5 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
+ require 'avm/with_application_stereotype'
3
4
  require 'eac_ruby_utils/core_ext'
4
5
 
5
6
  module Avm
@@ -7,6 +8,7 @@ module Avm
7
8
  class Base
8
9
  enable_abstract_methods
9
10
  enable_simple_cache
11
+ include ::Avm::WithApplicationStereotype
10
12
  abstract_methods :update, :valid?
11
13
  common_constructor :path do
12
14
  self.path = path.to_pathname
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Avm
4
- VERSION = '0.27.0'
4
+ VERSION = '0.29.0'
5
5
  end
@@ -12,8 +12,8 @@ Gem::Specification.new do |s|
12
12
 
13
13
  s.files = Dir['{lib,locale}/**/*']
14
14
 
15
- s.add_dependency 'avm', '~> 0.24'
16
- s.add_dependency 'eac_ruby_utils', '~> 0.05', '>= 0.95.2'
15
+ s.add_dependency 'avm', '~> 0.28'
16
+ s.add_dependency 'eac_ruby_utils', '~> 0.96'
17
17
 
18
18
  s.add_development_dependency 'eac_ruby_gem_support', '~> 0.5.1'
19
19
  end
@@ -0,0 +1,61 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'eac_cli/core_ext'
4
+
5
+ module Avm
6
+ module EacGenericBase0
7
+ module Sources
8
+ module Docker
9
+ class Runner
10
+ CONTAINER_SOURCE_PATH = '/app'
11
+
12
+ enable_abstract_methods
13
+ abstract_methods :docker_image
14
+
15
+ runner_with :help do
16
+ desc 'Run a Docker container with source mapped.'
17
+ arg_opt '-c', '--command-arg', 'Arguments for [COMMAND] [ARG...].', optional: true,
18
+ repeat: true
19
+ end
20
+
21
+ def run
22
+ start_banner
23
+ docker_container.run_command.system!
24
+ end
25
+
26
+ def start_banner
27
+ infov 'Image', docker_image
28
+ infov 'Command', ::Shellwords.join(command_args)
29
+ end
30
+
31
+ def bash_command_args
32
+ %w[/bin/bash]
33
+ end
34
+
35
+ def command_args
36
+ if parsed.command_arg.any?
37
+ parsed.command_arg
38
+ else
39
+ default_command_args
40
+ end
41
+ end
42
+
43
+ def default_command_args
44
+ bash_command_args
45
+ end
46
+
47
+ def docker_container
48
+ docker_image.container
49
+ .volume(runner_context.call(:subject).path, CONTAINER_SOURCE_PATH)
50
+ .interactive(true).tty(true).command_args(command_args)
51
+ end
52
+
53
+ # @return [EacDocker::Images::Base]
54
+ def docker_image
55
+ raise_abstract_method __method__
56
+ end
57
+ end
58
+ end
59
+ end
60
+ end
61
+ end
@@ -0,0 +1,13 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'eac_ruby_utils/core_ext'
4
+
5
+ module Avm
6
+ module EacGenericBase0
7
+ module Sources
8
+ module Docker
9
+ require_sub __FILE__
10
+ end
11
+ end
12
+ end
13
+ end
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Avm
4
4
  module EacGenericBase0
5
- VERSION = '0.3.0'
5
+ VERSION = '0.4.0'
6
6
  end
7
7
  end
@@ -12,6 +12,8 @@ Gem::Specification.new do |s|
12
12
 
13
13
  s.files = Dir['{lib,locale,template}/**/*']
14
14
 
15
+ s.add_dependency 'avm', '~> 0.29'
16
+ s.add_dependency 'avm-eac_generic_base0', '~> 0.4'
15
17
  s.add_dependency 'avm-eac_rails_base1', '~> 0.4', '>= 0.4.1'
16
18
  s.add_dependency 'avm-eac_ubuntu_base0', '~> 0.3'
17
19
  s.add_dependency 'curb', '~> 0.9.11'
@@ -0,0 +1,14 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'avm/instances/base'
4
+ require 'avm/eac_redmine_base0/instances/runners'
5
+ require 'eac_ruby_utils/core_ext'
6
+
7
+ module Avm
8
+ module EacRedmineBase0
9
+ module Instances
10
+ class Base < ::Avm::Instances::Base
11
+ end
12
+ end
13
+ end
14
+ end
@@ -3,9 +3,9 @@
3
3
  require 'avm/docker/runner'
4
4
 
5
5
  module Avm
6
- module Tools
7
- class Runner
8
- class EacRedmineBase0 < ::Avm::EacRailsBase1::Runner
6
+ module EacRedmineBase0
7
+ module Instances
8
+ module Runners
9
9
  class Docker < ::Avm::Docker::Runner
10
10
  def use_default_registry?
11
11
  false
@@ -4,9 +4,9 @@ require 'eac_cli/core_ext'
4
4
  require 'avm/eac_rails_base1/runner/code_runner'
5
5
 
6
6
  module Avm
7
- module Tools
8
- class Runner
9
- class EacRedmineBase0 < ::Avm::EacRailsBase1::Runner
7
+ module EacRedmineBase0
8
+ module Instances
9
+ module Runners
10
10
  class ProjectRename
11
11
  runner_with ::Avm::EacRailsBase1::RunnerWith::Bundle do
12
12
  pos_arg :from
@@ -0,0 +1,13 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'eac_ruby_utils/core_ext'
4
+
5
+ module Avm
6
+ module EacRedmineBase0
7
+ module Instances
8
+ module Runners
9
+ require_sub __FILE__
10
+ end
11
+ end
12
+ end
13
+ end
@@ -0,0 +1,25 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'avm/eac_redmine_base0/instance'
4
+ require 'avm/eac_redmine_base0/deploy'
5
+ require 'avm/eac_redmine_base0/apache_host'
6
+ require 'avm/eac_rails_base1/runner'
7
+ require 'eac_ruby_utils/core_ext'
8
+
9
+ module Avm
10
+ module EacRedmineBase0
11
+ module Runners
12
+ class Base < ::Avm::EacRailsBase1::Runner
13
+ require_sub __FILE__
14
+
15
+ STEREOTYPE_NAME = 'EacRedmineBase0'
16
+
17
+ class << self
18
+ def stereotype_name
19
+ STEREOTYPE_NAME
20
+ end
21
+ end
22
+ end
23
+ end
24
+ end
25
+ end
@@ -1,10 +1,8 @@
1
1
  # frozen_string_literal: true
2
2
 
3
+ require 'avm/eac_rails_base1/sources/base'
3
4
  require 'avm/eac_redmine_base0/core_update'
4
5
  require 'eac_cli/core_ext'
5
- require 'avm/eac_rails_base1/sources/base'
6
- require 'avm/eac_redmine_base0/sources/runners'
7
- require 'eac_ruby_utils/core_ext'
8
6
 
9
7
  module Avm
10
8
  module EacRedmineBase0
@@ -0,0 +1,19 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'avm/eac_generic_base0/sources/docker/runner'
4
+ require 'avm/eac_ubuntu_base0/docker_image'
5
+
6
+ module Avm
7
+ module EacRedmineBase0
8
+ module Sources
9
+ module Runners
10
+ class Docker < ::Avm::EacGenericBase0::Sources::Docker::Runner
11
+ # @return [Avm::EacUbuntuBase0::DockerImage]
12
+ def docker_image
13
+ ::Avm::EacUbuntuBase0::DockerImage.new
14
+ end
15
+ end
16
+ end
17
+ end
18
+ end
19
+ end
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Avm
4
4
  module EacRedmineBase0
5
- VERSION = '0.9.1'
5
+ VERSION = '0.11.0'
6
6
  end
7
7
  end
@@ -26,14 +26,3 @@ h2. Instance's entries suffixes
26
26
  | system.username | Name of user that runs instance | @host_id->system.username or self->ssh.username@ |
27
27
  | web.url | Root URL to web interface | @nil@ |
28
28
  | web.hostname | Hostname of web interface | @web.url->hostname@ |
29
-
30
- h2. Instances' types hierarchy
31
-
32
- * base
33
- ** eac_ruby_base0
34
- ** eac_ubuntu_base0
35
- ** eac_webapp_base0
36
- *** eac_rails_base1
37
- **** eac_rails_base0
38
- **** eac_redmine_base0
39
- *** eac_wordpress_base0
@@ -17,8 +17,6 @@ Gem::Specification.new do |s|
17
17
  s.add_dependency 'aranha-parsers', '~> 0.4'
18
18
  s.add_dependency 'avm', '~> 0.27'
19
19
  s.add_dependency 'avm-eac_asciidoctor_base0', '~> 0.3', '>= 0.3.4'
20
- s.add_dependency 'avm-eac_rails_base0', '~> 0.3'
21
- s.add_dependency 'avm-eac_redmine_base0', '~> 0.5', '>= 0.5.2'
22
20
  s.add_dependency 'avm-eac_ruby_base1', '~> 0.8'
23
21
  s.add_dependency 'avm-eac_ubuntu_base0', '~> 0.3'
24
22
  s.add_dependency 'avm-files', '~> 0.1'
@@ -22,6 +22,7 @@ module Avm
22
22
  def base_banner
23
23
  infov 'ID', instance.id
24
24
  infov 'Application ID', instance.application.id
25
+ infov 'Application stereotype', instance.application.stereotype
25
26
  infov 'Suffix', instance.suffix
26
27
  end
27
28
 
@@ -1,6 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  require 'avm/instances/base'
4
+ require 'avm/registry'
4
5
  require 'eac_cli/core_ext'
5
6
 
6
7
  module Avm
@@ -14,10 +15,14 @@ module Avm
14
15
  subcommands
15
16
  end
16
17
 
18
+ def extra_available_subcommands
19
+ instance.if_present({}, &:extra_available_subcommands)
20
+ end
21
+
17
22
  private
18
23
 
19
24
  def instance_uncached
20
- ::Avm::Instances::Base.by_id(parsed.instance_id)
25
+ ::Avm::Registry.instances.detect(parsed.instance_id)
21
26
  end
22
27
  end
23
28
  end
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Avm
4
4
  module Tools
5
- VERSION = '0.123.0'
5
+ VERSION = '0.126.0'
6
6
  end
7
7
  end
@@ -0,0 +1,8 @@
1
+ # frozen_string_literal: true
2
+
3
+ source 'https://rubygems.org'
4
+
5
+ gemspec
6
+
7
+ local_gemfile = ::File.join(::File.dirname(__FILE__), 'Gemfile.local')
8
+ eval_gemfile local_gemfile if ::File.exist?(local_gemfile)
@@ -12,8 +12,8 @@ Gem::Specification.new do |s|
12
12
 
13
13
  s.files = Dir['{lib}/**/*']
14
14
 
15
- s.add_dependency 'eac_ruby_utils', '~> 0.74'
16
- s.add_dependency 'eac_templates', '~> 0.1'
15
+ s.add_dependency 'eac_ruby_utils', '~> 0.96'
16
+ s.add_dependency 'eac_templates', '~> 0.3', '>= 0.3.1'
17
17
 
18
- s.add_development_dependency 'eac_ruby_gem_support', '~> 0.3', '>= 0.3.3'
18
+ s.add_development_dependency 'eac_ruby_gem_support', '~> 0.5.1'
19
19
  end
@@ -34,7 +34,7 @@ module EacDocker
34
34
  end
35
35
  end
36
36
 
37
- def volume(left_part, right_part = null)
37
+ def volume(left_part, right_part = nil)
38
38
  immutable_volume(right_part.if_present(left_part) { |v| "#{left_part}:#{v}" })
39
39
  end
40
40
 
@@ -43,8 +43,9 @@ module EacDocker
43
43
  end
44
44
 
45
45
  def run_command_args
46
- run_command_boolean_args + run_command_capabilities_args + run_command_envs_args +
47
- run_command_volumes_args + [image.provide.id] + command_args
46
+ %w[boolean capabilities envs volumes]
47
+ .inject([]) { |a, e| a + send("run_command_#{e}_args") } +
48
+ [image.provide.id] + command_args
48
49
  end
49
50
 
50
51
  def stop
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module EacDocker
4
- VERSION = '0.4.1'
4
+ VERSION = '0.4.2'
5
5
  end
@@ -8,13 +8,26 @@ module EacRubyUtils
8
8
  module Immutable
9
9
  class ArrayAccessor < ::EacRubyUtils::Immutable::BaseAccessor
10
10
  def apply(klass)
11
+ apply_singular(klass)
12
+ apply_plural(klass)
13
+ end
14
+
15
+ def apply_plural(klass)
11
16
  accessor = self
12
- klass.send(:define_method, name) do |value|
13
- accessor.immutable_value_set(self, value)
17
+ klass.send(:define_method, ::ActiveSupport::Inflector.pluralize(name)) do |*args|
18
+ case args.count
19
+ when 0 then next accessor.immutable_value_get(self)
20
+ when 1 then next accessor.immutable_value_set(self, args.first)
21
+ else
22
+ raise ::ArgumentError, "wrong number of arguments (given #{args.count}, expected 0..1)"
23
+ end
14
24
  end
25
+ end
15
26
 
16
- klass.send(:define_method, ::ActiveSupport::Inflector.pluralize(name)) do
17
- accessor.immutable_value_get(self)
27
+ def apply_singular(klass)
28
+ accessor = self
29
+ klass.send(:define_method, name) do |value|
30
+ accessor.immutable_value_push(self, value)
18
31
  end
19
32
  end
20
33
 
@@ -22,11 +35,15 @@ module EacRubyUtils
22
35
  super || []
23
36
  end
24
37
 
25
- def immutable_value_set(object, value)
38
+ def immutable_value_push(object, value)
26
39
  duplicate_object(object) do |old_value|
27
40
  (old_value || []) + [value]
28
41
  end
29
42
  end
43
+
44
+ def immutable_value_set(object, value)
45
+ duplicate_object(object) { |_old_value| value }
46
+ end
30
47
  end
31
48
  end
32
49
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module EacRubyUtils
4
- VERSION = '0.95.3'
4
+ VERSION = '0.96.0'
5
5
  end
@@ -0,0 +1,34 @@
1
+ # frozen_string_literal: true
2
+
3
+ ::RSpec.describe ::EacRubyUtils::Immutable do
4
+ let(:stub_class) do
5
+ the_described_class = described_class
6
+ ::Class.new do
7
+ include the_described_class
8
+
9
+ immutable_accessor :array_attr, type: :array
10
+ end
11
+ end
12
+
13
+ let(:initial_instance) { stub_class.new }
14
+
15
+ it do
16
+ expect(initial_instance.array_attrs).to eq([])
17
+ end
18
+
19
+ context 'when array_attr pushs for' do
20
+ let(:change1_instance) { initial_instance.array_attr('A') }
21
+
22
+ it { expect(change1_instance).to be_a(initial_instance.class) }
23
+ it { expect(change1_instance.object_id).not_to eq(initial_instance.object_id) }
24
+ it { expect(change1_instance.array_attrs).to eq(%w[A]) }
25
+
26
+ context 'when array_attrs sets for' do
27
+ let(:change2_instance) { initial_instance.array_attrs(%w[B]) }
28
+
29
+ it { expect(change2_instance).to be_a(initial_instance.class) }
30
+ it { expect(change2_instance.object_id).not_to eq(change1_instance.object_id) }
31
+ it { expect(change2_instance.array_attrs).to eq(%w[B]) }
32
+ end
33
+ end
34
+ end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: eac_tools
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.9.0
4
+ version: 0.11.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Put here the authors
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-07-22 00:00:00.000000000 Z
11
+ date: 2022-07-26 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: avm-eac_generic_base0
@@ -16,14 +16,14 @@ dependencies:
16
16
  requirements:
17
17
  - - "~>"
18
18
  - !ruby/object:Gem::Version
19
- version: '0.3'
19
+ version: '0.4'
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - "~>"
25
25
  - !ruby/object:Gem::Version
26
- version: '0.3'
26
+ version: '0.4'
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: avm-eac_rails_base0
29
29
  requirement: !ruby/object:Gem::Requirement
@@ -64,14 +64,14 @@ dependencies:
64
64
  requirements:
65
65
  - - "~>"
66
66
  - !ruby/object:Gem::Version
67
- version: '0.9'
67
+ version: '0.11'
68
68
  type: :runtime
69
69
  prerelease: false
70
70
  version_requirements: !ruby/object:Gem::Requirement
71
71
  requirements:
72
72
  - - "~>"
73
73
  - !ruby/object:Gem::Version
74
- version: '0.9'
74
+ version: '0.11'
75
75
  - !ruby/object:Gem::Dependency
76
76
  name: avm-eac_redmine_plugin_base0
77
77
  requirement: !ruby/object:Gem::Requirement
@@ -106,34 +106,28 @@ dependencies:
106
106
  requirements:
107
107
  - - "~>"
108
108
  - !ruby/object:Gem::Version
109
- version: '0.123'
109
+ version: '0.126'
110
110
  type: :runtime
111
111
  prerelease: false
112
112
  version_requirements: !ruby/object:Gem::Requirement
113
113
  requirements:
114
114
  - - "~>"
115
115
  - !ruby/object:Gem::Version
116
- version: '0.123'
116
+ version: '0.126'
117
117
  - !ruby/object:Gem::Dependency
118
118
  name: eac_ruby_utils
119
119
  requirement: !ruby/object:Gem::Requirement
120
120
  requirements:
121
121
  - - "~>"
122
122
  - !ruby/object:Gem::Version
123
- version: '0.95'
124
- - - ">="
125
- - !ruby/object:Gem::Version
126
- version: 0.95.2
123
+ version: '0.96'
127
124
  type: :runtime
128
125
  prerelease: false
129
126
  version_requirements: !ruby/object:Gem::Requirement
130
127
  requirements:
131
128
  - - "~>"
132
129
  - !ruby/object:Gem::Version
133
- version: '0.95'
134
- - - ">="
135
- - !ruby/object:Gem::Version
136
- version: 0.95.2
130
+ version: '0.96'
137
131
  - !ruby/object:Gem::Dependency
138
132
  name: eac_ruby_gem_support
139
133
  requirement: !ruby/object:Gem::Requirement
@@ -164,6 +158,8 @@ files:
164
158
  - sub/avm-eac_generic_base0/lib/avm/eac_generic_base0/sources.rb
165
159
  - sub/avm-eac_generic_base0/lib/avm/eac_generic_base0/sources/base.rb
166
160
  - sub/avm-eac_generic_base0/lib/avm/eac_generic_base0/sources/base/version_bump.rb
161
+ - sub/avm-eac_generic_base0/lib/avm/eac_generic_base0/sources/docker.rb
162
+ - sub/avm-eac_generic_base0/lib/avm/eac_generic_base0/sources/docker/runner.rb
167
163
  - sub/avm-eac_generic_base0/lib/avm/eac_generic_base0/version.rb
168
164
  - sub/avm-eac_generic_base0/locale/en.yml
169
165
  - sub/avm-eac_generic_base0/locale/pt-BR.yml
@@ -223,11 +219,17 @@ files:
223
219
  - sub/avm-eac_redmine_base0/lib/avm/eac_redmine_base0/data_unit.rb
224
220
  - sub/avm-eac_redmine_base0/lib/avm/eac_redmine_base0/deploy.rb
225
221
  - sub/avm-eac_redmine_base0/lib/avm/eac_redmine_base0/instance.rb
222
+ - sub/avm-eac_redmine_base0/lib/avm/eac_redmine_base0/instances/base.rb
226
223
  - sub/avm-eac_redmine_base0/lib/avm/eac_redmine_base0/instances/docker_image.rb
224
+ - sub/avm-eac_redmine_base0/lib/avm/eac_redmine_base0/instances/runners.rb
225
+ - sub/avm-eac_redmine_base0/lib/avm/eac_redmine_base0/instances/runners/docker.rb
226
+ - sub/avm-eac_redmine_base0/lib/avm/eac_redmine_base0/instances/runners/project_rename.rb
227
227
  - sub/avm-eac_redmine_base0/lib/avm/eac_redmine_base0/rest_api.rb
228
+ - sub/avm-eac_redmine_base0/lib/avm/eac_redmine_base0/runners/base.rb
228
229
  - sub/avm-eac_redmine_base0/lib/avm/eac_redmine_base0/sources/base.rb
229
230
  - sub/avm-eac_redmine_base0/lib/avm/eac_redmine_base0/sources/runners.rb
230
231
  - sub/avm-eac_redmine_base0/lib/avm/eac_redmine_base0/sources/runners/core_update.rb
232
+ - sub/avm-eac_redmine_base0/lib/avm/eac_redmine_base0/sources/runners/docker.rb
231
233
  - sub/avm-eac_redmine_base0/lib/avm/eac_redmine_base0/version.rb
232
234
  - sub/avm-eac_redmine_base0/locale/en.yml
233
235
  - sub/avm-eac_redmine_base0/locale/pt-BR.yml
@@ -423,10 +425,6 @@ files:
423
425
  - sub/avm-tools/lib/avm/tools/runner/config.rb
424
426
  - sub/avm-tools/lib/avm/tools/runner/config/load_path.rb
425
427
  - sub/avm-tools/lib/avm/tools/runner/eac_asciidoctor_base0.rb
426
- - sub/avm-tools/lib/avm/tools/runner/eac_redmine_base0.rb
427
- - sub/avm-tools/lib/avm/tools/runner/eac_redmine_base0/dev_docker.rb
428
- - sub/avm-tools/lib/avm/tools/runner/eac_redmine_base0/docker.rb
429
- - sub/avm-tools/lib/avm/tools/runner/eac_redmine_base0/project_rename.rb
430
428
  - sub/avm-tools/lib/avm/tools/runner/eac_webapp_base0.rb
431
429
  - sub/avm-tools/lib/avm/tools/runner/eac_wordpress_base0.rb
432
430
  - sub/avm-tools/lib/avm/tools/runner/eac_writings_base0.rb
@@ -683,28 +681,6 @@ files:
683
681
  - sub/avm-tools/sub/avm-git/spec/lib/avm/git/scms/git_subrepo_spec.rb
684
682
  - sub/avm-tools/sub/avm-git/spec/rubocop_spec.rb
685
683
  - sub/avm-tools/sub/avm-git/spec/spec_helper.rb
686
- - sub/avm-tools/sub/eac_docker/Gemfile
687
- - sub/avm-tools/sub/eac_docker/eac_docker.gemspec
688
- - sub/avm-tools/sub/eac_docker/lib/eac_docker.rb
689
- - sub/avm-tools/sub/eac_docker/lib/eac_docker/container.rb
690
- - sub/avm-tools/sub/eac_docker/lib/eac_docker/debug.rb
691
- - sub/avm-tools/sub/eac_docker/lib/eac_docker/executables.rb
692
- - sub/avm-tools/sub/eac_docker/lib/eac_docker/images.rb
693
- - sub/avm-tools/sub/eac_docker/lib/eac_docker/images/base.rb
694
- - sub/avm-tools/sub/eac_docker/lib/eac_docker/images/coded.rb
695
- - sub/avm-tools/sub/eac_docker/lib/eac_docker/images/named.rb
696
- - sub/avm-tools/sub/eac_docker/lib/eac_docker/images/templatized.rb
697
- - sub/avm-tools/sub/eac_docker/lib/eac_docker/registry.rb
698
- - sub/avm-tools/sub/eac_docker/lib/eac_docker/rspec.rb
699
- - sub/avm-tools/sub/eac_docker/lib/eac_docker/rspec/setup.rb
700
- - sub/avm-tools/sub/eac_docker/lib/eac_docker/version.rb
701
- - sub/avm-tools/sub/eac_docker/spec/lib/eac_docker/executables_spec.rb
702
- - sub/avm-tools/sub/eac_docker/spec/lib/eac_docker/images/coded_spec.rb
703
- - sub/avm-tools/sub/eac_docker/spec/lib/eac_docker/images/coded_spec_files/image1/Dockerfile
704
- - sub/avm-tools/sub/eac_docker/spec/lib/eac_docker/images/templatized_spec.rb
705
- - sub/avm-tools/sub/eac_docker/spec/lib/eac_docker/images/templatized_spec_files/stub_docker_image/Dockerfile
706
- - sub/avm-tools/sub/eac_docker/spec/rubocop_spec.rb
707
- - sub/avm-tools/sub/eac_docker/spec/spec_helper.rb
708
684
  - sub/avm-tools/sub/eac_git/Gemfile
709
685
  - sub/avm-tools/sub/eac_git/eac_git.gemspec
710
686
  - sub/avm-tools/sub/eac_git/lib/eac_git.rb
@@ -995,10 +971,9 @@ files:
995
971
  - sub/avm/lib/avm.rb
996
972
  - sub/avm/lib/avm/application_stereotypes.rb
997
973
  - sub/avm/lib/avm/application_stereotypes/base.rb
998
- - sub/avm/lib/avm/application_stereotypes/base/by_gem.rb
999
- - sub/avm/lib/avm/application_stereotypes/base/detection.rb
1000
974
  - sub/avm/lib/avm/applications.rb
1001
975
  - sub/avm/lib/avm/applications/base.rb
976
+ - sub/avm/lib/avm/applications/base/stereotype.rb
1002
977
  - sub/avm/lib/avm/data/instance.rb
1003
978
  - sub/avm/lib/avm/data/instance/files_unit.rb
1004
979
  - sub/avm/lib/avm/data/instance/package.rb
@@ -1197,6 +1172,28 @@ files:
1197
1172
  - sub/eac_config/spec/lib/eac_config/yaml_file_node_spec_files/storage1_2/storage1_2_1.yaml
1198
1173
  - sub/eac_config/spec/rubocop_spec.rb
1199
1174
  - sub/eac_config/spec/spec_helper.rb
1175
+ - sub/eac_docker/Gemfile
1176
+ - sub/eac_docker/eac_docker.gemspec
1177
+ - sub/eac_docker/lib/eac_docker.rb
1178
+ - sub/eac_docker/lib/eac_docker/container.rb
1179
+ - sub/eac_docker/lib/eac_docker/debug.rb
1180
+ - sub/eac_docker/lib/eac_docker/executables.rb
1181
+ - sub/eac_docker/lib/eac_docker/images.rb
1182
+ - sub/eac_docker/lib/eac_docker/images/base.rb
1183
+ - sub/eac_docker/lib/eac_docker/images/coded.rb
1184
+ - sub/eac_docker/lib/eac_docker/images/named.rb
1185
+ - sub/eac_docker/lib/eac_docker/images/templatized.rb
1186
+ - sub/eac_docker/lib/eac_docker/registry.rb
1187
+ - sub/eac_docker/lib/eac_docker/rspec.rb
1188
+ - sub/eac_docker/lib/eac_docker/rspec/setup.rb
1189
+ - sub/eac_docker/lib/eac_docker/version.rb
1190
+ - sub/eac_docker/spec/lib/eac_docker/executables_spec.rb
1191
+ - sub/eac_docker/spec/lib/eac_docker/images/coded_spec.rb
1192
+ - sub/eac_docker/spec/lib/eac_docker/images/coded_spec_files/image1/Dockerfile
1193
+ - sub/eac_docker/spec/lib/eac_docker/images/templatized_spec.rb
1194
+ - sub/eac_docker/spec/lib/eac_docker/images/templatized_spec_files/stub_docker_image/Dockerfile
1195
+ - sub/eac_docker/spec/rubocop_spec.rb
1196
+ - sub/eac_docker/spec/spec_helper.rb
1200
1197
  - sub/eac_fs/Gemfile
1201
1198
  - sub/eac_fs/eac_fs.gemspec
1202
1199
  - sub/eac_fs/lib/eac_fs.rb
@@ -1417,6 +1414,7 @@ files:
1417
1414
  - sub/eac_ruby_utils/spec/lib/eac_ruby_utils/fs/extname_spec.rb
1418
1415
  - sub/eac_ruby_utils/spec/lib/eac_ruby_utils/fs/temp/directory_spec.rb
1419
1416
  - sub/eac_ruby_utils/spec/lib/eac_ruby_utils/fs/temp_spec.rb
1417
+ - sub/eac_ruby_utils/spec/lib/eac_ruby_utils/immutable_spec.rb
1420
1418
  - sub/eac_ruby_utils/spec/lib/eac_ruby_utils/inflector_spec.rb
1421
1419
  - sub/eac_ruby_utils/spec/lib/eac_ruby_utils/listable_spec.rb
1422
1420
  - sub/eac_ruby_utils/spec/lib/eac_ruby_utils/local_time_zone_spec.rb
@@ -1,17 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- module Avm
4
- module ApplicationStereotypes
5
- class Base
6
- module ByGem
7
- common_concern
8
-
9
- module ClassMethods
10
- def by_gem(gem_name)
11
- new(gem_name.gsub('-', '/').camelize)
12
- end
13
- end
14
- end
15
- end
16
- end
17
- end
@@ -1,34 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- module Avm
4
- module ApplicationStereotypes
5
- class Base
6
- module Detection
7
- common_concern
8
-
9
- module ClassMethods
10
- # @return [Class<Avm::Sources::Base>, nil]
11
- def detect(object)
12
- return singleton_instance if
13
- %w[name instance_class source_class].any? { |t| send("detect_by_#{t}?", object) }
14
- end
15
-
16
- # @return [Boolean]
17
- def detect_by_instance_class?(object)
18
- object.is_a?(::Class) && singleton_instance.instance_class == object
19
- end
20
-
21
- # @return [Boolean]
22
- def detect_by_name?(object)
23
- object.is_a?(::String) && singleton_instance.name == object
24
- end
25
-
26
- # @return [Boolean]
27
- def detect_by_source_class?(object)
28
- object.is_a?(::Class) && singleton_instance.source_class == object
29
- end
30
- end
31
- end
32
- end
33
- end
34
- end
@@ -1,17 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- require 'avm/docker/runner'
4
-
5
- module Avm
6
- module Tools
7
- class Runner
8
- class EacRedmineBase0 < ::Avm::EacRailsBase1::Runner
9
- class DevDocker < ::Avm::Docker::Runner
10
- def docker_image
11
- ::Avm::EacUbuntuBase0::DockerImage
12
- end
13
- end
14
- end
15
- end
16
- end
17
- end
@@ -1,15 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- require 'avm/eac_rails_base1/runner'
4
- require 'avm/eac_redmine_base0'
5
- require 'eac_ruby_utils/core_ext'
6
-
7
- module Avm
8
- module Tools
9
- class Runner
10
- class EacRedmineBase0 < ::Avm::EacRailsBase1::Runner
11
- require_sub __FILE__
12
- end
13
- end
14
- end
15
- end
@@ -1,5 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- source 'https://rubygems.org'
4
-
5
- gemspec