eac_tools 0.11.1 → 0.14.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (84) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile.lock +23 -22
  3. data/lib/eac_tools/version.rb +1 -1
  4. data/sub/avm/avm.gemspec +2 -2
  5. data/sub/avm/lib/avm/application_stereotypes/base.rb +11 -1
  6. data/sub/avm/lib/avm/instances/base/auto_values/admin.rb +2 -2
  7. data/sub/avm/lib/avm/instances/base/auto_values/database.rb +1 -1
  8. data/sub/avm/lib/avm/instances/base/auto_values/filesystem.rb +9 -8
  9. data/sub/avm/lib/avm/instances/base/auto_values/install.rb +48 -0
  10. data/sub/avm/lib/avm/instances/base/auto_values/mailer.rb +2 -2
  11. data/sub/avm/lib/avm/instances/base/auto_values/ruby.rb +1 -1
  12. data/sub/avm/lib/avm/instances/base/auto_values/system.rb +3 -3
  13. data/sub/avm/lib/avm/instances/base/auto_values.rb +4 -5
  14. data/sub/avm/lib/avm/instances/base.rb +8 -8
  15. data/sub/avm/lib/avm/instances/entry_keys.rb +8 -7
  16. data/sub/avm/lib/avm/instances.rb +3 -2
  17. data/sub/avm/lib/avm/registry/application_stereotypes/build_available.rb +9 -6
  18. data/sub/avm/lib/avm/registry/application_stereotypes/stereotype_builder.rb +8 -5
  19. data/sub/avm/lib/avm/registry/source_generators.rb +16 -0
  20. data/sub/avm/lib/avm/registry.rb +2 -1
  21. data/sub/avm/lib/avm/scms/base.rb +2 -2
  22. data/sub/avm/lib/avm/source_generators/base.rb +29 -0
  23. data/sub/avm/lib/avm/source_generators.rb +9 -0
  24. data/sub/avm/lib/avm/sources/base.rb +4 -4
  25. data/sub/avm/lib/avm/version.rb +1 -1
  26. data/sub/avm/lib/avm/with/application_stereotype.rb +35 -0
  27. data/sub/avm/lib/avm/with/extra_subcommands.rb +44 -0
  28. data/sub/avm/spec/lib/avm/instances/base_spec.rb +50 -50
  29. data/sub/avm/spec/lib/avm/instances/base_spec_configs_storage.yml +5 -3
  30. data/sub/avm-eac_rails_base0/avm-eac_rails_base0.gemspec +3 -3
  31. data/sub/avm-eac_rails_base0/lib/avm/eac_rails_base0/source_generators/base.rb +13 -0
  32. data/sub/avm-eac_rails_base0/lib/avm/eac_rails_base0/version.rb +1 -1
  33. data/sub/avm-eac_rails_base0/template/avm/eac_rails_base0/source_generators/base/Gemfile +11 -0
  34. data/sub/avm-eac_rails_base0/template/avm/eac_rails_base0/source_generators/base/Rakefile +8 -0
  35. data/sub/avm-eac_rails_base0/template/avm/eac_rails_base0/source_generators/base/app/assets/config/manifest.js +3 -0
  36. data/sub/avm-eac_rails_base0/template/avm/eac_rails_base0/source_generators/base/app/assets/javascripts/application.js +1 -0
  37. data/sub/avm-eac_rails_base0/template/avm/eac_rails_base0/source_generators/base/app/assets/stylesheets/application.scss +1 -0
  38. data/sub/avm-eac_rails_base0/template/avm/eac_rails_base0/source_generators/base/app/controllers/application_controller.rb +4 -0
  39. data/sub/avm-eac_rails_base0/template/avm/eac_rails_base0/source_generators/base/app/controllers/welcome_controller.rb +5 -0
  40. data/sub/avm-eac_rails_base0/template/avm/eac_rails_base0/source_generators/base/app/views/welcome/index.html.erb +1 -0
  41. data/sub/avm-eac_rails_base0/template/avm/eac_rails_base0/source_generators/base/bin/bundle +5 -0
  42. data/sub/avm-eac_rails_base0/template/avm/eac_rails_base0/source_generators/base/bin/rails +11 -0
  43. data/sub/avm-eac_rails_base0/template/avm/eac_rails_base0/source_generators/base/bin/rake +11 -0
  44. data/sub/avm-eac_rails_base0/template/avm/eac_rails_base0/source_generators/base/bin/yarn +11 -0
  45. data/sub/avm-eac_rails_base0/template/avm/eac_rails_base0/source_generators/base/config/application.rb +11 -0
  46. data/sub/avm-eac_rails_base0/template/avm/eac_rails_base0/source_generators/base/config/boot.rb +5 -0
  47. data/sub/avm-eac_rails_base0/template/avm/eac_rails_base0/source_generators/base/config/cable.yml +8 -0
  48. data/sub/avm-eac_rails_base0/template/avm/eac_rails_base0/source_generators/base/config/credentials.yml.enc +1 -0
  49. data/sub/avm-eac_rails_base0/template/avm/eac_rails_base0/source_generators/base/config/environment.rb +7 -0
  50. data/sub/avm-eac_rails_base0/template/avm/eac_rails_base0/source_generators/base/config/puma.rb +39 -0
  51. data/sub/avm-eac_rails_base0/template/avm/eac_rails_base0/source_generators/base/config/routes.rb +5 -0
  52. data/sub/avm-eac_rails_base0/template/avm/eac_rails_base0/source_generators/base/config/spring.rb +8 -0
  53. data/sub/avm-eac_rails_base0/template/avm/eac_rails_base0/source_generators/base/config.ru +7 -0
  54. data/sub/avm-eac_rails_base0/template/avm/eac_rails_base0/source_generators/base/db/schema.rb +1 -0
  55. data/sub/avm-eac_rails_base0/template/avm/eac_rails_base0/source_generators/base/lib/ability.rb +20 -0
  56. data/sub/avm-eac_rails_base0/template/avm/eac_rails_base0/source_generators/base/lib/ability_mapping.rb +10 -0
  57. data/sub/avm-eac_rails_base0/template/avm/eac_rails_base0/source_generators/base/public/favicon.ico +0 -0
  58. data/sub/avm-eac_rails_base0/template/avm/eac_rails_base0/source_generators/base/spec/code/rubocop_spec.rb +3 -0
  59. data/sub/avm-eac_rails_base0/template/avm/eac_rails_base0/source_generators/base/spec/spec_helper.rb +8 -0
  60. data/sub/avm-eac_rails_base1/avm-eac_rails_base1.gemspec +3 -2
  61. data/sub/avm-eac_rails_base1/lib/avm/eac_rails_base1/systemd_unit.rb +1 -1
  62. data/sub/avm-eac_rails_base1/lib/avm/eac_rails_base1/version.rb +1 -1
  63. data/sub/avm-eac_ruby_base1/lib/avm/eac_ruby_base1/rubygems/gemspec/add_or_replace_gem_line.rb +62 -0
  64. data/sub/avm-eac_ruby_base1/lib/avm/eac_ruby_base1/rubygems/gemspec/dependency.rb +19 -0
  65. data/sub/avm-eac_ruby_base1/lib/avm/eac_ruby_base1/rubygems/gemspec.rb +42 -0
  66. data/sub/avm-eac_ruby_base1/lib/avm/eac_ruby_base1/version.rb +1 -1
  67. data/sub/avm-tools/avm-tools.gemspec +1 -1
  68. data/sub/avm-tools/lib/avm/tools/runner/source_generate.rb +45 -0
  69. data/sub/avm-tools/lib/avm/tools/version.rb +1 -1
  70. data/sub/eac_config/eac_config.gemspec +1 -1
  71. data/sub/eac_config/lib/eac_config/entry_path.rb +15 -4
  72. data/sub/eac_config/lib/eac_config/version.rb +1 -1
  73. data/sub/eac_ruby_utils/lib/eac_ruby_utils/regexp_parser.rb +5 -0
  74. data/sub/eac_ruby_utils/lib/eac_ruby_utils/require_sub/base.rb +67 -0
  75. data/sub/eac_ruby_utils/lib/eac_ruby_utils/require_sub/sub_file.rb +68 -0
  76. data/sub/eac_ruby_utils/lib/eac_ruby_utils/require_sub.rb +2 -125
  77. data/sub/eac_ruby_utils/lib/eac_ruby_utils/version.rb +1 -1
  78. data/sub/eac_ruby_utils/spec/lib/eac_ruby_utils/{require_sub_spec → require_sub/base_spec}/stubbed_module_a.rb +0 -0
  79. data/sub/eac_ruby_utils/spec/lib/eac_ruby_utils/{require_sub_spec → require_sub/base_spec}/stubbed_not_module.rb +0 -0
  80. data/sub/eac_ruby_utils/spec/lib/eac_ruby_utils/{require_sub_spec.rb → require_sub/base_spec.rb} +1 -1
  81. metadata +61 -18
  82. data/sub/avm/lib/avm/instances/base/auto_values/access.rb +0 -40
  83. data/sub/avm/lib/avm/with_application_stereotype.rb +0 -23
  84. data/sub/avm/lib/avm/with_dynamic_runners.rb +0 -42
@@ -0,0 +1,44 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'eac_cli/runner_with/subcommands'
4
+ require 'eac_ruby_utils/core_ext'
5
+
6
+ module Avm
7
+ module With
8
+ module ExtraSubcommands
9
+ # @return [Hash<String, EacCli::Runner>]
10
+ def extra_available_subcommands
11
+ extra_available_subcommands_from_runners_module
12
+ end
13
+
14
+ # @return [Hash<String, EacCli::Runner>]
15
+ def extra_available_subcommands_from_runners_module
16
+ self.class.ancestors.reverse.inject({}) do |a, e|
17
+ a.merge(RunnersFromModule.new(e).result)
18
+ end
19
+ end
20
+
21
+ class RunnersFromModule
22
+ enable_simple_cache
23
+ common_constructor :the_module
24
+
25
+ # @return [Hash<String, EacCli::Runner>]
26
+ def result
27
+ return {} if runners_module.blank?
28
+
29
+ ::EacCli::RunnerWith::Subcommands.subcommands_from_module(runners_module)
30
+ end
31
+
32
+ def runners_module_uncached
33
+ return nil if the_module.module_parent.blank?
34
+
35
+ begin
36
+ the_module.module_parent.const_get('Runners')
37
+ rescue ::NameError
38
+ nil
39
+ end
40
+ end
41
+ end
42
+ end
43
+ end
44
+ end
@@ -13,56 +13,56 @@ RSpec.describe ::Avm::Instances::Base do
13
13
  .stub_eac_config_node(self, ::File.join(__dir__, 'base_spec_configs_storage.yml'))
14
14
 
15
15
  describe '#read_entry' do
16
- context 'when a auto value is requested' do
17
- {
18
- 'app_0' => {
19
- fs_path: '/fs_root/app_0',
20
- data_fs_path: '/data_fs_root/app_0',
21
- ::Avm::Instances::EntryKeys::DATABASE_NAME => 'app_0',
22
- ::Avm::Instances::EntryKeys::DATABASE_USERNAME => 'user1',
23
- ::Avm::Instances::EntryKeys::DATABASE_PASSWORD => 'pass1',
24
- ::Avm::Instances::EntryKeys::DATABASE_HOSTNAME => 'database.net',
25
- ::Avm::Instances::EntryKeys::DATABASE_PORT => 5432,
26
- ::Avm::Instances::EntryKeys::SSH_HOSTNAME => 'myhost.com',
27
- ::Avm::Instances::EntryKeys::SSH_USERNAME => 'myuser',
28
- ::Avm::Instances::EntryKeys::SSH_URL => 'ssh://otheruser@otherhost.com'
29
- },
30
- 'app_2' => {
31
- ::Avm::Instances::EntryKeys::DATABASE_HOSTNAME => '127.0.0.1',
32
- ::Avm::Instances::EntryKeys::SOURCE_INSTANCE_ID => 'app_dev'
33
- },
34
- 'app_3' => {
35
- ::Avm::Instances::EntryKeys::DATABASE_SYSTEM => 'postgresql',
36
- ::Avm::Instances::EntryKeys::DATABASE_NAME => 'app_1_db',
37
- ::Avm::Instances::EntryKeys::DATABASE_USERNAME => 'user1',
38
- ::Avm::Instances::EntryKeys::DATABASE_PASSWORD => 'pass1',
39
- ::Avm::Instances::EntryKeys::DATABASE_HOSTNAME => 'database.net',
40
- ::Avm::Instances::EntryKeys::DATABASE_PORT => 5432,
41
- ::Avm::Instances::EntryKeys::MAILER_ID => 'mailer_0',
42
- ::Avm::Instances::EntryKeys::MAILER_FROM => 'noreply@example.net',
43
- ::Avm::Instances::EntryKeys::MAILER_REPLY_TO => nil,
44
- ::Avm::Instances::EntryKeys::MAILER_SMTP_ADDRESS => 'smtp.example.net',
45
- ::Avm::Instances::EntryKeys::MAILER_SMTP_PORT => '587',
46
- ::Avm::Instances::EntryKeys::MAILER_SMTP_DOMAIN => 'example.net',
47
- ::Avm::Instances::EntryKeys::MAILER_SMTP_USERNAME => 'a_user',
48
- ::Avm::Instances::EntryKeys::MAILER_SMTP_PASSWORD => 'a_secret',
49
- ::Avm::Instances::EntryKeys::MAILER_SMTP_AUTHENTICATION => 'plain',
50
- ::Avm::Instances::EntryKeys::MAILER_SMTP_STARTTLS_AUTO => 'true'
51
- },
52
- 'mailer_0' => {
53
- ::Avm::Instances::EntryKeys::MAILER_FROM => 'noreply@example.net',
54
- ::Avm::Instances::EntryKeys::MAILER_REPLY_TO => '',
55
- ::Avm::Instances::EntryKeys::MAILER_SMTP_ADDRESS => 'smtp.example.net',
56
- ::Avm::Instances::EntryKeys::MAILER_SMTP_PORT => '587',
57
- ::Avm::Instances::EntryKeys::MAILER_SMTP_DOMAIN => 'example.net',
58
- ::Avm::Instances::EntryKeys::MAILER_SMTP_USERNAME => 'a_user',
59
- ::Avm::Instances::EntryKeys::MAILER_SMTP_PASSWORD => 'a_secret',
60
- ::Avm::Instances::EntryKeys::MAILER_SMTP_AUTHENTICATION => 'plain',
61
- ::Avm::Instances::EntryKeys::MAILER_SMTP_STARTTLS_AUTO => 'true'
62
- }
63
- }.each do |instance_id, values|
64
- values.each do |input, expected|
65
- it "read entry #{instance_id}.#{input} should return \"#{expected}\"" do
16
+ {
17
+ 'app_0' => {
18
+ fs_path: '/fs_root/app_0',
19
+ data_fs_path: '/data_fs_root/app_0',
20
+ ::Avm::Instances::EntryKeys::DATABASE_NAME => 'app_0',
21
+ ::Avm::Instances::EntryKeys::DATABASE_USERNAME => 'user1',
22
+ ::Avm::Instances::EntryKeys::DATABASE_PASSWORD => 'pass1',
23
+ ::Avm::Instances::EntryKeys::DATABASE_HOSTNAME => 'database.net',
24
+ ::Avm::Instances::EntryKeys::DATABASE_PORT => 5432,
25
+ ::Avm::Instances::EntryKeys::INSTALL_HOSTNAME => 'myhost.com',
26
+ ::Avm::Instances::EntryKeys::INSTALL_USERNAME => 'myuser',
27
+ ::Avm::Instances::EntryKeys::INSTALL_URL => 'ssh://otheruser@otherhost.com'
28
+ },
29
+ 'app_2' => {
30
+ ::Avm::Instances::EntryKeys::DATABASE_HOSTNAME => '127.0.0.1',
31
+ ::Avm::Instances::EntryKeys::SOURCE_INSTANCE_ID => 'app_dev'
32
+ },
33
+ 'app_3' => {
34
+ ::Avm::Instances::EntryKeys::DATABASE_SYSTEM => 'postgresql',
35
+ ::Avm::Instances::EntryKeys::DATABASE_NAME => 'app_1_db',
36
+ ::Avm::Instances::EntryKeys::DATABASE_USERNAME => 'user1',
37
+ ::Avm::Instances::EntryKeys::DATABASE_PASSWORD => 'pass1',
38
+ ::Avm::Instances::EntryKeys::DATABASE_HOSTNAME => 'database.net',
39
+ ::Avm::Instances::EntryKeys::DATABASE_PORT => 5432,
40
+ ::Avm::Instances::EntryKeys::MAILER_ID => 'mailer_0',
41
+ ::Avm::Instances::EntryKeys::MAILER_FROM => 'noreply@example.net',
42
+ ::Avm::Instances::EntryKeys::MAILER_REPLY_TO => nil,
43
+ ::Avm::Instances::EntryKeys::MAILER_SMTP_ADDRESS => 'smtp.example.net',
44
+ ::Avm::Instances::EntryKeys::MAILER_SMTP_PORT => '587',
45
+ ::Avm::Instances::EntryKeys::MAILER_SMTP_DOMAIN => 'example.net',
46
+ ::Avm::Instances::EntryKeys::MAILER_SMTP_USERNAME => 'a_user',
47
+ ::Avm::Instances::EntryKeys::MAILER_SMTP_PASSWORD => 'a_secret',
48
+ ::Avm::Instances::EntryKeys::MAILER_SMTP_AUTHENTICATION => 'plain',
49
+ ::Avm::Instances::EntryKeys::MAILER_SMTP_STARTTLS_AUTO => 'true'
50
+ },
51
+ 'mailer_0' => {
52
+ ::Avm::Instances::EntryKeys::MAILER_FROM => 'noreply@example.net',
53
+ ::Avm::Instances::EntryKeys::MAILER_REPLY_TO => '',
54
+ ::Avm::Instances::EntryKeys::MAILER_SMTP_ADDRESS => 'smtp.example.net',
55
+ ::Avm::Instances::EntryKeys::MAILER_SMTP_PORT => '587',
56
+ ::Avm::Instances::EntryKeys::MAILER_SMTP_DOMAIN => 'example.net',
57
+ ::Avm::Instances::EntryKeys::MAILER_SMTP_USERNAME => 'a_user',
58
+ ::Avm::Instances::EntryKeys::MAILER_SMTP_PASSWORD => 'a_secret',
59
+ ::Avm::Instances::EntryKeys::MAILER_SMTP_AUTHENTICATION => 'plain',
60
+ ::Avm::Instances::EntryKeys::MAILER_SMTP_STARTTLS_AUTO => 'true'
61
+ }
62
+ }.each do |instance_id, values|
63
+ values.each do |input, expected|
64
+ context "when a auto value is requested for \"#{instance_id}.#{input}\"" do
65
+ it ".read_entry should return \"#{expected}\"" do
66
66
  expect(described_class.by_id(instance_id).read_entry(input)).to eq(expected)
67
67
  end
68
68
  end
@@ -1,17 +1,19 @@
1
1
  ---
2
2
  app_0:
3
- host_id: app_1
3
+ install:
4
+ id: app_1
4
5
  app_1:
5
6
  fs_path: /fs_root
6
7
  data_fs_path: /data_fs_root
7
- host_id: app_2
8
+ install:
9
+ id: app_2
8
10
  database:
9
11
  name: app_1_db
10
12
  username: user1
11
13
  password: pass1
12
14
  hostname: database.net
13
15
  app_2:
14
- ssh:
16
+ install:
15
17
  hostname: myhost.com
16
18
  username: myuser
17
19
  url: ssh://otheruser@otherhost.com
@@ -12,8 +12,8 @@ Gem::Specification.new do |s|
12
12
 
13
13
  s.files = Dir['{lib,template}/**/*']
14
14
 
15
- s.add_dependency 'avm-eac_rails_base1', '~> 0.3'
16
- s.add_dependency 'eac_ruby_utils', '~> 0.80', '>= 0.80.2'
15
+ s.add_dependency 'avm-eac_rails_base1', '~> 0.4', '>= 0.4.2'
16
+ s.add_dependency 'eac_ruby_utils', '~> 0.97'
17
17
 
18
- s.add_development_dependency 'eac_ruby_gem_support', '~> 0.4'
18
+ s.add_development_dependency 'eac_ruby_gem_support', '~> 0.5.1'
19
19
  end
@@ -0,0 +1,13 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'avm/source_generators/base'
4
+ require 'eac_ruby_utils/core_ext'
5
+
6
+ module Avm
7
+ module EacRailsBase0
8
+ module SourceGenerators
9
+ class Base < ::Avm::SourceGenerators::Base
10
+ end
11
+ end
12
+ end
13
+ end
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Avm
4
4
  module EacRailsBase0
5
- VERSION = '0.5.0'
5
+ VERSION = '0.6.1'
6
6
  end
7
7
  end
@@ -0,0 +1,11 @@
1
+ # frozen_string_literal: true
2
+
3
+ source 'https://rubygems.org'
4
+
5
+ gem 'eac_rails_base0'
6
+ gem 'eac_rails_gem_support', group: :development
7
+
8
+ # Local gems
9
+ ::Dir["#{__dir__}/{sub/gems,engines}/*/*.gemspec"].each do |file|
10
+ gem ::File.basename(::File.dirname(file)), path: ::File.dirname(file)
11
+ end
@@ -0,0 +1,8 @@
1
+ # frozen_string_literal: true
2
+
3
+ # Add your own tasks in files placed in lib/tasks ending in .rake,
4
+ # for example lib/tasks/capistrano.rake, and they will automatically be available to Rake.
5
+
6
+ require_relative 'config/application'
7
+
8
+ Rails.application.load_tasks
@@ -0,0 +1,3 @@
1
+ //= link_tree ../images
2
+ //= link_directory ../javascripts .js
3
+ //= link_directory ../stylesheets .css
@@ -0,0 +1,4 @@
1
+ # frozen_string_literal: true
2
+
3
+ class ApplicationController < ::EacRailsBase0::ApplicationController
4
+ end
@@ -0,0 +1,5 @@
1
+ # frozen_string_literal: true
2
+
3
+ class WelcomeController < ApplicationController
4
+ def index; end
5
+ end
@@ -0,0 +1,5 @@
1
+ #!/usr/bin/env ruby
2
+ # frozen_string_literal: true
3
+
4
+ ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../Gemfile', __dir__)
5
+ load Gem.bin_path('bundler', 'bundle')
@@ -0,0 +1,11 @@
1
+ #!/usr/bin/env ruby
2
+ # frozen_string_literal: true
3
+
4
+ begin
5
+ load File.expand_path('spring', __dir__)
6
+ rescue LoadError => e
7
+ raise unless e.message.include?('spring')
8
+ end
9
+ APP_PATH = File.expand_path('../config/application', __dir__)
10
+ require_relative '../config/boot'
11
+ require 'rails/commands'
@@ -0,0 +1,11 @@
1
+ #!/usr/bin/env ruby
2
+ # frozen_string_literal: true
3
+
4
+ begin
5
+ load File.expand_path('spring', __dir__)
6
+ rescue LoadError => e
7
+ raise unless e.message.include?('spring')
8
+ end
9
+ require_relative '../config/boot'
10
+ require 'rake'
11
+ Rake.application.run
@@ -0,0 +1,11 @@
1
+ #!/usr/bin/env ruby
2
+ # frozen_string_literal: true
3
+
4
+ APP_ROOT = File.expand_path('..', __dir__)
5
+ Dir.chdir(APP_ROOT) do
6
+ exec 'yarnpkg', *ARGV
7
+ rescue Errno::ENOENT
8
+ warn 'Yarn executable was not detected in the system.'
9
+ warn 'Download Yarn at https://yarnpkg.com/en/docs/install'
10
+ exit 1
11
+ end
@@ -0,0 +1,11 @@
1
+ # frozen_string_literal: true
2
+
3
+ APP_PATH = ::File.dirname(__dir__) unless defined?(APP_PATH)
4
+ require File.expand_path('boot', __dir__)
5
+ require 'eac_rails_base0/app_base/application.rb'
6
+
7
+ module EacRailsBase0App
8
+ class Application
9
+ config.load_defaults 5.2
10
+ end
11
+ end
@@ -0,0 +1,5 @@
1
+ # frozen_string_literal: true
2
+
3
+ ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../Gemfile', __dir__)
4
+
5
+ require 'bundler/setup' # Set up gems listed in the Gemfile.
@@ -0,0 +1,8 @@
1
+ development:
2
+ adapter: async
3
+
4
+ test:
5
+ adapter: async
6
+
7
+ production:
8
+ adapter: async
@@ -0,0 +1 @@
1
+ XKDkD3DioFn69hXAhH88mw9ZFRjDdarYU+7htxgTJmBB/vg45Hsb7pBJQaySoc7VD0Vb838ShDeVbhDlSc3PMtIcV6fU/nkYqc+Nu8heKF5mhJmgJmf2Vlp2ZgqVA04PxvmZ/U2FRx40c9welNpABmDn0V33qUsjkrVMqKuyxD9aTpuAFd4SiH7SzA8Is1v7ltr3+Rx0lA/LI2u87uxYBawE7G3sNQA9siEnSPNm24uEK+4GcIuVG0qIvx36uYyBjB8dfn9FaMec/+22EFNKO0JWjIFXRl+TosE3VLFssaMQ2sl0rRkesLzb2DMFO/7kp0T3c1EcvRmy0AJ3UQmKZCtYBzy2a/9rx8sh1a+AUHObSeSeaP4eu+sMnMhSsDhveUiYMnV8viJXj0G0V6UIWP4j+Bv96H/AFgNi--OD4Iuvmt7P3BlyOR--nzDLthG3dBOX14A2J5s4CA==
@@ -0,0 +1,7 @@
1
+ # frozen_string_literal: true
2
+
3
+ # Load the Rails application.
4
+ require_relative 'application'
5
+
6
+ # Initialize the Rails application.
7
+ Rails.application.initialize!
@@ -0,0 +1,39 @@
1
+ # frozen_string_literal: true
2
+
3
+ # Puma can serve each request in a thread from an internal thread pool.
4
+ # The `threads` method setting takes two numbers: a minimum and maximum.
5
+ # Any libraries that use thread pools should be configured to match
6
+ # the maximum value specified for Puma. Default is set to 5 threads for minimum
7
+ # and maximum; this matches the default thread size of Active Record.
8
+ #
9
+ threads_count = ENV.fetch('RAILS_MAX_THREADS') { 5 }
10
+ threads threads_count, threads_count
11
+
12
+ # Specifies the `port` that Puma will listen on to receive requests; default is 3000.
13
+ #
14
+ port ENV.fetch('PORT') { 3000 }
15
+
16
+ # Specifies the `environment` that Puma will run in.
17
+ #
18
+ environment ENV.fetch('RAILS_ENV') { 'development' }
19
+
20
+ # Specifies the `pidfile` that Puma will use.
21
+ pidfile ENV.fetch('PIDFILE') { 'tmp/pids/server.pid' }
22
+
23
+ # Specifies the number of `workers` to boot in clustered mode.
24
+ # Workers are forked webserver processes. If using threads and workers together
25
+ # the concurrency of the application would be max `threads` * `workers`.
26
+ # Workers do not work on JRuby or Windows (both of which do not support
27
+ # processes).
28
+ #
29
+ # workers ENV.fetch("WEB_CONCURRENCY") { 2 }
30
+
31
+ # Use the `preload_app!` method when specifying a `workers` number.
32
+ # This directive tells Puma to first boot the application and load code
33
+ # before forking the application. This takes advantage of Copy On Write
34
+ # process behavior so workers use less memory.
35
+ #
36
+ # preload_app!
37
+
38
+ # Allow puma to be restarted by `rails restart` command.
39
+ plugin :tmp_restart
@@ -0,0 +1,5 @@
1
+ # frozen_string_literal: true
2
+
3
+ ::Rails.application.routes.draw do
4
+ root 'welcome#index'
5
+ end
@@ -0,0 +1,8 @@
1
+ # frozen_string_literal: true
2
+
3
+ %w[
4
+ .ruby-version
5
+ .rbenv-vars
6
+ tmp/restart.txt
7
+ tmp/caching-dev.txt
8
+ ].each { |path| Spring.watch(path) }
@@ -0,0 +1,7 @@
1
+ # frozen_string_literal: true
2
+
3
+ # This file is used by Rack-based servers to start the application.
4
+
5
+ require_relative 'config/environment'
6
+
7
+ run Rails.application
@@ -0,0 +1,20 @@
1
+ # frozen_string_literal: true
2
+
3
+ class Ability < ::EacRailsBase0::AppBase::Ability
4
+ def initialize(user)
5
+ super(user)
6
+ user ||= ::EacUsersSupport::User.new
7
+ for_all_permissions(user)
8
+ logged_permissions(user) unless user.new_record?
9
+ end
10
+
11
+ private
12
+
13
+ def for_all_permissions(_user)
14
+ can :read, :welcome
15
+ end
16
+
17
+ def logged_permissions(_user)
18
+ can :manage, :all
19
+ end
20
+ end
@@ -0,0 +1,10 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'eac_ruby_utils/simple_cache'
4
+
5
+ class AbilityMapping < ::EacRailsBase0::AppBase::AbilityMapping
6
+ def initialize
7
+ super
8
+ map_action 'Welcome', 'index', :read, :welcome
9
+ end
10
+ end
@@ -0,0 +1,3 @@
1
+ # frozen_string_literal: true
2
+
3
+ ::EacRubyUtils::Rspec.default_setup.describe_rubocop
@@ -0,0 +1,8 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'eac_ruby_utils/rspec/default_setup'
4
+ ::EacRubyUtils::Rspec.default_setup_create(::File.expand_path('..', __dir__))
5
+
6
+ ::RSpec.configure do |conf|
7
+ conf.global_fixtures = :all
8
+ end
@@ -12,9 +12,10 @@ Gem::Specification.new do |s|
12
12
 
13
13
  s.files = Dir['{lib,template}/**/*']
14
14
 
15
- s.add_dependency 'avm-eac_ruby_base1', '~> 0.9', '>= 0.9.1'
15
+ s.add_dependency 'avm', '~> 0.31'
16
+ s.add_dependency 'avm-eac_ruby_base1', '~> 0.11'
16
17
  s.add_dependency 'avm-eac_webapp_base0', '~> 0.3'
17
- s.add_dependency 'eac_ruby_utils', '~> 0.95', '>= 0.95.2'
18
+ s.add_dependency 'eac_ruby_utils', '~> 0.97'
18
19
 
19
20
  s.add_development_dependency 'eac_ruby_gem_support', '~> 0.5.1'
20
21
  end
@@ -38,7 +38,7 @@ module Avm
38
38
  end
39
39
 
40
40
  def user
41
- instance.ssh_username
41
+ instance.install_username
42
42
  end
43
43
 
44
44
  private
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Avm
4
4
  module EacRailsBase1
5
- VERSION = '0.4.1'
5
+ VERSION = '0.4.2'
6
6
  end
7
7
  end
@@ -0,0 +1,62 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'eac_ruby_utils/core_ext'
4
+
5
+ module Avm
6
+ module EacRubyBase1
7
+ module Rubygems
8
+ class Gemspec
9
+ class AddOrReplaceGemLine
10
+ enable_method_class
11
+ common_constructor :sender, :gem_name, :gem_specs
12
+ delegate :lines, to: :sender
13
+
14
+ DEPENDENCY_PREFIX = ' s.add_dependency'
15
+
16
+ def existing_gem_line_index
17
+ lines.index { |line| line.start_with?(gem_line_prefix) }
18
+ end
19
+
20
+ def result
21
+ if existing_gem_line_index.present?
22
+ replace_line
23
+ else
24
+ add_line
25
+ end
26
+ end
27
+
28
+ def add_line
29
+ lines.insert(add_line_index, new_gem_line)
30
+ end
31
+
32
+ def add_line_index
33
+ (gems_lines_start_index..(lines.count - 1)).each do |e|
34
+ return e if new_gem_line < lines[e]
35
+ end
36
+ lines.count
37
+ end
38
+
39
+ def gems_lines_start_index
40
+ lines.index { |line| line.start_with?(DEPENDENCY_PREFIX) } || lines.count
41
+ end
42
+
43
+ def new_gem_line
44
+ ([gem_line_prefix] + quoted_gem_specs).join(', ')
45
+ end
46
+
47
+ def gem_line_prefix
48
+ "#{DEPENDENCY_PREFIX} '#{gem_name}'"
49
+ end
50
+
51
+ def replace_line
52
+ lines[existing_gem_line_index] = new_gem_line
53
+ end
54
+
55
+ def quoted_gem_specs
56
+ gem_specs.map { |gem_spec| "'#{gem_spec}'" }
57
+ end
58
+ end
59
+ end
60
+ end
61
+ end
62
+ end
@@ -0,0 +1,19 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'eac_ruby_utils/core_ext'
4
+
5
+ module Avm
6
+ module EacRubyBase1
7
+ module Rubygems
8
+ class Gemspec
9
+ class Dependency
10
+ common_constructor :gemspec, :gem_name
11
+
12
+ def version_specs=(version_specs)
13
+ gemspec.add_or_replace_gem_line(gem_name, version_specs)
14
+ end
15
+ end
16
+ end
17
+ end
18
+ end
19
+ end
@@ -0,0 +1,42 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'eac_ruby_utils/core_ext'
4
+
5
+ module Avm
6
+ module EacRubyBase1
7
+ module Rubygems
8
+ class Gemspec
9
+ require_sub __FILE__, require_dependency: true
10
+
11
+ DEPENDENCY_LINE_PARSER = /s\.add_dependency\s*'(\S+)'/.to_parser { |m| m[1] }
12
+
13
+ class << self
14
+ def from_file(path)
15
+ new(path.read.each_line.map(&:rstrip))
16
+ end
17
+ end
18
+
19
+ common_constructor :lines
20
+
21
+ # @return [Avm::EacRubyBase1::Bundler::Gemfile::Dependency]
22
+ def dependency(gem_name)
23
+ ::Avm::EacRubyBase1::Rubygems::Gemspec::Dependency.new(self, gem_name)
24
+ end
25
+
26
+ # @return [Array<Avm::EacRubyBase1::Bundler::Gemfile::Dependency>]
27
+ def dependencies
28
+ lines.lazy.map { |line| DEPENDENCY_LINE_PARSER.parse(line) }.reject(&:blank?)
29
+ .map { |gem_name| dependency(gem_name) }.to_a
30
+ end
31
+
32
+ def write(path)
33
+ path.to_pathname.write(to_text)
34
+ end
35
+
36
+ def to_text
37
+ lines.map { |line| "#{line}\n" }.join
38
+ end
39
+ end
40
+ end
41
+ end
42
+ end
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Avm
4
4
  module EacRubyBase1
5
- VERSION = '0.11.0'
5
+ VERSION = '0.12.0'
6
6
  end
7
7
  end