avm-tools 0.75.0 → 0.78.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/avm/eac_rails_base1/runner/bundle.rb +2 -2
- data/lib/avm/eac_rails_base1/runner/code_runner.rb +3 -3
- data/lib/avm/eac_webapp_base0/deploy/build.rb +1 -1
- data/lib/avm/eac_webapp_base0/runner/deploy.rb +1 -0
- data/lib/avm/files/formatter.rb +8 -4
- data/lib/avm/git/auto_commit_path.rb +2 -4
- data/lib/avm/git/auto_commit_path/ruby.rb +20 -0
- data/lib/avm/tools/runner/eac_redmine_base0/project_rename.rb +7 -16
- data/lib/avm/tools/runner/files/format.rb +3 -2
- data/lib/avm/tools/runner/git/auto_commit.rb +11 -0
- data/lib/avm/tools/runner/git/subrepo/clone.rb +84 -0
- data/lib/avm/tools/version.rb +1 -1
- data/template/avm/eac_redmine_base0/deploy/config/install.sh.template +12 -0
- data/vendor/eac_cli/eac_cli.gemspec +1 -1
- data/vendor/eac_cli/lib/eac_cli/definition.rb +49 -22
- data/vendor/eac_cli/lib/eac_cli/definition/alternative.rb +83 -0
- data/vendor/eac_cli/lib/eac_cli/definition/base_option.rb +17 -1
- data/vendor/eac_cli/lib/eac_cli/{parser/options_collection.rb → definition/help_formatter.rb} +20 -49
- data/vendor/eac_cli/lib/eac_cli/definition/positional_argument.rb +21 -4
- data/vendor/eac_cli/lib/eac_cli/docopt/doc_builder.rb +18 -40
- data/vendor/eac_cli/lib/eac_cli/docopt/doc_builder/alternative.rb +50 -0
- data/vendor/eac_cli/lib/eac_cli/docopt/runner_extension.rb +1 -0
- data/vendor/eac_cli/lib/eac_cli/parser.rb +21 -3
- data/vendor/eac_cli/lib/eac_cli/parser/alternative.rb +88 -0
- data/vendor/eac_cli/lib/eac_cli/parser/alternative/argv.rb +17 -0
- data/vendor/eac_cli/lib/eac_cli/parser/alternative/double_dash.rb +24 -0
- data/vendor/eac_cli/lib/eac_cli/parser/alternative/options.rb +58 -0
- data/vendor/eac_cli/lib/eac_cli/parser/alternative/positionals.rb +30 -0
- data/vendor/eac_cli/lib/eac_cli/parser/collector.rb +4 -0
- data/vendor/eac_cli/lib/eac_cli/patches/object/runner_with.rb +2 -1
- data/vendor/eac_cli/lib/eac_cli/runner.rb +6 -2
- data/vendor/eac_cli/lib/eac_cli/runner_with/help.rb +1 -1
- data/vendor/eac_cli/lib/eac_cli/runner_with/output_file.rb +5 -1
- data/vendor/eac_cli/lib/eac_cli/runner_with/subcommands.rb +96 -0
- data/vendor/eac_cli/lib/eac_cli/version.rb +1 -1
- data/vendor/eac_cli/spec/lib/eac_cli/definition/alternative_spec.rb +14 -0
- data/vendor/eac_cli/spec/lib/eac_cli/docopt/runner_extension_spec.rb +35 -0
- data/vendor/eac_cli/spec/lib/eac_cli/parser/alternative_spec.rb +140 -0
- data/vendor/eac_cli/spec/lib/eac_cli/runner_spec.rb +57 -40
- data/vendor/eac_cli/spec/lib/eac_cli/runner_with/output_file_spec.rb +53 -0
- data/vendor/eac_cli/spec/lib/eac_cli/runner_with/subcommands_spec.rb +57 -0
- data/vendor/eac_ruby_base0/lib/eac_ruby_base0/application.rb +32 -1
- data/vendor/eac_ruby_base0/lib/eac_ruby_base0/runner.rb +1 -1
- data/vendor/eac_ruby_base0/lib/eac_ruby_base0/version.rb +1 -1
- data/vendor/eac_ruby_utils/lib/eac_ruby_utils/abstract_methods.rb +60 -0
- data/vendor/eac_ruby_utils/lib/eac_ruby_utils/common_constructor.rb +53 -0
- data/vendor/eac_ruby_utils/lib/eac_ruby_utils/console/configs.rb +7 -107
- data/vendor/eac_ruby_utils/lib/eac_ruby_utils/console/configs/entry_reader.rb +81 -0
- data/vendor/eac_ruby_utils/lib/eac_ruby_utils/console/configs/password_entry_reader.rb +18 -0
- data/vendor/eac_ruby_utils/lib/eac_ruby_utils/console/configs/read_entry_options.rb +46 -0
- data/vendor/eac_ruby_utils/lib/eac_ruby_utils/console/configs/store_passwords_entry_reader.rb +27 -0
- data/vendor/eac_ruby_utils/lib/eac_ruby_utils/patches/enumerator.rb +4 -0
- data/vendor/eac_ruby_utils/lib/eac_ruby_utils/patches/enumerator/current.rb +9 -0
- data/vendor/eac_ruby_utils/lib/eac_ruby_utils/patches/enumerator/stopped.rb +14 -0
- data/vendor/eac_ruby_utils/lib/eac_ruby_utils/patches/module/abstract_methods.rb +10 -0
- data/vendor/eac_ruby_utils/lib/eac_ruby_utils/patches/object/debug.rb +17 -0
- data/vendor/eac_ruby_utils/lib/eac_ruby_utils/version.rb +1 -1
- data/vendor/eac_ruby_utils/lib/eac_ruby_utils/yaml.rb +3 -2
- data/vendor/eac_ruby_utils/spec/lib/eac_ruby_utils/abstract_methods_spec.rb +28 -0
- data/vendor/eac_ruby_utils/spec/lib/eac_ruby_utils/common_constructor_spec.rb +66 -8
- data/vendor/eac_ruby_utils/spec/lib/eac_ruby_utils/patches/enumerator/current_spec.rb +26 -0
- data/vendor/eac_ruby_utils/spec/lib/eac_ruby_utils/patches/enumerator/stopped_spec.rb +32 -0
- metadata +31 -6
- data/lib/avm/tools/runner/eac_rails_base0/bundle.rb +0 -14
- data/vendor/eac_cli/lib/eac_cli/parser/parse_result.rb +0 -21
- data/vendor/eac_cli/lib/eac_cli/parser/positional_collection.rb +0 -49
@@ -1,13 +1,14 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
+
require 'date'
|
3
4
|
require 'yaml'
|
4
5
|
|
5
6
|
module EacRubyUtils
|
6
7
|
# A safe YAML loader/dumper with common types included.
|
7
8
|
class Yaml
|
8
9
|
class << self
|
9
|
-
DEFAULT_PERMITTED_CLASSES = [::Array, ::Date, ::FalseClass, ::Hash, ::NilClass,
|
10
|
-
::String, ::Symbol, ::Time, ::TrueClass].freeze
|
10
|
+
DEFAULT_PERMITTED_CLASSES = [::Array, ::Date, ::DateTime, ::FalseClass, ::Hash, ::NilClass,
|
11
|
+
::Numeric, ::String, ::Symbol, ::Time, ::TrueClass].freeze
|
11
12
|
|
12
13
|
def dump(object)
|
13
14
|
::YAML.dump(sanitize(object))
|
@@ -0,0 +1,28 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'eac_ruby_utils/abstract_methods'
|
4
|
+
|
5
|
+
RSpec.describe(::EacRubyUtils::AbstractMethods) do
|
6
|
+
let(:base_class) do
|
7
|
+
the_module = described_class
|
8
|
+
::Class.new do
|
9
|
+
include the_module
|
10
|
+
|
11
|
+
abstract_methods :method1, :method2
|
12
|
+
end
|
13
|
+
end
|
14
|
+
let(:base_instance) { base_class.new }
|
15
|
+
let(:sub_class) do
|
16
|
+
::Class.new(base_class) do
|
17
|
+
def method1
|
18
|
+
'a result'
|
19
|
+
end
|
20
|
+
end
|
21
|
+
end
|
22
|
+
let(:sub_instance) { sub_class.new }
|
23
|
+
|
24
|
+
it { expect { base_instance.method1 }.to raise_error(::NoMethodError) }
|
25
|
+
it { expect { base_instance.method2 }.to raise_error(::NoMethodError) }
|
26
|
+
it { expect(sub_instance.method1).to eq('a result') }
|
27
|
+
it { expect { sub_instance.method2 }.to raise_error(::NoMethodError) }
|
28
|
+
end
|
@@ -3,34 +3,92 @@
|
|
3
3
|
require 'eac_ruby_utils/common_constructor'
|
4
4
|
|
5
5
|
RSpec.describe ::EacRubyUtils::CommonConstructor do
|
6
|
-
ARG_LIST = %i[a b c d].freeze
|
6
|
+
ARG_LIST = %i[a b c d].freeze # rubocop:disable RSpec/LeakyConstantDeclaration
|
7
|
+
|
7
8
|
let(:instance) do
|
8
9
|
described_class.new(*ARG_LIST, default: %w[Vcc Vd]) do
|
9
10
|
@z = 'Vz'
|
10
11
|
end
|
11
12
|
end
|
12
13
|
|
13
|
-
|
14
|
-
|
14
|
+
let(:a_class) do
|
15
|
+
::Class.new do
|
16
|
+
attr_reader :z
|
17
|
+
end
|
15
18
|
end
|
16
19
|
|
17
|
-
let(:
|
20
|
+
let(:a_class_instance) { a_class.new('Va', 'Vb', 'Vc') }
|
18
21
|
|
19
22
|
before do
|
20
|
-
instance.setup_class(
|
23
|
+
instance.setup_class(a_class)
|
21
24
|
end
|
22
25
|
|
23
|
-
it { expect(
|
26
|
+
it { expect(a_class_instance.z).to eq('Vz') }
|
24
27
|
|
25
28
|
ARG_LIST.each do |attr|
|
26
29
|
expected_value = "V#{attr}"
|
27
30
|
it "attribute \"#{attr}\" equal to \"#{expected_value}\"" do
|
28
|
-
expect(
|
31
|
+
expect(a_class_instance.send(attr)).to eq(expected_value)
|
29
32
|
end
|
30
33
|
|
31
34
|
[false, true].each do |include_all|
|
32
35
|
it "respond_to?('#{attr}', #{include_all}) == #{include_all}" do
|
33
|
-
expect(
|
36
|
+
expect(a_class_instance.respond_to?("#{attr}=", include_all)).to eq(include_all)
|
37
|
+
end
|
38
|
+
end
|
39
|
+
end
|
40
|
+
|
41
|
+
context 'with super class' do
|
42
|
+
let(:super_class) do
|
43
|
+
::Class.new do
|
44
|
+
attr_reader :super_a, :super_b
|
45
|
+
|
46
|
+
def initialize(a, b) # rubocop:disable Naming/MethodParameterName
|
47
|
+
@super_a = a
|
48
|
+
@super_b = b
|
49
|
+
end
|
50
|
+
end
|
51
|
+
end
|
52
|
+
|
53
|
+
let(:sub_class) do
|
54
|
+
sub_constructor.setup_class(::Class.new(super_class))
|
55
|
+
end
|
56
|
+
|
57
|
+
let(:sub_object) { sub_class.new(1, 2, 3, 4) }
|
58
|
+
|
59
|
+
context 'with super_args parameter' do
|
60
|
+
let(:sub_constructor) do
|
61
|
+
described_class.new(:c, :a, :b, :d, super_args: -> { [c, a] })
|
62
|
+
end
|
63
|
+
|
64
|
+
it { expect(sub_object.a).to eq(2) }
|
65
|
+
it { expect(sub_object.b).to eq(3) }
|
66
|
+
it { expect(sub_object.c).to eq(1) }
|
67
|
+
it { expect(sub_object.d).to eq(4) }
|
68
|
+
it { expect(sub_object.super_a).to eq(1) }
|
69
|
+
it { expect(sub_object.super_b).to eq(2) }
|
70
|
+
end
|
71
|
+
|
72
|
+
context 'without super_args parameter' do
|
73
|
+
let(:sub_constructor) do
|
74
|
+
described_class.new(:c, :a, :b, :d)
|
75
|
+
end
|
76
|
+
|
77
|
+
it { expect(sub_object.a).to eq(2) }
|
78
|
+
it { expect(sub_object.b).to eq(3) }
|
79
|
+
it { expect(sub_object.c).to eq(1) }
|
80
|
+
it { expect(sub_object.d).to eq(4) }
|
81
|
+
it { expect(sub_object.super_a).to eq(2) }
|
82
|
+
it { expect(sub_object.super_b).to eq(3) }
|
83
|
+
end
|
84
|
+
|
85
|
+
context 'with undefined super arguments' do
|
86
|
+
let(:sub_constructor) do
|
87
|
+
described_class.new(:x, :y, :w, :a)
|
88
|
+
end
|
89
|
+
|
90
|
+
it do
|
91
|
+
expect { sub_object }.to raise_error(::ArgumentError)
|
34
92
|
end
|
35
93
|
end
|
36
94
|
end
|
@@ -0,0 +1,26 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'eac_ruby_utils/patches/enumerator/current'
|
4
|
+
|
5
|
+
RSpec.describe ::Enumerator do
|
6
|
+
let(:list) { %w[a b] }
|
7
|
+
let(:instance) { list.each }
|
8
|
+
|
9
|
+
it { expect(instance).to be_a(described_class) }
|
10
|
+
it { expect(instance.current).to eq('a') }
|
11
|
+
|
12
|
+
context 'with first next' do
|
13
|
+
before { instance.next }
|
14
|
+
|
15
|
+
it { expect(instance.current).to eq('b') }
|
16
|
+
end
|
17
|
+
|
18
|
+
context 'with last next' do
|
19
|
+
before do
|
20
|
+
instance.next
|
21
|
+
instance.next
|
22
|
+
end
|
23
|
+
|
24
|
+
it { expect(instance.current).to eq(nil) }
|
25
|
+
end
|
26
|
+
end
|
@@ -0,0 +1,32 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'eac_ruby_utils/patches/enumerator/stopped'
|
4
|
+
|
5
|
+
RSpec.describe ::Enumerator do
|
6
|
+
let(:list) { %w[a b] }
|
7
|
+
let(:instance) { list.each }
|
8
|
+
|
9
|
+
it { expect(instance).to be_a(described_class) }
|
10
|
+
it { expect(instance.peek).to eq('a') }
|
11
|
+
it { expect(instance).to be_ongoing }
|
12
|
+
it { expect(instance).not_to be_stopped }
|
13
|
+
|
14
|
+
context 'with first next' do
|
15
|
+
before { instance.next }
|
16
|
+
|
17
|
+
it { expect(instance.peek).to eq('b') }
|
18
|
+
it { expect(instance).to be_ongoing }
|
19
|
+
it { expect(instance).not_to be_stopped }
|
20
|
+
end
|
21
|
+
|
22
|
+
context 'with last next' do
|
23
|
+
before do
|
24
|
+
instance.next
|
25
|
+
instance.next
|
26
|
+
end
|
27
|
+
|
28
|
+
it { expect { instance.peek }.to raise_error(::StopIteration) }
|
29
|
+
it { expect(instance).not_to be_ongoing }
|
30
|
+
it { expect(instance).to be_stopped }
|
31
|
+
end
|
32
|
+
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.
|
4
|
+
version: 0.78.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-
|
11
|
+
date: 2020-12-12 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: aranha-parsers
|
@@ -369,6 +369,7 @@ files:
|
|
369
369
|
- lib/avm/fs_cache.rb
|
370
370
|
- lib/avm/git.rb
|
371
371
|
- lib/avm/git/auto_commit_path.rb
|
372
|
+
- lib/avm/git/auto_commit_path/ruby.rb
|
372
373
|
- lib/avm/git/commit.rb
|
373
374
|
- lib/avm/git/commit/class_methods.rb
|
374
375
|
- lib/avm/git/commit/deploy.rb
|
@@ -484,7 +485,6 @@ files:
|
|
484
485
|
- lib/avm/tools/runner.rb
|
485
486
|
- lib/avm/tools/runner/eac_rails_base0.rb
|
486
487
|
- lib/avm/tools/runner/eac_rails_base0/apache_path.rb
|
487
|
-
- lib/avm/tools/runner/eac_rails_base0/bundle.rb
|
488
488
|
- lib/avm/tools/runner/eac_rails_base0/rails_server.rb
|
489
489
|
- lib/avm/tools/runner/eac_rails_base0/runner.rb
|
490
490
|
- lib/avm/tools/runner/eac_redmine_base0.rb
|
@@ -507,6 +507,7 @@ files:
|
|
507
507
|
- lib/avm/tools/runner/git/revisions_test.rb
|
508
508
|
- lib/avm/tools/runner/git/subrepo.rb
|
509
509
|
- lib/avm/tools/runner/git/subrepo/check.rb
|
510
|
+
- lib/avm/tools/runner/git/subrepo/clone.rb
|
510
511
|
- lib/avm/tools/runner/instance.rb
|
511
512
|
- lib/avm/tools/runner/instance/info.rb
|
512
513
|
- lib/avm/tools/runner/launcher.rb
|
@@ -598,18 +599,23 @@ files:
|
|
598
599
|
- vendor/eac_cli/lib/eac_cli/core_ext.rb
|
599
600
|
- vendor/eac_cli/lib/eac_cli/default_runner.rb
|
600
601
|
- vendor/eac_cli/lib/eac_cli/definition.rb
|
602
|
+
- vendor/eac_cli/lib/eac_cli/definition/alternative.rb
|
601
603
|
- vendor/eac_cli/lib/eac_cli/definition/argument_option.rb
|
602
604
|
- vendor/eac_cli/lib/eac_cli/definition/base_option.rb
|
603
605
|
- vendor/eac_cli/lib/eac_cli/definition/boolean_option.rb
|
606
|
+
- vendor/eac_cli/lib/eac_cli/definition/help_formatter.rb
|
604
607
|
- vendor/eac_cli/lib/eac_cli/definition/positional_argument.rb
|
605
608
|
- vendor/eac_cli/lib/eac_cli/docopt/doc_builder.rb
|
609
|
+
- vendor/eac_cli/lib/eac_cli/docopt/doc_builder/alternative.rb
|
606
610
|
- vendor/eac_cli/lib/eac_cli/docopt/runner_extension.rb
|
607
611
|
- vendor/eac_cli/lib/eac_cli/parser.rb
|
612
|
+
- vendor/eac_cli/lib/eac_cli/parser/alternative.rb
|
613
|
+
- vendor/eac_cli/lib/eac_cli/parser/alternative/argv.rb
|
614
|
+
- vendor/eac_cli/lib/eac_cli/parser/alternative/double_dash.rb
|
615
|
+
- vendor/eac_cli/lib/eac_cli/parser/alternative/options.rb
|
616
|
+
- vendor/eac_cli/lib/eac_cli/parser/alternative/positionals.rb
|
608
617
|
- vendor/eac_cli/lib/eac_cli/parser/collector.rb
|
609
618
|
- vendor/eac_cli/lib/eac_cli/parser/error.rb
|
610
|
-
- vendor/eac_cli/lib/eac_cli/parser/options_collection.rb
|
611
|
-
- vendor/eac_cli/lib/eac_cli/parser/parse_result.rb
|
612
|
-
- vendor/eac_cli/lib/eac_cli/parser/positional_collection.rb
|
613
619
|
- vendor/eac_cli/lib/eac_cli/patches.rb
|
614
620
|
- vendor/eac_cli/lib/eac_cli/patches/object.rb
|
615
621
|
- vendor/eac_cli/lib/eac_cli/patches/object/runner_with.rb
|
@@ -618,8 +624,14 @@ files:
|
|
618
624
|
- vendor/eac_cli/lib/eac_cli/runner_with.rb
|
619
625
|
- vendor/eac_cli/lib/eac_cli/runner_with/help.rb
|
620
626
|
- vendor/eac_cli/lib/eac_cli/runner_with/output_file.rb
|
627
|
+
- vendor/eac_cli/lib/eac_cli/runner_with/subcommands.rb
|
621
628
|
- vendor/eac_cli/lib/eac_cli/version.rb
|
629
|
+
- vendor/eac_cli/spec/lib/eac_cli/definition/alternative_spec.rb
|
630
|
+
- vendor/eac_cli/spec/lib/eac_cli/docopt/runner_extension_spec.rb
|
631
|
+
- vendor/eac_cli/spec/lib/eac_cli/parser/alternative_spec.rb
|
622
632
|
- vendor/eac_cli/spec/lib/eac_cli/runner_spec.rb
|
633
|
+
- vendor/eac_cli/spec/lib/eac_cli/runner_with/output_file_spec.rb
|
634
|
+
- vendor/eac_cli/spec/lib/eac_cli/runner_with/subcommands_spec.rb
|
623
635
|
- vendor/eac_cli/spec/rubocop_spec.rb
|
624
636
|
- vendor/eac_cli/spec/spec_helper.rb
|
625
637
|
- vendor/eac_docker/Gemfile
|
@@ -884,6 +896,7 @@ files:
|
|
884
896
|
- vendor/eac_ruby_utils/README.rdoc
|
885
897
|
- vendor/eac_ruby_utils/eac_ruby_utils.gemspec
|
886
898
|
- vendor/eac_ruby_utils/lib/eac_ruby_utils.rb
|
899
|
+
- vendor/eac_ruby_utils/lib/eac_ruby_utils/abstract_methods.rb
|
887
900
|
- vendor/eac_ruby_utils/lib/eac_ruby_utils/arguments_consumer.rb
|
888
901
|
- vendor/eac_ruby_utils/lib/eac_ruby_utils/blank_not_blank.rb
|
889
902
|
- vendor/eac_ruby_utils/lib/eac_ruby_utils/boolean.rb
|
@@ -895,6 +908,10 @@ files:
|
|
895
908
|
- vendor/eac_ruby_utils/lib/eac_ruby_utils/configs/file.rb
|
896
909
|
- vendor/eac_ruby_utils/lib/eac_ruby_utils/console.rb
|
897
910
|
- vendor/eac_ruby_utils/lib/eac_ruby_utils/console/configs.rb
|
911
|
+
- vendor/eac_ruby_utils/lib/eac_ruby_utils/console/configs/entry_reader.rb
|
912
|
+
- vendor/eac_ruby_utils/lib/eac_ruby_utils/console/configs/password_entry_reader.rb
|
913
|
+
- vendor/eac_ruby_utils/lib/eac_ruby_utils/console/configs/read_entry_options.rb
|
914
|
+
- vendor/eac_ruby_utils/lib/eac_ruby_utils/console/configs/store_passwords_entry_reader.rb
|
898
915
|
- vendor/eac_ruby_utils/lib/eac_ruby_utils/console/docopt_runner.rb
|
899
916
|
- vendor/eac_ruby_utils/lib/eac_ruby_utils/console/docopt_runner/_class_methods.rb
|
900
917
|
- vendor/eac_ruby_utils/lib/eac_ruby_utils/console/docopt_runner/_doc.rb
|
@@ -958,10 +975,14 @@ files:
|
|
958
975
|
- vendor/eac_ruby_utils/lib/eac_ruby_utils/patches/class/common_constructor.rb
|
959
976
|
- vendor/eac_ruby_utils/lib/eac_ruby_utils/patches/enumerable.rb
|
960
977
|
- vendor/eac_ruby_utils/lib/eac_ruby_utils/patches/enumerable/boolean_combinations.rb
|
978
|
+
- vendor/eac_ruby_utils/lib/eac_ruby_utils/patches/enumerator.rb
|
979
|
+
- vendor/eac_ruby_utils/lib/eac_ruby_utils/patches/enumerator/current.rb
|
980
|
+
- vendor/eac_ruby_utils/lib/eac_ruby_utils/patches/enumerator/stopped.rb
|
961
981
|
- vendor/eac_ruby_utils/lib/eac_ruby_utils/patches/hash.rb
|
962
982
|
- vendor/eac_ruby_utils/lib/eac_ruby_utils/patches/hash/options_consumer.rb
|
963
983
|
- vendor/eac_ruby_utils/lib/eac_ruby_utils/patches/hash/sym_keys_hash.rb
|
964
984
|
- vendor/eac_ruby_utils/lib/eac_ruby_utils/patches/module.rb
|
985
|
+
- vendor/eac_ruby_utils/lib/eac_ruby_utils/patches/module/abstract_methods.rb
|
965
986
|
- vendor/eac_ruby_utils/lib/eac_ruby_utils/patches/module/common_concern.rb
|
966
987
|
- vendor/eac_ruby_utils/lib/eac_ruby_utils/patches/module/console_speaker.rb
|
967
988
|
- vendor/eac_ruby_utils/lib/eac_ruby_utils/patches/module/immutable.rb
|
@@ -971,6 +992,7 @@ files:
|
|
971
992
|
- vendor/eac_ruby_utils/lib/eac_ruby_utils/patches/module/simple_cache.rb
|
972
993
|
- vendor/eac_ruby_utils/lib/eac_ruby_utils/patches/object.rb
|
973
994
|
- vendor/eac_ruby_utils/lib/eac_ruby_utils/patches/object/asserts.rb
|
995
|
+
- vendor/eac_ruby_utils/lib/eac_ruby_utils/patches/object/debug.rb
|
974
996
|
- vendor/eac_ruby_utils/lib/eac_ruby_utils/patches/object/if_present.rb
|
975
997
|
- vendor/eac_ruby_utils/lib/eac_ruby_utils/patches/object/if_respond.rb
|
976
998
|
- vendor/eac_ruby_utils/lib/eac_ruby_utils/patches/object/template.rb
|
@@ -1010,6 +1032,7 @@ files:
|
|
1010
1032
|
- vendor/eac_ruby_utils/lib/eac_ruby_utils/templates/variable_providers/hash.rb
|
1011
1033
|
- vendor/eac_ruby_utils/lib/eac_ruby_utils/version.rb
|
1012
1034
|
- vendor/eac_ruby_utils/lib/eac_ruby_utils/yaml.rb
|
1035
|
+
- vendor/eac_ruby_utils/spec/lib/eac_ruby_utils/abstract_methods_spec.rb
|
1013
1036
|
- vendor/eac_ruby_utils/spec/lib/eac_ruby_utils/arguments_consumer_spec.rb
|
1014
1037
|
- vendor/eac_ruby_utils/spec/lib/eac_ruby_utils/blank_not_blank_spec.rb
|
1015
1038
|
- vendor/eac_ruby_utils/spec/lib/eac_ruby_utils/common_concern_spec.rb
|
@@ -1029,6 +1052,8 @@ files:
|
|
1029
1052
|
- vendor/eac_ruby_utils/spec/lib/eac_ruby_utils/listable_spec.rb
|
1030
1053
|
- vendor/eac_ruby_utils/spec/lib/eac_ruby_utils/options_consumer_spec.rb
|
1031
1054
|
- vendor/eac_ruby_utils/spec/lib/eac_ruby_utils/patches/enumerable/boolean_combinations_spec.rb
|
1055
|
+
- vendor/eac_ruby_utils/spec/lib/eac_ruby_utils/patches/enumerator/current_spec.rb
|
1056
|
+
- vendor/eac_ruby_utils/spec/lib/eac_ruby_utils/patches/enumerator/stopped_spec.rb
|
1032
1057
|
- vendor/eac_ruby_utils/spec/lib/eac_ruby_utils/patches/hash/options_consumer_spec.rb
|
1033
1058
|
- vendor/eac_ruby_utils/spec/lib/eac_ruby_utils/patches/hash/sym_keys_hash_spec.rb
|
1034
1059
|
- vendor/eac_ruby_utils/spec/lib/eac_ruby_utils/patches/module/console_speaker_spec.rb
|
@@ -1,14 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
require 'avm/eac_rails_base1/runner/bundle'
|
4
|
-
|
5
|
-
module Avm
|
6
|
-
module Tools
|
7
|
-
class Runner < ::EacRubyUtils::Console::DocoptRunner
|
8
|
-
class EacRailsBase0 < ::Avm::EacRailsBase1::Runner
|
9
|
-
class Bundle < ::Avm::EacRailsBase1::Runner::Bundle
|
10
|
-
end
|
11
|
-
end
|
12
|
-
end
|
13
|
-
end
|
14
|
-
end
|
@@ -1,21 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
require 'eac_ruby_utils/core_ext'
|
4
|
-
|
5
|
-
module EacCli
|
6
|
-
class Parser
|
7
|
-
class ParseResult
|
8
|
-
common_constructor :definition, :argv
|
9
|
-
|
10
|
-
def result
|
11
|
-
::EacCli::Parser::Collector.to_data(definition) do |collector|
|
12
|
-
::EacCli::Parser::PositionalCollection.new(
|
13
|
-
definition,
|
14
|
-
::EacCli::Parser::OptionsCollection.new(definition, argv, collector).arguments,
|
15
|
-
collector
|
16
|
-
)
|
17
|
-
end
|
18
|
-
end
|
19
|
-
end
|
20
|
-
end
|
21
|
-
end
|
@@ -1,49 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
require 'eac_ruby_utils/core_ext'
|
4
|
-
require 'eac_cli/parser/error'
|
5
|
-
|
6
|
-
module EacCli
|
7
|
-
class Parser
|
8
|
-
class PositionalCollection
|
9
|
-
common_constructor(:definition, :argv, :collector) { collect }
|
10
|
-
|
11
|
-
private
|
12
|
-
|
13
|
-
def collected
|
14
|
-
@collected ||= ::Set.new
|
15
|
-
end
|
16
|
-
|
17
|
-
def collect
|
18
|
-
argv.each { |argv_value| colect_argv_value(argv_value) }
|
19
|
-
return unless pending_required_positional?
|
20
|
-
|
21
|
-
raise ::EacCli::Parser::Error.new(
|
22
|
-
definition, argv, 'No value for required positional ' \
|
23
|
-
"\"#{current_positional.identifier}\""
|
24
|
-
)
|
25
|
-
end
|
26
|
-
|
27
|
-
def colect_argv_value(argv_value)
|
28
|
-
collector.collect(current_positional, argv_value)
|
29
|
-
collected << current_positional
|
30
|
-
positional_enumerator.next unless current_positional.repeat?
|
31
|
-
end
|
32
|
-
|
33
|
-
def pending_required_positional?
|
34
|
-
!(current_positional.blank? || current_positional.optional? ||
|
35
|
-
collected.include?(current_positional))
|
36
|
-
end
|
37
|
-
|
38
|
-
def positional_enumerator
|
39
|
-
@positional_enumerator ||= definition.positional.each
|
40
|
-
end
|
41
|
-
|
42
|
-
def current_positional
|
43
|
-
positional_enumerator.peek
|
44
|
-
rescue ::StopIteration
|
45
|
-
nil
|
46
|
-
end
|
47
|
-
end
|
48
|
-
end
|
49
|
-
end
|