avm-tools 0.92.0 → 0.94.3
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_asciidoctor_base0/apache_path.rb +10 -0
- data/lib/avm/eac_rails_base0/apache_path.rb +6 -38
- data/lib/avm/eac_webapp_base0/apache_host.rb +7 -31
- data/lib/avm/eac_webapp_base0/apache_path.rb +51 -0
- data/lib/avm/eac_webapp_base0/deploy.rb +12 -30
- data/lib/avm/eac_webapp_base0/instance.rb +5 -2
- data/lib/avm/eac_webapp_base0/instance/subcommand_parent.rb +24 -0
- data/lib/avm/eac_webapp_base0/runner/apache_host.rb +7 -10
- data/lib/avm/eac_webapp_base0/runner/apache_path.rb +40 -0
- data/lib/avm/eac_webapp_base0/runner/data.rb +7 -15
- data/lib/avm/eac_webapp_base0/runner/data/dump.rb +18 -24
- data/lib/avm/eac_webapp_base0/runner/data/load.rb +12 -23
- data/lib/avm/git/auto_commit/commit_info.rb +2 -1
- data/lib/avm/git/auto_commit/rules.rb +4 -4
- data/lib/avm/git/auto_commit/rules/new.rb +24 -0
- data/lib/avm/git/auto_commit/rules/nth.rb +8 -0
- data/lib/avm/git/auto_commit_path.rb +0 -21
- data/lib/avm/git/file_auto_fixup.rb +19 -3
- data/lib/avm/tools/runner/eac_redmine_base0/core_update.rb +7 -11
- data/lib/avm/tools/runner/git/auto_commit.rb +28 -28
- data/lib/avm/tools/runner/git/subrepo/fix.rb +1 -1
- data/lib/avm/tools/runner/local_project/ruby.rb +3 -7
- data/lib/avm/tools/runner/local_project/ruby/bundler.rb +4 -8
- data/lib/avm/tools/runner/local_project/ruby/bundler/gemfile_lock.rb +11 -14
- data/lib/avm/tools/runner/ruby.rb +6 -14
- data/lib/avm/tools/runner/ruby/gems.rb +4 -7
- data/lib/avm/tools/runner/ruby/gems/generate.rb +12 -23
- data/lib/avm/tools/runner/ruby/rubocop.rb +1 -1
- data/lib/avm/tools/version.rb +1 -1
- data/template/avm/eac_rails_base0/apache_path/extra_content.conf +5 -0
- data/template/avm/eac_webapp_base0/apache_path/default.conf +9 -0
- data/vendor/avm-apps/Gemfile +5 -0
- data/vendor/avm-apps/avm-apps.gemspec +18 -0
- data/vendor/avm-apps/lib/avm/apps.rb +9 -0
- data/vendor/avm-apps/lib/avm/apps/jobs.rb +11 -0
- data/vendor/avm-apps/lib/avm/apps/jobs/base.rb +64 -0
- data/vendor/avm-apps/lib/avm/apps/jobs/variables_source.rb +24 -0
- data/vendor/avm-apps/lib/avm/apps/version.rb +7 -0
- data/vendor/avm-apps/spec/rubocop_spec.rb +7 -0
- data/vendor/avm-apps/spec/spec_helper.rb +100 -0
- data/vendor/eac_cli/lib/eac_cli/core_ext.rb +2 -0
- data/vendor/eac_cli/lib/eac_cli/definition/alternative.rb +4 -7
- data/vendor/eac_cli/lib/eac_cli/definition/base_option.rb +20 -9
- data/vendor/eac_cli/lib/eac_cli/definition/base_option/initialize_args_parser.rb +47 -0
- data/vendor/eac_cli/lib/eac_cli/docopt/doc_builder.rb +15 -1
- data/vendor/eac_cli/lib/eac_cli/parser/alternative/short_options.rb +4 -2
- data/vendor/eac_cli/lib/eac_cli/patches/object/runner_with.rb +2 -1
- data/vendor/eac_cli/lib/eac_cli/runner/context.rb +2 -1
- data/vendor/eac_cli/lib/eac_cli/runner/instance_methods.rb +8 -1
- data/vendor/eac_cli/lib/eac_cli/runner_with_set.rb +50 -0
- data/vendor/eac_cli/lib/eac_cli/version.rb +1 -1
- data/vendor/eac_cli/spec/lib/eac_cli/definition/alternative_spec.rb +4 -0
- data/vendor/eac_git/eac_git.gemspec +1 -0
- data/vendor/eac_git/lib/eac_git/local.rb +4 -0
- data/vendor/eac_git/lib/eac_git/local/commit.rb +53 -0
- data/vendor/eac_git/lib/eac_git/local/commit/changed_file.rb +46 -0
- data/vendor/eac_git/lib/eac_git/local/commit/diff_tree_line.rb +32 -0
- data/vendor/eac_git/lib/eac_git/local/dirty_files.rb +2 -3
- data/vendor/eac_git/lib/eac_git/rspec.rb +6 -1
- data/{lib/avm/git/spec_helper.rb → vendor/eac_git/lib/eac_git/rspec/stubbed_git_local_repo.rb} +16 -13
- data/vendor/eac_git/lib/eac_git/version.rb +1 -1
- data/vendor/eac_git/spec/lib/eac_git/local/commit/diff_tree_line_spec.rb +13 -0
- data/vendor/eac_git/spec/lib/eac_git/local/commit/diff_tree_line_spec_files/add.source.out +1 -0
- data/vendor/eac_git/spec/lib/eac_git/local/commit/diff_tree_line_spec_files/add.target.yaml +7 -0
- data/vendor/eac_git/spec/lib/eac_git/local/commit/diff_tree_line_spec_files/modify.source.out +1 -0
- data/vendor/eac_git/spec/lib/eac_git/local/commit/diff_tree_line_spec_files/modify.target.yaml +7 -0
- data/vendor/eac_git/spec/lib/eac_git/local/commit/diff_tree_line_spec_files/remove.source.out +1 -0
- data/vendor/eac_git/spec/lib/eac_git/local/commit/diff_tree_line_spec_files/remove.target.yaml +7 -0
- data/vendor/eac_git/spec/lib/eac_git/local/commit/diff_tree_line_spec_files/rename.source.out +2 -0
- data/vendor/eac_git/spec/lib/eac_git/local/commit/diff_tree_line_spec_files/rename.target.yaml +13 -0
- data/vendor/eac_git/spec/lib/eac_git/local/commit/diff_tree_line_spec_files/rename_modify.source.out +2 -0
- data/vendor/eac_git/spec/lib/eac_git/local/commit/diff_tree_line_spec_files/rename_modify.target.yaml +13 -0
- data/vendor/eac_git/spec/lib/eac_git/local/commit_spec.rb +58 -0
- data/vendor/eac_git/spec/spec_helper.rb +1 -0
- data/vendor/eac_ruby_base0/eac_ruby_base0.gemspec +3 -3
- data/vendor/eac_ruby_base0/lib/eac_ruby_base0/core_ext.rb +4 -0
- data/vendor/eac_ruby_base0/lib/eac_ruby_base0/jobs_runner.rb +31 -0
- data/vendor/eac_ruby_base0/lib/eac_ruby_base0/patches.rb +4 -0
- data/vendor/eac_ruby_base0/lib/eac_ruby_base0/patches/class.rb +4 -0
- data/vendor/eac_ruby_base0/lib/eac_ruby_base0/patches/class/jobs_runner.rb +10 -0
- data/vendor/eac_ruby_base0/lib/eac_ruby_base0/patches/object.rb +5 -0
- data/vendor/eac_ruby_base0/lib/eac_ruby_base0/patches/object/runner_with.rb +5 -0
- data/vendor/eac_ruby_base0/lib/eac_ruby_base0/runner_with.rb +9 -0
- data/vendor/eac_ruby_base0/lib/eac_ruby_base0/runner_with/confirmation.rb +36 -0
- data/vendor/eac_ruby_base0/lib/eac_ruby_base0/runner_with/filesystem_traverser.rb +52 -0
- data/vendor/eac_ruby_base0/lib/eac_ruby_base0/runner_with/output.rb +58 -0
- data/vendor/eac_ruby_base0/lib/eac_ruby_base0/version.rb +1 -1
- data/vendor/eac_ruby_base0/spec/lib/eac_ruby_base0/runner_with/confirmation_spec.rb +42 -0
- data/vendor/eac_ruby_base0/spec/lib/eac_ruby_base0/runner_with/output_spec.rb +81 -0
- data/vendor/eac_ruby_gems_utils/lib/eac_ruby_gems_utils/tests/base.rb +7 -10
- data/vendor/eac_ruby_gems_utils/lib/eac_ruby_gems_utils/tests/multiple.rb +9 -2
- data/vendor/eac_ruby_gems_utils/lib/eac_ruby_gems_utils/version.rb +1 -1
- data/vendor/eac_ruby_utils/eac_ruby_utils.gemspec +1 -0
- data/vendor/eac_ruby_utils/lib/eac_ruby_utils/fs/logs.rb +63 -0
- data/vendor/eac_ruby_utils/lib/eac_ruby_utils/inflector.rb +9 -1
- data/vendor/eac_ruby_utils/lib/eac_ruby_utils/listable/list.rb +3 -2
- data/vendor/eac_ruby_utils/lib/eac_ruby_utils/local_time_zone.rb +8 -2
- data/vendor/eac_ruby_utils/lib/eac_ruby_utils/patches/class/settings_provider.rb +10 -0
- data/vendor/eac_ruby_utils/lib/eac_ruby_utils/patches/kernel/nyi.rb +4 -2
- data/vendor/eac_ruby_utils/lib/eac_ruby_utils/patches/object/if_nil.rb +17 -0
- data/vendor/eac_ruby_utils/lib/eac_ruby_utils/patches/string/inflector.rb +4 -2
- data/vendor/eac_ruby_utils/lib/eac_ruby_utils/patches/time/required_zone.rb +11 -0
- data/vendor/eac_ruby_utils/lib/eac_ruby_utils/settings_provider.rb +10 -29
- data/vendor/eac_ruby_utils/lib/eac_ruby_utils/settings_provider/setting_value.rb +69 -0
- data/vendor/eac_ruby_utils/lib/eac_ruby_utils/version.rb +1 -1
- data/vendor/eac_ruby_utils/spec/lib/eac_ruby_utils/settings_provider_spec.rb +8 -0
- metadata +55 -9
- data/lib/avm/tools/runner/eac_rails_base0/apache_path.rb +0 -38
- data/lib/avm/tools/runner/git/auto_fixup.rb +0 -53
- data/template/avm/eac_rails_base0/apache_path/default.conf +0 -13
- data/vendor/eac_cli/lib/eac_cli/runner_with/output_file.rb +0 -30
- data/vendor/eac_cli/spec/lib/eac_cli/runner_with/output_file_spec.rb +0 -53
@@ -1,24 +1,16 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
require '
|
4
|
-
require 'eac_ruby_utils/core_ext'
|
3
|
+
require 'eac_cli/core_ext'
|
5
4
|
|
6
5
|
module Avm
|
7
6
|
module Tools
|
8
7
|
class Runner
|
9
|
-
class Ruby
|
8
|
+
class Ruby
|
10
9
|
require_sub __FILE__
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
Usage:
|
16
|
-
__PROGRAM__ [options] __SUBCOMMANDS__
|
17
|
-
__PROGRAM__ -h | --help
|
18
|
-
|
19
|
-
Options:
|
20
|
-
-h --help Show this screen.
|
21
|
-
DOCOPT
|
10
|
+
runner_with :help, :subcommands do
|
11
|
+
desc 'Ruby utilities for AVM.'
|
12
|
+
subcommands
|
13
|
+
end
|
22
14
|
end
|
23
15
|
end
|
24
16
|
end
|
@@ -1,17 +1,14 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
require '
|
4
|
-
require 'eac_ruby_utils/core_ext'
|
3
|
+
require 'eac_cli/core_ext'
|
5
4
|
|
6
5
|
module Avm
|
7
6
|
module Tools
|
8
7
|
class Runner
|
9
|
-
class Ruby
|
10
|
-
class Gems
|
8
|
+
class Ruby
|
9
|
+
class Gems
|
11
10
|
require_sub __FILE__
|
12
|
-
|
13
|
-
|
14
|
-
runner_definition do
|
11
|
+
runner_with :help, :subcommands do
|
15
12
|
desc 'Rubygems utilities for AVM.'
|
16
13
|
subcommands
|
17
14
|
end
|
@@ -1,31 +1,20 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
3
|
require 'avm/ruby/gems/generator'
|
4
|
-
require '
|
5
|
-
require 'eac_ruby_utils/core_ext'
|
6
|
-
require 'eac_cli/default_runner'
|
4
|
+
require 'eac_cli/core_ext'
|
7
5
|
|
8
6
|
module Avm
|
9
7
|
module Tools
|
10
8
|
class Runner
|
11
|
-
class Ruby
|
12
|
-
class Gems
|
13
|
-
class Generate
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
Usage:
|
21
|
-
__PROGRAM__ [options] <path>
|
22
|
-
__PROGRAM__ -h --help
|
23
|
-
|
24
|
-
Options:
|
25
|
-
-h --help Show this help.
|
26
|
-
--eac-ruby-utils-version=<version> Version for "eac_ruby_utils" gem.
|
27
|
-
--eac-ruby-gem-support-version=<version> Version for "eac_ruby_gem_support" gem.
|
28
|
-
DOCUMENT
|
9
|
+
class Ruby
|
10
|
+
class Gems
|
11
|
+
class Generate
|
12
|
+
runner_with :help do
|
13
|
+
desc 'Create a gem.'
|
14
|
+
arg_opt '--eac-ruby-utils-version', 'Version for "eac_ruby_utils" gem.'
|
15
|
+
arg_opt '--eac-ruby-gem-support-version', 'Version for "eac_ruby_gem_support" gem.'
|
16
|
+
pos_arg :path
|
17
|
+
end
|
29
18
|
|
30
19
|
def run
|
31
20
|
success "Gem \"#{generator.name}\" created in \"#{generator.root_directory}\""
|
@@ -34,12 +23,12 @@ module Avm
|
|
34
23
|
private
|
35
24
|
|
36
25
|
def generator_uncached
|
37
|
-
::Avm::Ruby::Gems::Generator.new(
|
26
|
+
::Avm::Ruby::Gems::Generator.new(parsed.path, generator_options)
|
38
27
|
end
|
39
28
|
|
40
29
|
def generator_options
|
41
30
|
%w[eac_ruby_utils eac_ruby_gem_support].map do |gem_name|
|
42
|
-
["#{gem_name}_version".to_sym,
|
31
|
+
["#{gem_name}_version".to_sym, parsed.fetch("#{gem_name.variableize}_version")]
|
43
32
|
end.to_h
|
44
33
|
end
|
45
34
|
end
|
@@ -7,7 +7,7 @@ require 'eac_ruby_utils/core_ext'
|
|
7
7
|
module Avm
|
8
8
|
module Tools
|
9
9
|
class Runner
|
10
|
-
class Ruby
|
10
|
+
class Ruby
|
11
11
|
class Rubocop < ::EacRubyUtils::Console::DocoptRunner
|
12
12
|
include ::EacRubyUtils::Console::Speaker
|
13
13
|
include ::EacRubyUtils::SimpleCache
|
data/lib/avm/tools/version.rb
CHANGED
@@ -0,0 +1,18 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
$LOAD_PATH.push File.expand_path('lib', __dir__)
|
4
|
+
|
5
|
+
require 'avm/apps/version'
|
6
|
+
|
7
|
+
Gem::Specification.new do |s|
|
8
|
+
s.name = 'avm-apps'
|
9
|
+
s.version = Avm::Apps::VERSION
|
10
|
+
s.authors = ['Eduardo H. Bogoni']
|
11
|
+
s.summary = 'AVM components for applications.'
|
12
|
+
|
13
|
+
s.files = Dir['{lib}/**/*']
|
14
|
+
|
15
|
+
s.add_dependency 'eac_ruby_utils', '~> 0.58', '>= 0.58.1'
|
16
|
+
|
17
|
+
s.add_development_dependency 'eac_ruby_gem_support', '~> 0.1', '>= 0.1.2'
|
18
|
+
end
|
@@ -0,0 +1,64 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'avm/apps/jobs/variables_source'
|
4
|
+
require 'eac_ruby_utils/core_ext'
|
5
|
+
|
6
|
+
module Avm
|
7
|
+
module Apps
|
8
|
+
module Jobs
|
9
|
+
module Base
|
10
|
+
common_concern do
|
11
|
+
include ::ActiveSupport::Callbacks
|
12
|
+
|
13
|
+
enable_console_speaker
|
14
|
+
enable_simple_cache
|
15
|
+
enable_listable
|
16
|
+
common_constructor :instance, :options, default: [{}] do
|
17
|
+
if option_list.present?
|
18
|
+
self.options = option_list.hash_keys_validate!(options.symbolize_keys)
|
19
|
+
end
|
20
|
+
end
|
21
|
+
define_callbacks(*jobs)
|
22
|
+
end
|
23
|
+
|
24
|
+
module ClassMethods
|
25
|
+
def jobs
|
26
|
+
const_get('JOBS').dup
|
27
|
+
end
|
28
|
+
end
|
29
|
+
|
30
|
+
module InstanceMethods
|
31
|
+
def option_list
|
32
|
+
nil
|
33
|
+
end
|
34
|
+
|
35
|
+
def run
|
36
|
+
start_banner if respond_to?(:start_banner)
|
37
|
+
run_jobs
|
38
|
+
::Avm::Result.success('Done!')
|
39
|
+
rescue ::Avm::Result::Error => e
|
40
|
+
e.to_result
|
41
|
+
end
|
42
|
+
|
43
|
+
def variables_source
|
44
|
+
::Avm::Apps::Jobs::VariablesSource.new(self, instance)
|
45
|
+
end
|
46
|
+
|
47
|
+
protected
|
48
|
+
|
49
|
+
def run_jobs
|
50
|
+
jobs.each do |job|
|
51
|
+
run_callbacks job do
|
52
|
+
send(job)
|
53
|
+
end
|
54
|
+
end
|
55
|
+
end
|
56
|
+
|
57
|
+
def jobs
|
58
|
+
self.class.jobs
|
59
|
+
end
|
60
|
+
end
|
61
|
+
end
|
62
|
+
end
|
63
|
+
end
|
64
|
+
end
|
@@ -0,0 +1,24 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'eac_ruby_utils/core_ext'
|
4
|
+
|
5
|
+
module Avm
|
6
|
+
module Apps
|
7
|
+
module Jobs
|
8
|
+
class VariablesSource
|
9
|
+
common_constructor :job, :instance
|
10
|
+
|
11
|
+
def read_entry(path, options = {})
|
12
|
+
entry_from_job(path) || instance.read_entry(path, options)
|
13
|
+
end
|
14
|
+
|
15
|
+
private
|
16
|
+
|
17
|
+
def entry_from_job(path)
|
18
|
+
method = path.gsub('.', '_').underscore
|
19
|
+
return job.send(method) if job.respond_to?(method, true)
|
20
|
+
end
|
21
|
+
end
|
22
|
+
end
|
23
|
+
end
|
24
|
+
end
|
@@ -0,0 +1,100 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
# This file was generated by the `rspec --init` command. Conventionally, all
|
4
|
+
# specs live under a `spec` directory, which RSpec adds to the `$LOAD_PATH`.
|
5
|
+
# The generated `.rspec` file contains `--require spec_helper` which will cause
|
6
|
+
# this file to always be loaded, without a need to explicitly require it in any
|
7
|
+
# files.
|
8
|
+
#
|
9
|
+
# Given that it is always loaded, you are encouraged to keep this file as
|
10
|
+
# light-weight as possible. Requiring heavyweight dependencies from this file
|
11
|
+
# will add to the boot time of your test suite on EVERY test run, even for an
|
12
|
+
# individual file that may not need all of that loaded. Instead, consider making
|
13
|
+
# a separate helper file that requires the additional dependencies and performs
|
14
|
+
# the additional setup, and require it from the spec files that actually need
|
15
|
+
# it.
|
16
|
+
#
|
17
|
+
# See http://rubydoc.info/gems/rspec-core/RSpec/Core/Configuration
|
18
|
+
RSpec.configure do |config|
|
19
|
+
# rspec-expectations config goes here. You can use an alternate
|
20
|
+
# assertion/expectation library such as wrong or the stdlib/minitest
|
21
|
+
# assertions if you prefer.
|
22
|
+
config.expect_with :rspec do |expectations|
|
23
|
+
# This option will default to `true` in RSpec 4. It makes the `description`
|
24
|
+
# and `failure_message` of custom matchers include text for helper methods
|
25
|
+
# defined using `chain`, e.g.:
|
26
|
+
# be_bigger_than(2).and_smaller_than(4).description
|
27
|
+
# # => "be bigger than 2 and smaller than 4"
|
28
|
+
# ...rather than:
|
29
|
+
# # => "be bigger than 2"
|
30
|
+
expectations.include_chain_clauses_in_custom_matcher_descriptions = true
|
31
|
+
end
|
32
|
+
|
33
|
+
# rspec-mocks config goes here. You can use an alternate test double
|
34
|
+
# library (such as bogus or mocha) by changing the `mock_with` option here.
|
35
|
+
config.mock_with :rspec do |mocks|
|
36
|
+
# Prevents you from mocking or stubbing a method that does not exist on
|
37
|
+
# a real object. This is generally recommended, and will default to
|
38
|
+
# `true` in RSpec 4.
|
39
|
+
mocks.verify_partial_doubles = true
|
40
|
+
end
|
41
|
+
|
42
|
+
# This option will default to `:apply_to_host_groups` in RSpec 4 (and will
|
43
|
+
# have no way to turn it off -- the option exists only for backwards
|
44
|
+
# compatibility in RSpec 3). It causes shared context metadata to be
|
45
|
+
# inherited by the metadata hash of host groups and examples, rather than
|
46
|
+
# triggering implicit auto-inclusion in groups with matching metadata.
|
47
|
+
config.shared_context_metadata_behavior = :apply_to_host_groups
|
48
|
+
|
49
|
+
# The settings below are suggested to provide a good initial experience
|
50
|
+
# with RSpec, but feel free to customize to your heart's content.
|
51
|
+
# # This allows you to limit a spec run to individual examples or groups
|
52
|
+
# # you care about by tagging them with `:focus` metadata. When nothing
|
53
|
+
# # is tagged with `:focus`, all examples get run. RSpec also provides
|
54
|
+
# # aliases for `it`, `describe`, and `context` that include `:focus`
|
55
|
+
# # metadata: `fit`, `fdescribe` and `fcontext`, respectively.
|
56
|
+
# config.filter_run_when_matching :focus
|
57
|
+
#
|
58
|
+
# # Allows RSpec to persist some state between runs in order to support
|
59
|
+
# # the `--only-failures` and `--next-failure` CLI options. We recommend
|
60
|
+
# # you configure your source control system to ignore this file.
|
61
|
+
# config.example_status_persistence_file_path = "spec/examples.txt"
|
62
|
+
#
|
63
|
+
# # Limits the available syntax to the non-monkey patched syntax that is
|
64
|
+
# # recommended. For more details, see:
|
65
|
+
# # - http://rspec.info/blog/2012/06/rspecs-new-expectation-syntax/
|
66
|
+
# # - http://www.teaisaweso.me/blog/2013/05/27/rspecs-new-message-expectation-syntax/
|
67
|
+
# # - http://rspec.info/blog/2014/05/notable-changes-in-rspec-3/#zero-monkey-patching-mode
|
68
|
+
# config.disable_monkey_patching!
|
69
|
+
#
|
70
|
+
# # This setting enables warnings. It's recommended, but in some cases may
|
71
|
+
# # be too noisy due to issues in dependencies.
|
72
|
+
# config.warnings = true
|
73
|
+
#
|
74
|
+
# # Many RSpec users commonly either run the entire suite or an individual
|
75
|
+
# # file, and it's useful to allow more verbose output when running an
|
76
|
+
# # individual spec file.
|
77
|
+
# if config.files_to_run.one?
|
78
|
+
# # Use the documentation formatter for detailed output,
|
79
|
+
# # unless a formatter has already been configured
|
80
|
+
# # (e.g. via a command-line flag).
|
81
|
+
# config.default_formatter = "doc"
|
82
|
+
# end
|
83
|
+
#
|
84
|
+
# # Print the 10 slowest examples and example groups at the
|
85
|
+
# # end of the spec run, to help surface which specs are running
|
86
|
+
# # particularly slow.
|
87
|
+
# config.profile_examples = 10
|
88
|
+
#
|
89
|
+
# # Run specs in random order to surface order dependencies. If you find an
|
90
|
+
# # order dependency and want to debug it, you can fix the order by providing
|
91
|
+
# # the seed, which is printed after each run.
|
92
|
+
# # --seed 1234
|
93
|
+
# config.order = :random
|
94
|
+
#
|
95
|
+
# # Seed global randomization in this process using the `--seed` CLI option.
|
96
|
+
# # Setting this allows you to use `--seed` to deterministically reproduce
|
97
|
+
# # test failures related to randomization by passing the same `--seed` value
|
98
|
+
# # as the one that triggered the failure.
|
99
|
+
# Kernel.srand config.seed
|
100
|
+
end
|
@@ -10,15 +10,12 @@ module EacCli
|
|
10
10
|
SUBCOMMAND_NAME_ARG = :subcommand
|
11
11
|
SUBCOMMAND_ARGS_ARG = :subcommand_args
|
12
12
|
|
13
|
-
def arg_opt(
|
14
|
-
options_set << ::EacCli::Definition::ArgumentOption.
|
15
|
-
short, long, description, option_options
|
16
|
-
)
|
13
|
+
def arg_opt(*args)
|
14
|
+
options_set << ::EacCli::Definition::ArgumentOption.from_args(args)
|
17
15
|
end
|
18
16
|
|
19
|
-
def bool_opt(
|
20
|
-
options_set << ::EacCli::Definition::BooleanOption.
|
21
|
-
option_options)
|
17
|
+
def bool_opt(*args)
|
18
|
+
options_set << ::EacCli::Definition::BooleanOption.from_args(args)
|
22
19
|
end
|
23
20
|
|
24
21
|
def options
|
@@ -5,23 +5,34 @@ require 'eac_ruby_utils/core_ext'
|
|
5
5
|
module EacCli
|
6
6
|
class Definition
|
7
7
|
class BaseOption
|
8
|
+
require_sub __FILE__
|
9
|
+
|
10
|
+
class << self
|
11
|
+
def from_args(args)
|
12
|
+
p = ::EacCli::Definition::BaseOption::InitializeArgsParser.new(args)
|
13
|
+
new(p.short, p.long, p.description, p.options)
|
14
|
+
end
|
15
|
+
end
|
16
|
+
|
8
17
|
DEFAULT_REQUIRED = false
|
9
18
|
|
10
19
|
enable_listable
|
11
20
|
enable_abstract_methods :build_value, :default_value
|
12
21
|
lists.add_symbol :option, :optional, :usage, :repeat, :required
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
@options = options.symbolize_keys
|
20
|
-
@options.assert_valid_keys(::EacCli::Definition::BaseOption.lists.option.values)
|
22
|
+
common_constructor :short, :long, :description, :options, default: [{}] do
|
23
|
+
raise 'Nor short neither long selector was set' if short.blank? && long.blank?
|
24
|
+
|
25
|
+
self.options = ::EacCli::Definition::BaseOption.lists.option.hash_keys_validate!(
|
26
|
+
options.symbolize_keys
|
27
|
+
)
|
21
28
|
end
|
22
29
|
|
23
30
|
def identifier
|
24
|
-
long.
|
31
|
+
[long, short].each do |v|
|
32
|
+
v.to_s.if_present { |vv| return vv.variableize.to_sym }
|
33
|
+
end
|
34
|
+
|
35
|
+
raise 'No short or long option to build identifier'
|
25
36
|
end
|
26
37
|
|
27
38
|
def repeat?
|