avm-tools 0.75.1 → 0.79.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/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/patches/class/i18n.rb +31 -0
- data/lib/avm/patches/object/i18n.rb +2 -10
- data/lib/avm/projects/stereotypes/ruby_gem/update.rb +4 -1
- data/lib/avm/projects/stereotypes/ruby_gem/version_bump.rb +1 -2
- 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 +4 -69
- 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 +7 -2
- 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 -5
- 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
@@ -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.79.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
|
@@ -433,6 +434,7 @@ files:
|
|
433
434
|
- lib/avm/local_projects.rb
|
434
435
|
- lib/avm/local_projects/instance.rb
|
435
436
|
- lib/avm/patches.rb
|
437
|
+
- lib/avm/patches/class/i18n.rb
|
436
438
|
- lib/avm/patches/eac_ruby_gems_utils/gem.rb
|
437
439
|
- lib/avm/patches/i18n.rb
|
438
440
|
- lib/avm/patches/object/i18n.rb
|
@@ -506,6 +508,7 @@ files:
|
|
506
508
|
- lib/avm/tools/runner/git/revisions_test.rb
|
507
509
|
- lib/avm/tools/runner/git/subrepo.rb
|
508
510
|
- lib/avm/tools/runner/git/subrepo/check.rb
|
511
|
+
- lib/avm/tools/runner/git/subrepo/clone.rb
|
509
512
|
- lib/avm/tools/runner/instance.rb
|
510
513
|
- lib/avm/tools/runner/instance/info.rb
|
511
514
|
- lib/avm/tools/runner/launcher.rb
|
@@ -597,18 +600,23 @@ files:
|
|
597
600
|
- vendor/eac_cli/lib/eac_cli/core_ext.rb
|
598
601
|
- vendor/eac_cli/lib/eac_cli/default_runner.rb
|
599
602
|
- vendor/eac_cli/lib/eac_cli/definition.rb
|
603
|
+
- vendor/eac_cli/lib/eac_cli/definition/alternative.rb
|
600
604
|
- vendor/eac_cli/lib/eac_cli/definition/argument_option.rb
|
601
605
|
- vendor/eac_cli/lib/eac_cli/definition/base_option.rb
|
602
606
|
- vendor/eac_cli/lib/eac_cli/definition/boolean_option.rb
|
607
|
+
- vendor/eac_cli/lib/eac_cli/definition/help_formatter.rb
|
603
608
|
- vendor/eac_cli/lib/eac_cli/definition/positional_argument.rb
|
604
609
|
- vendor/eac_cli/lib/eac_cli/docopt/doc_builder.rb
|
610
|
+
- vendor/eac_cli/lib/eac_cli/docopt/doc_builder/alternative.rb
|
605
611
|
- vendor/eac_cli/lib/eac_cli/docopt/runner_extension.rb
|
606
612
|
- vendor/eac_cli/lib/eac_cli/parser.rb
|
613
|
+
- vendor/eac_cli/lib/eac_cli/parser/alternative.rb
|
614
|
+
- vendor/eac_cli/lib/eac_cli/parser/alternative/argv.rb
|
615
|
+
- vendor/eac_cli/lib/eac_cli/parser/alternative/double_dash.rb
|
616
|
+
- vendor/eac_cli/lib/eac_cli/parser/alternative/options.rb
|
617
|
+
- vendor/eac_cli/lib/eac_cli/parser/alternative/positionals.rb
|
607
618
|
- vendor/eac_cli/lib/eac_cli/parser/collector.rb
|
608
619
|
- vendor/eac_cli/lib/eac_cli/parser/error.rb
|
609
|
-
- vendor/eac_cli/lib/eac_cli/parser/options_collection.rb
|
610
|
-
- vendor/eac_cli/lib/eac_cli/parser/parse_result.rb
|
611
|
-
- vendor/eac_cli/lib/eac_cli/parser/positional_collection.rb
|
612
620
|
- vendor/eac_cli/lib/eac_cli/patches.rb
|
613
621
|
- vendor/eac_cli/lib/eac_cli/patches/object.rb
|
614
622
|
- vendor/eac_cli/lib/eac_cli/patches/object/runner_with.rb
|
@@ -617,8 +625,14 @@ files:
|
|
617
625
|
- vendor/eac_cli/lib/eac_cli/runner_with.rb
|
618
626
|
- vendor/eac_cli/lib/eac_cli/runner_with/help.rb
|
619
627
|
- vendor/eac_cli/lib/eac_cli/runner_with/output_file.rb
|
628
|
+
- vendor/eac_cli/lib/eac_cli/runner_with/subcommands.rb
|
620
629
|
- vendor/eac_cli/lib/eac_cli/version.rb
|
630
|
+
- vendor/eac_cli/spec/lib/eac_cli/definition/alternative_spec.rb
|
631
|
+
- vendor/eac_cli/spec/lib/eac_cli/docopt/runner_extension_spec.rb
|
632
|
+
- vendor/eac_cli/spec/lib/eac_cli/parser/alternative_spec.rb
|
621
633
|
- vendor/eac_cli/spec/lib/eac_cli/runner_spec.rb
|
634
|
+
- vendor/eac_cli/spec/lib/eac_cli/runner_with/output_file_spec.rb
|
635
|
+
- vendor/eac_cli/spec/lib/eac_cli/runner_with/subcommands_spec.rb
|
622
636
|
- vendor/eac_cli/spec/rubocop_spec.rb
|
623
637
|
- vendor/eac_cli/spec/spec_helper.rb
|
624
638
|
- vendor/eac_docker/Gemfile
|
@@ -883,6 +897,7 @@ files:
|
|
883
897
|
- vendor/eac_ruby_utils/README.rdoc
|
884
898
|
- vendor/eac_ruby_utils/eac_ruby_utils.gemspec
|
885
899
|
- vendor/eac_ruby_utils/lib/eac_ruby_utils.rb
|
900
|
+
- vendor/eac_ruby_utils/lib/eac_ruby_utils/abstract_methods.rb
|
886
901
|
- vendor/eac_ruby_utils/lib/eac_ruby_utils/arguments_consumer.rb
|
887
902
|
- vendor/eac_ruby_utils/lib/eac_ruby_utils/blank_not_blank.rb
|
888
903
|
- vendor/eac_ruby_utils/lib/eac_ruby_utils/boolean.rb
|
@@ -894,7 +909,10 @@ files:
|
|
894
909
|
- vendor/eac_ruby_utils/lib/eac_ruby_utils/configs/file.rb
|
895
910
|
- vendor/eac_ruby_utils/lib/eac_ruby_utils/console.rb
|
896
911
|
- vendor/eac_ruby_utils/lib/eac_ruby_utils/console/configs.rb
|
912
|
+
- vendor/eac_ruby_utils/lib/eac_ruby_utils/console/configs/entry_reader.rb
|
913
|
+
- vendor/eac_ruby_utils/lib/eac_ruby_utils/console/configs/password_entry_reader.rb
|
897
914
|
- vendor/eac_ruby_utils/lib/eac_ruby_utils/console/configs/read_entry_options.rb
|
915
|
+
- vendor/eac_ruby_utils/lib/eac_ruby_utils/console/configs/store_passwords_entry_reader.rb
|
898
916
|
- vendor/eac_ruby_utils/lib/eac_ruby_utils/console/docopt_runner.rb
|
899
917
|
- vendor/eac_ruby_utils/lib/eac_ruby_utils/console/docopt_runner/_class_methods.rb
|
900
918
|
- vendor/eac_ruby_utils/lib/eac_ruby_utils/console/docopt_runner/_doc.rb
|
@@ -958,10 +976,14 @@ files:
|
|
958
976
|
- vendor/eac_ruby_utils/lib/eac_ruby_utils/patches/class/common_constructor.rb
|
959
977
|
- vendor/eac_ruby_utils/lib/eac_ruby_utils/patches/enumerable.rb
|
960
978
|
- vendor/eac_ruby_utils/lib/eac_ruby_utils/patches/enumerable/boolean_combinations.rb
|
979
|
+
- vendor/eac_ruby_utils/lib/eac_ruby_utils/patches/enumerator.rb
|
980
|
+
- vendor/eac_ruby_utils/lib/eac_ruby_utils/patches/enumerator/current.rb
|
981
|
+
- vendor/eac_ruby_utils/lib/eac_ruby_utils/patches/enumerator/stopped.rb
|
961
982
|
- vendor/eac_ruby_utils/lib/eac_ruby_utils/patches/hash.rb
|
962
983
|
- vendor/eac_ruby_utils/lib/eac_ruby_utils/patches/hash/options_consumer.rb
|
963
984
|
- vendor/eac_ruby_utils/lib/eac_ruby_utils/patches/hash/sym_keys_hash.rb
|
964
985
|
- vendor/eac_ruby_utils/lib/eac_ruby_utils/patches/module.rb
|
986
|
+
- vendor/eac_ruby_utils/lib/eac_ruby_utils/patches/module/abstract_methods.rb
|
965
987
|
- vendor/eac_ruby_utils/lib/eac_ruby_utils/patches/module/common_concern.rb
|
966
988
|
- vendor/eac_ruby_utils/lib/eac_ruby_utils/patches/module/console_speaker.rb
|
967
989
|
- vendor/eac_ruby_utils/lib/eac_ruby_utils/patches/module/immutable.rb
|
@@ -971,6 +993,7 @@ files:
|
|
971
993
|
- vendor/eac_ruby_utils/lib/eac_ruby_utils/patches/module/simple_cache.rb
|
972
994
|
- vendor/eac_ruby_utils/lib/eac_ruby_utils/patches/object.rb
|
973
995
|
- vendor/eac_ruby_utils/lib/eac_ruby_utils/patches/object/asserts.rb
|
996
|
+
- vendor/eac_ruby_utils/lib/eac_ruby_utils/patches/object/debug.rb
|
974
997
|
- vendor/eac_ruby_utils/lib/eac_ruby_utils/patches/object/if_present.rb
|
975
998
|
- vendor/eac_ruby_utils/lib/eac_ruby_utils/patches/object/if_respond.rb
|
976
999
|
- vendor/eac_ruby_utils/lib/eac_ruby_utils/patches/object/template.rb
|
@@ -1010,6 +1033,7 @@ files:
|
|
1010
1033
|
- vendor/eac_ruby_utils/lib/eac_ruby_utils/templates/variable_providers/hash.rb
|
1011
1034
|
- vendor/eac_ruby_utils/lib/eac_ruby_utils/version.rb
|
1012
1035
|
- vendor/eac_ruby_utils/lib/eac_ruby_utils/yaml.rb
|
1036
|
+
- vendor/eac_ruby_utils/spec/lib/eac_ruby_utils/abstract_methods_spec.rb
|
1013
1037
|
- vendor/eac_ruby_utils/spec/lib/eac_ruby_utils/arguments_consumer_spec.rb
|
1014
1038
|
- vendor/eac_ruby_utils/spec/lib/eac_ruby_utils/blank_not_blank_spec.rb
|
1015
1039
|
- vendor/eac_ruby_utils/spec/lib/eac_ruby_utils/common_concern_spec.rb
|
@@ -1029,6 +1053,8 @@ files:
|
|
1029
1053
|
- vendor/eac_ruby_utils/spec/lib/eac_ruby_utils/listable_spec.rb
|
1030
1054
|
- vendor/eac_ruby_utils/spec/lib/eac_ruby_utils/options_consumer_spec.rb
|
1031
1055
|
- vendor/eac_ruby_utils/spec/lib/eac_ruby_utils/patches/enumerable/boolean_combinations_spec.rb
|
1056
|
+
- vendor/eac_ruby_utils/spec/lib/eac_ruby_utils/patches/enumerator/current_spec.rb
|
1057
|
+
- vendor/eac_ruby_utils/spec/lib/eac_ruby_utils/patches/enumerator/stopped_spec.rb
|
1032
1058
|
- vendor/eac_ruby_utils/spec/lib/eac_ruby_utils/patches/hash/options_consumer_spec.rb
|
1033
1059
|
- vendor/eac_ruby_utils/spec/lib/eac_ruby_utils/patches/hash/sym_keys_hash_spec.rb
|
1034
1060
|
- vendor/eac_ruby_utils/spec/lib/eac_ruby_utils/patches/module/console_speaker_spec.rb
|
@@ -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
|