avm-tools 0.93.0 → 0.95.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_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/data.rb +1 -0
- data/lib/avm/eac_webapp_base0/runner/data/dump.rb +1 -1
- data/lib/avm/eac_webapp_base0/runner/data/load.rb +1 -1
- 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/ruby/bundler.rb +11 -0
- data/lib/avm/ruby/bundler/incompatible_parser.rb +25 -0
- data/lib/avm/ruby/bundler/incompatible_parser/depends_on.rb +25 -0
- data/lib/avm/ruby/bundler/incompatible_parser/gem_conflict.rb +39 -0
- data/lib/avm/ruby/bundler/incompatible_parser/in_gemfile.rb +19 -0
- data/lib/avm/ruby/bundler/incompatible_parser/line_buffer.rb +73 -0
- data/lib/avm/ruby/bundler/incompatible_parser/line_factory.rb +31 -0
- data/lib/avm/ruby/bundler/incompatible_parser/line_parser_base.rb +19 -0
- data/lib/avm/ruby/bundler/incompatible_parser/version_requirement.rb +26 -0
- data/lib/avm/ruby/gems/generator.rb +1 -5
- 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 +2 -6
- data/lib/avm/tools/runner/local_project/ruby/bundler.rb +3 -7
- data/lib/avm/tools/runner/local_project/ruby/bundler/gemfile_lock.rb +10 -13
- data/lib/avm/tools/runner/local_project/ruby/bundler/incompatible.rb +84 -0
- data/lib/avm/tools/version.rb +1 -1
- data/template/avm/ruby/gems/generator/static/spec/rubocop_spec.rb +1 -5
- data/template/avm/ruby/gems/generator/static/spec/spec_helper.rb +2 -0
- data/vendor/avm-apps/avm-apps.gemspec +1 -1
- data/vendor/avm-apps/lib/avm/apps/version.rb +1 -1
- data/vendor/avm-apps/spec/rubocop_spec.rb +1 -5
- data/vendor/avm-apps/spec/spec_helper.rb +3 -0
- data/vendor/eac_cli/eac_cli.gemspec +1 -1
- data/vendor/eac_cli/lib/eac_cli/core_ext.rb +2 -0
- data/vendor/eac_cli/lib/eac_cli/definition/base_option.rb +5 -1
- data/vendor/eac_cli/lib/eac_cli/docopt/doc_builder.rb +3 -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/rubocop_spec.rb +1 -5
- data/vendor/eac_cli/spec/spec_helper.rb +3 -0
- data/vendor/eac_docker/eac_docker.gemspec +1 -1
- data/vendor/eac_docker/lib/eac_docker/version.rb +1 -1
- data/vendor/eac_docker/spec/rubocop_spec.rb +1 -5
- data/vendor/eac_docker/spec/spec_helper.rb +3 -0
- data/vendor/eac_git/eac_git.gemspec +2 -1
- 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/rubocop_spec.rb +1 -5
- data/vendor/eac_git/spec/spec_helper.rb +3 -0
- data/vendor/eac_ruby_base0/eac_ruby_base0.gemspec +4 -4
- 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/input.rb +36 -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_base0/spec/rubocop_spec.rb +1 -5
- data/vendor/eac_ruby_base0/spec/spec_helper.rb +3 -0
- data/vendor/eac_ruby_gems_utils/eac_ruby_gems_utils.gemspec +1 -1
- 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_gems_utils/spec/code/rubocop_check_spec.rb +1 -5
- data/vendor/eac_ruby_gems_utils/spec/spec_helper.rb +3 -0
- data/vendor/eac_ruby_utils/eac_ruby_utils.gemspec +2 -1
- data/vendor/eac_ruby_utils/lib/eac_ruby_utils/filesystem_cache.rb +6 -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/regexp/to_parser.rb +10 -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/regexp_parser.rb +34 -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/simple_cache.rb +18 -5
- 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
- data/vendor/eac_ruby_utils/spec/lib/eac_ruby_utils/simple_cache_spec.rb +9 -0
- data/vendor/eac_ruby_utils/spec/rubocop_check_spec.rb +1 -5
- data/vendor/eac_ruby_utils/spec/spec_helper.rb +3 -0
- metadata +55 -15
- data/lib/avm/tools/runner/git/auto_fixup.rb +0 -53
- 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,53 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
require 'eac_cli/core_ext'
|
4
|
-
require 'eac_ruby_utils/console/docopt_runner'
|
5
|
-
require 'avm/git/file_auto_fixup'
|
6
|
-
require 'avm/git/auto_commit/rules'
|
7
|
-
|
8
|
-
module Avm
|
9
|
-
module Tools
|
10
|
-
class Runner
|
11
|
-
class Git
|
12
|
-
class AutoFixup
|
13
|
-
runner_with :help do
|
14
|
-
desc 'Auto fixup files.'
|
15
|
-
arg_opt '-r', '--rule', 'Apply a rule in the specified order.', repeat: true
|
16
|
-
pos_arg :files, repeat: true, optional: true
|
17
|
-
end
|
18
|
-
|
19
|
-
def run
|
20
|
-
files.each do |file|
|
21
|
-
::Avm::Git::FileAutoFixup.new(runner_context.call(:git), file, rules).run
|
22
|
-
end
|
23
|
-
end
|
24
|
-
|
25
|
-
private
|
26
|
-
|
27
|
-
def files
|
28
|
-
files_from_option || dirty_files
|
29
|
-
end
|
30
|
-
|
31
|
-
def files_from_option
|
32
|
-
r = parsed.files
|
33
|
-
r.any? ? r.map { |p| p.to_pathname.expand_path } : nil
|
34
|
-
end
|
35
|
-
|
36
|
-
def dirty_files
|
37
|
-
runner_context.call(:git).dirty_files.map(&:path)
|
38
|
-
end
|
39
|
-
|
40
|
-
def rules
|
41
|
-
parsed.rule.map do |rule_string|
|
42
|
-
::Avm::Git::AutoCommit::Rules.parse(rule_string)
|
43
|
-
end
|
44
|
-
end
|
45
|
-
|
46
|
-
def select
|
47
|
-
parsed.last? ? 1 : parsed.select
|
48
|
-
end
|
49
|
-
end
|
50
|
-
end
|
51
|
-
end
|
52
|
-
end
|
53
|
-
end
|
@@ -1,30 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
require 'eac_cli/runner'
|
4
|
-
require 'eac_ruby_utils/core_ext'
|
5
|
-
require 'eac_ruby_utils/abstract_methods'
|
6
|
-
|
7
|
-
module EacCli
|
8
|
-
module RunnerWith
|
9
|
-
module OutputFile
|
10
|
-
common_concern do
|
11
|
-
include ::EacCli::Runner
|
12
|
-
include ::EacRubyUtils::AbstractMethods
|
13
|
-
|
14
|
-
abstract_methods :output_content
|
15
|
-
|
16
|
-
runner_definition do
|
17
|
-
arg_opt '-o', '--output-file', 'Output to file.'
|
18
|
-
end
|
19
|
-
end
|
20
|
-
|
21
|
-
def run_output
|
22
|
-
if parsed.output_file.present?
|
23
|
-
::File.write(parsed.output_file, output_content)
|
24
|
-
else
|
25
|
-
$stdout.write(output_content)
|
26
|
-
end
|
27
|
-
end
|
28
|
-
end
|
29
|
-
end
|
30
|
-
end
|
@@ -1,53 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
require 'eac_cli/runner_with/output_file'
|
4
|
-
require 'eac_ruby_utils/fs/temp'
|
5
|
-
|
6
|
-
RSpec.describe ::EacCli::RunnerWith::OutputFile 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 root runner.'
|
14
|
-
pos_arg :input_text
|
15
|
-
end
|
16
|
-
|
17
|
-
def run
|
18
|
-
run_output
|
19
|
-
end
|
20
|
-
|
21
|
-
def output_content
|
22
|
-
parsed.input_text
|
23
|
-
end
|
24
|
-
end
|
25
|
-
end
|
26
|
-
|
27
|
-
let(:stub_text) { 'STUB_TEXT' }
|
28
|
-
let(:instance) { runner.create(argv: runner_argv) }
|
29
|
-
|
30
|
-
context 'without --output-file option' do
|
31
|
-
let(:runner_argv) { [stub_text] }
|
32
|
-
|
33
|
-
it do
|
34
|
-
expect { instance.run }.to output(stub_text).to_stdout_from_any_process
|
35
|
-
end
|
36
|
-
end
|
37
|
-
|
38
|
-
context 'with --output-file option' do
|
39
|
-
let(:output_file) { ::EacRubyUtils::Fs::Temp.file }
|
40
|
-
let(:runner_argv) { ['--output-file', output_file.to_path, stub_text] }
|
41
|
-
|
42
|
-
before do
|
43
|
-
instance.run
|
44
|
-
end
|
45
|
-
|
46
|
-
after do
|
47
|
-
output_file.remove
|
48
|
-
end
|
49
|
-
|
50
|
-
it { expect(output_file).to exist }
|
51
|
-
it { expect(output_file.read).to eq(stub_text) }
|
52
|
-
end
|
53
|
-
end
|