avm-tools 0.80.0 → 0.81.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: '0517668b390f4bfcd0ade6b28b127de99e7b309e54633353bae6a0e558c36054'
4
- data.tar.gz: d6cb8cb3880f9929fe7f5bea9ed794934a50e2aed96fccbe4c1f42c5cc2e2524
3
+ metadata.gz: a429748d11abc010cc9622597d60e36016b008c88e6e95e8efd52bd03b8318ae
4
+ data.tar.gz: f126c1dd4af4370ad13f398d4aaefc9252ae8b1580e87ea08aed0debeaea652e
5
5
  SHA512:
6
- metadata.gz: f46b14fadb4d557a6e3af527649b9237b7e2281af7828bc646c031c326f9441d2720e07d878b161c42de90d0770edaf1df67b006b77b233b1a1b21352e346903
7
- data.tar.gz: 8e2bf840b44027bfbe263607654e11ae4557d0bdbb0867e3cfad51f823f7e9427205c3ed296461c2c5414d354ad505d64e3a76a37256175d21bc5f947cbeaf8f
6
+ metadata.gz: 5ee2c425e977acaded7b64f05088817765b523f4459a3dcac1fed0b0be4d85d8b25b34843a824c2cff3c7446a06319835b73fbcaff05b1d36f4ec45b37496bf7
7
+ data.tar.gz: 6687e21a992f5bbc6e992ceb4fa74900d16b1a16dba9d71400dd1c61d4e5e9e66e4265706b161bf9b0ae896354b292bf64361c531da3d01034e3b9d4bd2c4f85
@@ -8,8 +8,7 @@ module Avm
8
8
  module EacRailsBase1
9
9
  class Runner < ::Avm::EacWebappBase0::Runner
10
10
  class CodeRunner
11
- runner_with ::Avm::EacRailsBase1::RunnerWith::Bundle
12
- runner_definition do
11
+ runner_with :help, ::Avm::EacRailsBase1::RunnerWith::Bundle do
13
12
  desc 'Runs a Ruby code with "rails runner".'
14
13
  pos_arg :code
15
14
  end
@@ -0,0 +1,33 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'avm/eac_rails_base1/runner_with/bundle'
4
+ require 'avm/instances/entry_keys'
5
+ require 'eac_cli/core_ext'
6
+ require 'eac_ruby_utils/console/docopt_runner'
7
+ require 'shellwords'
8
+
9
+ module Avm
10
+ module EacRailsBase1
11
+ class Runner < ::Avm::EacWebappBase0::Runner
12
+ class RailsServer
13
+ DEFAULT_RAILS_ENVIRONMENT = 'development'
14
+ runner_with :help, ::Avm::EacRailsBase1::RunnerWith::Bundle do
15
+ desc 'Run the embbeded Rails web server.'
16
+ end
17
+
18
+ def run
19
+ infov 'Environment', rails_environment
20
+ infov 'Bundle args', ::Shellwords.join(bundle_args)
21
+ infov 'Result', bundle_command.system
22
+ end
23
+
24
+ protected
25
+
26
+ def bundle_args
27
+ ['exec', 'rails', 'server', '--port',
28
+ runner_context.call(:instance).read_entry(::Avm::Instances::EntryKeys::WEB_PORT)]
29
+ end
30
+ end
31
+ end
32
+ end
33
+ end
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Avm
4
4
  module Tools
5
- VERSION = '0.80.0'
5
+ VERSION = '0.81.0'
6
6
  end
7
7
  end
@@ -12,7 +12,7 @@ Gem::Specification.new do |s|
12
12
 
13
13
  s.files = Dir['{lib}/**/*', 'Gemfile']
14
14
 
15
- s.add_dependency 'eac_ruby_utils', '~> 0.50'
15
+ s.add_dependency 'eac_ruby_utils', '~> 0.55'
16
16
 
17
17
  s.add_development_dependency 'eac_ruby_gem_support', '~> 0.1', '>= 0.1.2'
18
18
  end
@@ -12,12 +12,14 @@ module EacCli
12
12
 
13
13
  def parsed_uncached
14
14
  raise 'Definition has no alternatives' if alternatives.empty?
15
+ raise first_error unless alternatives.select(&:success?).any?
15
16
 
16
- alternatives.each do |alt_parser|
17
- return alt_parser.parsed unless alt_parser.error?
18
- end
17
+ alternatives_parsed(true).merge(alternatives_parsed(false))
18
+ end
19
19
 
20
- raise first_error
20
+ def alternatives_parsed(error)
21
+ alternatives.select { |a| error == a.error? }.map(&:parsed).reverse
22
+ .inject(::EacRubyUtils::Struct.new) { |a, e| a.merge(e) }
21
23
  end
22
24
 
23
25
  def alternatives_uncached
@@ -22,6 +22,10 @@ module EacCli
22
22
  error.present?
23
23
  end
24
24
 
25
+ def success?
26
+ !error?
27
+ end
28
+
25
29
  def parsed
26
30
  @parsed ||= collector.to_data.freeze
27
31
  end
@@ -44,6 +44,8 @@ module EacCli
44
44
  extend AfterClassMethods
45
45
  include InstanceMethods
46
46
  ::EacCli::Docopt::RunnerExtension.check(self)
47
+ include ActiveSupport::Callbacks
48
+ define_callbacks :run
47
49
  end
48
50
 
49
51
  module AfterClassMethods
@@ -55,8 +57,7 @@ module EacCli
55
57
 
56
58
  def run(*runner_context_args)
57
59
  r = create(*runner_context_args)
58
- r.parsed
59
- r.run
60
+ r.run_run
60
61
  r
61
62
  end
62
63
 
@@ -72,6 +73,13 @@ module EacCli
72
73
  end
73
74
 
74
75
  module InstanceMethods
76
+ def run_run
77
+ parsed
78
+ run_callbacks(:run) { run }
79
+ rescue ::EacCli::Runner::Exit # rubocop:disable Lint/SuppressedException
80
+ # Do nothing
81
+ end
82
+
75
83
  def runner_context
76
84
  return @runner_context if @runner_context
77
85
 
@@ -0,0 +1,13 @@
1
+ # frozen_string_literal: true
2
+
3
+ module EacCli
4
+ module Runner
5
+ class Exit < ::StandardError
6
+ attr_reader :status
7
+
8
+ def initialize(status = true)
9
+ @status = status
10
+ end
11
+ end
12
+ end
13
+ end
@@ -13,6 +13,21 @@ module EacCli
13
13
  options_argument false
14
14
  bool_opt '-h', '--help', 'Show help.', usage: true
15
15
  end
16
+
17
+ set_callback :run, :before do
18
+ help_run
19
+ end
20
+ end
21
+
22
+ def help_run
23
+ return unless parsed.help?
24
+
25
+ puts help_text
26
+ raise ::EacCli::Runner::Exit
27
+ end
28
+
29
+ def help_text
30
+ ::EacCli::Docopt::DocBuilder.new(self.class.runner_definition).to_s
16
31
  end
17
32
  end
18
33
  end
@@ -44,7 +44,7 @@ module EacCli
44
44
 
45
45
  def run_with_subcommand
46
46
  if subcommand_name
47
- subcommand_runner.run
47
+ subcommand_runner.run_run
48
48
  else
49
49
  run_without_subcommand
50
50
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module EacCli
4
- VERSION = '0.12.2'
4
+ VERSION = '0.12.3'
5
5
  end
@@ -28,7 +28,10 @@ RSpec.describe ::EacCli::Runner do
28
28
 
29
29
  context 'when all args are supplied' do
30
30
  let(:argv) { %w[--opt1 aaa --opt2 bbb ccc ddd] }
31
- let(:parsed_expected) { { opt1: 'aaa', opt2: true, pos1: 'bbb', pos2: %w[ccc ddd] } }
31
+ let(:parsed_expected) do
32
+ { opt1: 'aaa', opt2: true, opt3: false, pos1: 'bbb',
33
+ pos2: %w[ccc ddd] }
34
+ end
32
35
 
33
36
  it { expect(parsed_actual).to eq(parsed_expected) }
34
37
  it { expect(instance.parsed.opt1).to eq('aaa') }
@@ -39,7 +42,7 @@ RSpec.describe ::EacCli::Runner do
39
42
 
40
43
  context 'when only required args are supplied' do
41
44
  let(:argv) { %w[bbb] }
42
- let(:parsed_expected) { { opt1: nil, opt2: false, pos1: 'bbb', pos2: [] } }
45
+ let(:parsed_expected) { { opt1: nil, opt2: false, opt3: false, pos1: 'bbb', pos2: [] } }
43
46
 
44
47
  it { expect(parsed_actual).to eq(parsed_expected) }
45
48
  it { expect(instance.parsed.opt1).to be_nil }
@@ -58,7 +61,7 @@ RSpec.describe ::EacCli::Runner do
58
61
 
59
62
  context 'when alternative args are supplied' do
60
63
  let(:argv) { %w[--opt3] }
61
- let(:parsed_expected) { { opt3: true } }
64
+ let(:parsed_expected) { { opt1: nil, opt2: false, opt3: true, pos1: nil, pos2: [] } }
62
65
 
63
66
  it { expect(parsed_actual).to eq(parsed_expected) }
64
67
  it { expect(instance.parsed.opt3?).to eq(true) }
@@ -0,0 +1,42 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'eac_cli/runner_with/help'
4
+ require 'eac_ruby_utils/fs/temp'
5
+
6
+ RSpec.describe ::EacCli::RunnerWith::Help do
7
+ let(:runner) do
8
+ the_module = described_class
9
+ Class.new do
10
+ include the_module
11
+
12
+ runner_definition do
13
+ desc 'A stub runner.'
14
+ pos_arg :a_argument
15
+ end
16
+
17
+ def run
18
+ puts 'Runner run'
19
+ end
20
+ end
21
+ end
22
+
23
+ let(:runner_argv) { ['--help'] }
24
+ let(:instance) { runner.create(argv: runner_argv) }
25
+ let(:expected_output) do
26
+ <<~OUTPUT
27
+ A stub runner.
28
+
29
+ Usage:
30
+ __PROGRAM__ [options] <a_argument>
31
+ __PROGRAM__ --help
32
+
33
+ Options:
34
+ -h --help Show help.
35
+
36
+ OUTPUT
37
+ end
38
+
39
+ it 'show help text' do
40
+ expect { instance.run_run }.to output(expected_output).to_stdout_from_any_process
41
+ end
42
+ end
@@ -8,7 +8,6 @@ RSpec.describe ::EacCli::RunnerWith::Subcommands do
8
8
  the_module = described_class
9
9
  the_child = child_runner
10
10
  Class.new do
11
- include ::EacCli::Runner
12
11
  include the_module
13
12
  const_set('ChildCmd', the_child)
14
13
 
@@ -1,8 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require 'active_support/concern'
4
- require 'eac_ruby_utils/simple_cache'
5
- require 'eac_ruby_utils/patches/object/if_present'
3
+ require 'eac_ruby_utils/common_concern/module_setup'
6
4
 
7
5
  module EacRubyUtils
8
6
  class CommonConcern
@@ -16,53 +14,7 @@ module EacRubyUtils
16
14
  end
17
15
 
18
16
  def setup(a_module)
19
- Setup.new(self, a_module).run
20
- end
21
-
22
- class Setup
23
- include ::EacRubyUtils::SimpleCache
24
- attr_reader :a_module, :common_concern
25
-
26
- def initialize(common_concern, a_module)
27
- @common_concern = common_concern
28
- @a_module = a_module
29
- end
30
-
31
- def run
32
- setup = self
33
- a_module.extend(::ActiveSupport::Concern)
34
- a_module.included do
35
- %w[class_methods instance_methods after_callback].each do |suffix|
36
- setup.send("setup_#{suffix}", self)
37
- end
38
- end
39
- end
40
-
41
- def setup_class_methods(base)
42
- class_methods_module.if_present { |v| base.extend v }
43
- end
44
-
45
- def setup_instance_methods(base)
46
- instance_methods_module.if_present { |v| base.include v }
47
- end
48
-
49
- def setup_after_callback(base)
50
- common_concern.after_callback.if_present do |v|
51
- base.instance_eval(&v)
52
- end
53
- end
54
-
55
- def class_methods_module_uncached
56
- a_module.const_get(CLASS_METHODS_MODULE_NAME)
57
- rescue NameError
58
- nil
59
- end
60
-
61
- def instance_methods_module_uncached
62
- a_module.const_get(INSTANCE_METHODS_MODULE_NAME)
63
- rescue NameError
64
- nil
65
- end
17
+ ::EacRubyUtils::CommonConcern::ModuleSetup.new(self, a_module).run
66
18
  end
67
19
  end
68
20
  end
@@ -0,0 +1,52 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'active_support/concern'
4
+ require 'eac_ruby_utils/simple_cache'
5
+ require 'eac_ruby_utils/patches/object/if_present'
6
+
7
+ module EacRubyUtils
8
+ class CommonConcern
9
+ class ClassSetup
10
+ include ::EacRubyUtils::SimpleCache
11
+ attr_reader :a_class, :module_setup, :include_method
12
+
13
+ def initialize(module_setup, a_class, include_method)
14
+ @module_setup = module_setup
15
+ @a_class = a_class
16
+ @include_method = include_method
17
+ end
18
+
19
+ def run
20
+ %w[class_methods instance_methods after_callback].each do |suffix|
21
+ send("setup_#{suffix}")
22
+ end
23
+ end
24
+
25
+ def setup_class_methods
26
+ class_methods_module.if_present { |v| a_class.extend v }
27
+ end
28
+
29
+ def setup_instance_methods
30
+ instance_methods_module.if_present { |v| a_class.send(include_method, v) }
31
+ end
32
+
33
+ def setup_after_callback
34
+ module_setup.common_concern.after_callback.if_present do |v|
35
+ a_class.instance_eval(&v)
36
+ end
37
+ end
38
+
39
+ def class_methods_module_uncached
40
+ module_setup.a_module.const_get(CLASS_METHODS_MODULE_NAME)
41
+ rescue NameError
42
+ nil
43
+ end
44
+
45
+ def instance_methods_module_uncached
46
+ module_setup.a_module.const_get(INSTANCE_METHODS_MODULE_NAME)
47
+ rescue NameError
48
+ nil
49
+ end
50
+ end
51
+ end
52
+ end
@@ -0,0 +1,31 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'active_support/concern'
4
+ require 'eac_ruby_utils/common_concern/class_setup'
5
+ require 'eac_ruby_utils/simple_cache'
6
+ require 'eac_ruby_utils/patches/object/if_present'
7
+
8
+ module EacRubyUtils
9
+ class CommonConcern
10
+ class ModuleSetup
11
+ include ::EacRubyUtils::SimpleCache
12
+ attr_reader :a_module, :common_concern
13
+
14
+ def initialize(common_concern, a_module)
15
+ @common_concern = common_concern
16
+ @a_module = a_module
17
+ end
18
+
19
+ def run
20
+ setup = self
21
+ a_module.extend(::ActiveSupport::Concern)
22
+ a_module.included do
23
+ ::EacRubyUtils::CommonConcern::ClassSetup.new(setup, self, :include).run
24
+ end
25
+ a_module.prepended do
26
+ ::EacRubyUtils::CommonConcern::ClassSetup.new(setup, self, :prepend).run
27
+ end
28
+ end
29
+ end
30
+ end
31
+ end
@@ -1,12 +1,13 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  require 'active_support/hash_with_indifferent_access'
4
+ require 'active_support/core_ext/module/delegation'
4
5
  require 'active_support/core_ext/object/blank'
5
6
 
6
7
  module EacRubyUtils
7
8
  class Struct
8
9
  def initialize(initial_data = {})
9
- self.data = ::ActiveSupport::HashWithIndifferentAccess.new(initial_data)
10
+ self.data = initial_data.symbolize_keys
10
11
  end
11
12
 
12
13
  def [](key)
@@ -19,6 +20,11 @@ module EacRubyUtils
19
20
  bool ? fetch(key).present? : data.fetch(key)
20
21
  end
21
22
 
23
+ def merge(other)
24
+ other = self.class.new(other) unless other.is_a?(self.class)
25
+ self.class.new(to_h.merge(other.to_h))
26
+ end
27
+
22
28
  def method_missing(method_name, *arguments, &block)
23
29
  property_method?(method_name) ? fetch(method_name) : super
24
30
  end
@@ -9,34 +9,47 @@ RSpec.describe ::EacRubyUtils::CommonConcern do
9
9
  end
10
10
  end
11
11
 
12
- module MyModule
13
- module ClassMethods
14
- def my_class_method
15
- 'class'
12
+ let(:stub_module) do
13
+ ::Module.new do
14
+ module ClassMethods # rubocop:disable RSpec/LeakyConstantDeclaration
15
+ def my_class_method
16
+ 'class'
17
+ end
16
18
  end
17
- end
18
19
 
19
- module InstanceMethods
20
- def my_instance_method
21
- 'instance'
20
+ module InstanceMethods # rubocop:disable RSpec/LeakyConstantDeclaration
21
+ def my_instance_method
22
+ 'instance'
23
+ end
22
24
  end
23
25
  end
24
26
  end
25
27
 
26
- class MyClass
27
- class << self
28
- attr_accessor :valor
28
+ let(:stub_class) do
29
+ ::Class.new do
30
+ class << self
31
+ attr_accessor :valor
32
+ end
33
+
34
+ def method1
35
+ 'from_stub_module'
36
+ end
29
37
  end
30
38
  end
31
39
 
32
- let(:subject) { MyClass.new }
40
+ let(:stub_class_instance) { stub_class.new }
33
41
 
34
42
  before do
35
- instance.setup(MyModule)
36
- MyClass.include MyModule
43
+ instance.setup(stub_module)
37
44
  end
38
45
 
39
- it { expect(subject.my_instance_method).to eq('instance') }
40
- it { expect(subject.class.my_class_method).to eq('class') }
41
- it { expect(subject.class.valor).to eq('changed') }
46
+ context 'when included' do
47
+ before do
48
+ stub_class.include stub_module
49
+ end
50
+
51
+ it { expect(stub_class_instance.my_instance_method).to eq('instance') }
52
+ it { expect(stub_class_instance.class.my_class_method).to eq('class') }
53
+ it { expect(stub_class_instance.class.valor).to eq('changed') }
54
+ end
42
55
  end
@@ -3,7 +3,8 @@
3
3
  require 'eac_ruby_utils/struct'
4
4
 
5
5
  RSpec.describe ::EacRubyUtils::Struct do
6
- let(:instance) { described_class.new(a: 1, b: '') }
6
+ let(:instance) { described_class.new('a' => 1, b: '') }
7
+ let(:other) { described_class.new('a' => 'm1', c: 'm2') }
7
8
 
8
9
  describe '#[]' do
9
10
  it { expect(instance[:a]).to eq(1) }
@@ -35,6 +36,12 @@ RSpec.describe ::EacRubyUtils::Struct do
35
36
  it { expect { instance.fetch('c?') }.to raise_error(::KeyError) }
36
37
  end
37
38
 
39
+ describe '#merge' do
40
+ let(:merged) { instance.merge(other) }
41
+
42
+ it { expect(merged.to_h).to eq(a: 'm1', b: '', c: 'm2') }
43
+ end
44
+
38
45
  describe '#property_method' do
39
46
  it { expect(instance.a).to eq(1) }
40
47
  it { expect(instance.a?).to eq(true) }
@@ -43,4 +50,8 @@ RSpec.describe ::EacRubyUtils::Struct do
43
50
  it { expect { instance.c }.to raise_error(::NoMethodError) }
44
51
  it { expect { instance.c? }.to raise_error(::NoMethodError) }
45
52
  end
53
+
54
+ describe '#to_h' do
55
+ it { expect(instance.to_h).to eq(a: 1, b: '') }
56
+ end
46
57
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: avm-tools
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.80.0
4
+ version: 0.81.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Esquilo Azul Company
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2020-12-16 00:00:00.000000000 Z
11
+ date: 2020-12-19 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: aranha-parsers
@@ -300,6 +300,7 @@ files:
300
300
  - lib/avm/eac_rails_base1/runner.rb
301
301
  - lib/avm/eac_rails_base1/runner/bundle.rb
302
302
  - lib/avm/eac_rails_base1/runner/code_runner.rb
303
+ - lib/avm/eac_rails_base1/runner/rails_server.rb
303
304
  - lib/avm/eac_rails_base1/runner_with/bundle.rb
304
305
  - lib/avm/eac_redmine_base0.rb
305
306
  - lib/avm/eac_redmine_base0/core_update.rb
@@ -486,8 +487,6 @@ files:
486
487
  - lib/avm/tools/runner.rb
487
488
  - lib/avm/tools/runner/eac_rails_base0.rb
488
489
  - lib/avm/tools/runner/eac_rails_base0/apache_path.rb
489
- - lib/avm/tools/runner/eac_rails_base0/rails_server.rb
490
- - lib/avm/tools/runner/eac_rails_base0/runner.rb
491
490
  - lib/avm/tools/runner/eac_redmine_base0.rb
492
491
  - lib/avm/tools/runner/eac_redmine_base0/core_update.rb
493
492
  - lib/avm/tools/runner/eac_redmine_base0/docker.rb
@@ -623,6 +622,7 @@ files:
623
622
  - vendor/eac_cli/lib/eac_cli/patches/object/runner_with.rb
624
623
  - vendor/eac_cli/lib/eac_cli/runner.rb
625
624
  - vendor/eac_cli/lib/eac_cli/runner/context.rb
625
+ - vendor/eac_cli/lib/eac_cli/runner/exit.rb
626
626
  - vendor/eac_cli/lib/eac_cli/runner_with.rb
627
627
  - vendor/eac_cli/lib/eac_cli/runner_with/help.rb
628
628
  - vendor/eac_cli/lib/eac_cli/runner_with/output_file.rb
@@ -632,6 +632,7 @@ files:
632
632
  - vendor/eac_cli/spec/lib/eac_cli/docopt/runner_extension_spec.rb
633
633
  - vendor/eac_cli/spec/lib/eac_cli/parser/alternative_spec.rb
634
634
  - vendor/eac_cli/spec/lib/eac_cli/runner_spec.rb
635
+ - vendor/eac_cli/spec/lib/eac_cli/runner_with/help_spec.rb
635
636
  - vendor/eac_cli/spec/lib/eac_cli/runner_with/output_file_spec.rb
636
637
  - vendor/eac_cli/spec/lib/eac_cli/runner_with/subcommands_spec.rb
637
638
  - vendor/eac_cli/spec/rubocop_spec.rb
@@ -904,6 +905,8 @@ files:
904
905
  - vendor/eac_ruby_utils/lib/eac_ruby_utils/boolean.rb
905
906
  - vendor/eac_ruby_utils/lib/eac_ruby_utils/by_reference.rb
906
907
  - vendor/eac_ruby_utils/lib/eac_ruby_utils/common_concern.rb
908
+ - vendor/eac_ruby_utils/lib/eac_ruby_utils/common_concern/class_setup.rb
909
+ - vendor/eac_ruby_utils/lib/eac_ruby_utils/common_concern/module_setup.rb
907
910
  - vendor/eac_ruby_utils/lib/eac_ruby_utils/common_constructor.rb
908
911
  - vendor/eac_ruby_utils/lib/eac_ruby_utils/configs.rb
909
912
  - vendor/eac_ruby_utils/lib/eac_ruby_utils/configs/base.rb
@@ -1,36 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- require 'avm/eac_rails_base1/runner_with/bundle'
4
- require 'avm/instances/entry_keys'
5
- require 'eac_cli/core_ext'
6
- require 'eac_ruby_utils/console/docopt_runner'
7
- require 'shellwords'
8
-
9
- module Avm
10
- module Tools
11
- class Runner < ::EacRubyUtils::Console::DocoptRunner
12
- class EacRailsBase0 < ::Avm::EacRailsBase1::Runner
13
- class RailsServer
14
- DEFAULT_RAILS_ENVIRONMENT = 'development'
15
- runner_with ::Avm::EacRailsBase1::RunnerWith::Bundle
16
- runner_definition do
17
- desc 'Run the embbeded Rails web server.'
18
- end
19
-
20
- def run
21
- infov 'Environment', rails_environment
22
- infov 'Bundle args', ::Shellwords.join(bundle_args)
23
- infov 'Result', bundle_command.system
24
- end
25
-
26
- protected
27
-
28
- def bundle_args
29
- ['exec', 'rails', 'server', '--port',
30
- runner_context.call(:instance).read_entry(::Avm::Instances::EntryKeys::WEB_PORT)]
31
- end
32
- end
33
- end
34
- end
35
- end
36
- end
@@ -1,14 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- require 'avm/eac_rails_base1/runner/code_runner'
4
-
5
- module Avm
6
- module Tools
7
- class Runner < ::EacRubyUtils::Console::DocoptRunner
8
- class EacRailsBase0 < ::Avm::EacRailsBase1::Runner
9
- class Runner < ::Avm::EacRailsBase1::Runner::CodeRunner
10
- end
11
- end
12
- end
13
- end
14
- end