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
@@ -7,22 +7,13 @@ require 'eac_ruby_utils/simple_cache'
|
|
7
7
|
module Avm
|
8
8
|
module EacWebappBase0
|
9
9
|
class Runner < ::Avm::Instances::Runner
|
10
|
-
class Data
|
11
|
-
class Load
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
Usage:
|
19
|
-
__PROGRAM__ (<dump-path>|--source-instance=<source-instance>)
|
20
|
-
__PROGRAM__ -h | --help
|
21
|
-
|
22
|
-
Options:
|
23
|
-
-h --help Show this screen.
|
24
|
-
-S --source-instance=<source-instance> Informa a instância a ser extraída o dump.
|
25
|
-
DOCUMENT
|
10
|
+
class Data
|
11
|
+
class Load
|
12
|
+
runner_with :help do
|
13
|
+
desc 'Load utility for EacRailsBase instance.'
|
14
|
+
arg_opt '-S', '--source-instance', 'Informa a instância a ser extraída o dump.'
|
15
|
+
pos_arg :dump_path, optional: true
|
16
|
+
end
|
26
17
|
|
27
18
|
def run
|
28
19
|
return ::Dev::Result.error("Dump \"#{dump_path}\" does not exist") unless
|
@@ -33,16 +24,14 @@ module Avm
|
|
33
24
|
end
|
34
25
|
|
35
26
|
def dump_path_uncached
|
36
|
-
return
|
37
|
-
return source_instance_dump_path if
|
27
|
+
return parsed.dump_path.to_s if parsed.dump_path.present?
|
28
|
+
return source_instance_dump_path if parsed.source_instance.present?
|
38
29
|
|
39
|
-
raise "Dump path unknown (Options: #{
|
30
|
+
raise "Dump path unknown (Options: #{parsed})"
|
40
31
|
end
|
41
32
|
|
42
33
|
def source_instance_dump_path
|
43
|
-
|
44
|
-
options.fetch('--source-instance')
|
45
|
-
).data_dump
|
34
|
+
runner_context.call(:instance).class.by_id(parsed.source_instance).data_dump
|
46
35
|
end
|
47
36
|
|
48
37
|
def load_dump
|
@@ -57,7 +46,7 @@ module Avm
|
|
57
46
|
private
|
58
47
|
|
59
48
|
def package_load_uncached
|
60
|
-
|
49
|
+
runner_context.call(:instance).data_package.load(dump_path)
|
61
50
|
end
|
62
51
|
end
|
63
52
|
end
|
@@ -8,10 +8,11 @@ module Avm
|
|
8
8
|
class CommitInfo
|
9
9
|
enable_immutable
|
10
10
|
|
11
|
-
immutable_accessor :fixup
|
11
|
+
immutable_accessor :fixup, :message
|
12
12
|
|
13
13
|
def git_commit_args
|
14
14
|
r = fixup.if_present([]) { |v| ['--fixup', v.sha1] }
|
15
|
+
r += message.if_present([]) { |v| ['--message', v] }
|
15
16
|
return r if r.any?
|
16
17
|
|
17
18
|
raise 'Argument list is empty'
|
@@ -2,13 +2,13 @@
|
|
2
2
|
|
3
3
|
require 'eac_ruby_utils/core_ext'
|
4
4
|
|
5
|
+
::EacRubyUtils.require_sub __FILE__
|
6
|
+
|
5
7
|
module Avm
|
6
8
|
module Git
|
7
9
|
module AutoCommit
|
8
10
|
module Rules
|
9
|
-
|
10
|
-
|
11
|
-
RULES_CLASSES = %w[last manual nth unique]
|
11
|
+
RULES_CLASSES = %w[last manual new nth unique]
|
12
12
|
.map { |key| ::Avm::Git::AutoCommit::Rules.const_get(key.camelcase) }
|
13
13
|
|
14
14
|
class << self
|
@@ -22,7 +22,7 @@ module Avm
|
|
22
22
|
def rule_class_by_key(key)
|
23
23
|
RULES_CLASSES.find { |klass| klass.keys.include?(key) } ||
|
24
24
|
raise("Rule not find with key \"#{key}\" (Available: " +
|
25
|
-
RULES_CLASSES.flat_map(&:keys) + ')')
|
25
|
+
RULES_CLASSES.flat_map(&:keys).join(', ') + ')')
|
26
26
|
end
|
27
27
|
end
|
28
28
|
end
|
@@ -0,0 +1,24 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'avm/git/auto_commit/rules/base'
|
4
|
+
require 'avm/git/auto_commit_path'
|
5
|
+
|
6
|
+
module Avm
|
7
|
+
module Git
|
8
|
+
module AutoCommit
|
9
|
+
module Rules
|
10
|
+
class New < ::Avm::Git::AutoCommit::Rules::Base
|
11
|
+
class WithFile < ::Avm::Git::AutoCommit::Rules::Base::WithFile
|
12
|
+
def auto_commit_path
|
13
|
+
::Avm::Git::AutoCommitPath.new(file.git, file.path)
|
14
|
+
end
|
15
|
+
|
16
|
+
def commit_info
|
17
|
+
new_commit_info.message(auto_commit_path.commit_message)
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|
21
|
+
end
|
22
|
+
end
|
23
|
+
end
|
24
|
+
end
|
@@ -6,31 +6,10 @@ module Avm
|
|
6
6
|
module Git
|
7
7
|
class AutoCommitPath
|
8
8
|
require_sub __FILE__, include_modules: true
|
9
|
-
enable_console_speaker
|
10
9
|
common_constructor :git, :path do
|
11
10
|
self.path = path.to_pathname
|
12
11
|
end
|
13
12
|
|
14
|
-
CLASS_NAME_PATTERNS = [%r{lib/((?!.*/lib/).+)\.rb\z}, %r{app/[^/]+/(.+)\.rb\z}].freeze
|
15
|
-
|
16
|
-
def run
|
17
|
-
banner
|
18
|
-
commit
|
19
|
-
end
|
20
|
-
|
21
|
-
def banner
|
22
|
-
infom "Checking \"#{relative_path}\""
|
23
|
-
infov ' * Class name', class_name
|
24
|
-
infov ' * Commit message', commit_message
|
25
|
-
end
|
26
|
-
|
27
|
-
def commit
|
28
|
-
infom ' * Commiting...'
|
29
|
-
git.system!('reset', 'HEAD')
|
30
|
-
git.system!('add', '--', relative_path.to_path)
|
31
|
-
git.system!('commit', '-m', commit_message, '--', relative_path.to_path)
|
32
|
-
end
|
33
|
-
|
34
13
|
def class_name
|
35
14
|
ruby_class_name || relative_path.to_path
|
36
15
|
end
|
@@ -10,10 +10,16 @@ module Avm
|
|
10
10
|
enable_simple_cache
|
11
11
|
enable_listable
|
12
12
|
|
13
|
-
common_constructor :git, :path, :rules
|
13
|
+
common_constructor :git, :path, :rules do
|
14
|
+
self.path = path.to_pathname.expand_path(git.root_path)
|
15
|
+
end
|
14
16
|
|
15
17
|
COMMITS_SEARCH_INTERVAL = 'origin/master..HEAD'
|
16
18
|
|
19
|
+
def git_relative_path
|
20
|
+
path.to_pathname.relative_path_from(git.root_path)
|
21
|
+
end
|
22
|
+
|
17
23
|
def run
|
18
24
|
start_banner
|
19
25
|
run_commit || warn("No rule returned commit information for \"#{path}\"")
|
@@ -22,7 +28,7 @@ module Avm
|
|
22
28
|
private
|
23
29
|
|
24
30
|
def commit_args
|
25
|
-
commit_info.if_present([], &:git_commit_args) + ['--',
|
31
|
+
commit_info.if_present([], &:git_commit_args) + ['--', git_relative_path]
|
26
32
|
end
|
27
33
|
|
28
34
|
def commit_info_uncached
|
@@ -38,11 +44,21 @@ module Avm
|
|
38
44
|
return false if commit_info.blank?
|
39
45
|
|
40
46
|
infov ' Commit arguments', ::Shellwords.join(commit_args)
|
41
|
-
|
47
|
+
run_git_add_and_commit
|
42
48
|
success ' Commited'
|
43
49
|
true
|
44
50
|
end
|
45
51
|
|
52
|
+
def run_git_add_and_commit
|
53
|
+
git.execute!('reset', '--soft', 'HEAD')
|
54
|
+
if path.exist?
|
55
|
+
git.execute!('add', git_relative_path)
|
56
|
+
else
|
57
|
+
git.execute!('rm', '-f', git_relative_path)
|
58
|
+
end
|
59
|
+
git.execute!('commit', *commit_args)
|
60
|
+
end
|
61
|
+
|
46
62
|
def commits_uncached
|
47
63
|
git.execute!('log', '--pretty=format:%H', COMMITS_SEARCH_INTERVAL, '--', path)
|
48
64
|
.each_line.map { |sha1| ::Avm::Git::Commit.new(git, sha1.strip) }
|
@@ -1,18 +1,14 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
3
|
require 'avm/eac_redmine_base0/core_update'
|
4
|
-
require 'eac_cli/
|
5
|
-
require 'eac_ruby_utils/console/docopt_runner'
|
6
|
-
require 'eac_ruby_utils/core_ext'
|
4
|
+
require 'eac_cli/core_ext'
|
7
5
|
|
8
6
|
module Avm
|
9
7
|
module Tools
|
10
8
|
class Runner
|
11
9
|
class EacRedmineBase0 < ::Avm::EacRailsBase1::Runner
|
12
|
-
class CoreUpdate
|
13
|
-
|
14
|
-
|
15
|
-
runner_definition do
|
10
|
+
class CoreUpdate
|
11
|
+
runner_with :help do
|
16
12
|
arg_opt '-u', '--url', 'Core\'s package URL.'
|
17
13
|
arg_opt '-v', '--version', 'Core\'s version.'
|
18
14
|
desc 'Update instance\' core.'
|
@@ -32,7 +28,7 @@ module Avm
|
|
32
28
|
end
|
33
29
|
|
34
30
|
def update
|
35
|
-
::Avm::EacRedmineBase0::CoreUpdate.new(
|
31
|
+
::Avm::EacRedmineBase0::CoreUpdate.new(runner_context.call(:instance), version, url).run
|
36
32
|
end
|
37
33
|
|
38
34
|
def url
|
@@ -40,7 +36,7 @@ module Avm
|
|
40
36
|
end
|
41
37
|
|
42
38
|
def url_by_version
|
43
|
-
|
39
|
+
parsed.version.if_present do |v|
|
44
40
|
"https://www.redmine.org/releases/redmine-#{v}.tar.gz"
|
45
41
|
end
|
46
42
|
end
|
@@ -52,11 +48,11 @@ module Avm
|
|
52
48
|
end
|
53
49
|
|
54
50
|
def version
|
55
|
-
|
51
|
+
parsed.version || version_by_url
|
56
52
|
end
|
57
53
|
|
58
54
|
def version_by_url
|
59
|
-
|
55
|
+
parsed.url.if_present do |v|
|
60
56
|
/(\d+.\d+.\d+)/.if_match(v, false) { |m| m[1] }
|
61
57
|
end
|
62
58
|
end
|
@@ -1,8 +1,9 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
require 'avm/git/auto_commit_path'
|
4
|
-
require 'avm/files/formatter'
|
5
3
|
require 'eac_cli/core_ext'
|
4
|
+
require 'avm/files/formatter'
|
5
|
+
require 'avm/git/file_auto_fixup'
|
6
|
+
require 'avm/git/auto_commit/rules'
|
6
7
|
|
7
8
|
module Avm
|
8
9
|
module Tools
|
@@ -10,54 +11,53 @@ module Avm
|
|
10
11
|
class Git
|
11
12
|
class AutoCommit
|
12
13
|
runner_with :help do
|
13
|
-
desc '
|
14
|
+
desc 'Auto fixup files.'
|
14
15
|
bool_opt '-d', '--dirty', 'Select dirty files.'
|
15
16
|
bool_opt '-f', '--format', 'Format files before commit.'
|
16
|
-
|
17
|
+
arg_opt '-r', '--rule', 'Apply a rule in the specified order.', repeat: true
|
18
|
+
pos_arg :files, repeat: true, optional: true
|
17
19
|
end
|
18
20
|
|
19
21
|
def run
|
20
|
-
clear_stage
|
21
|
-
banner
|
22
22
|
format_files
|
23
|
-
|
23
|
+
files.each do |file|
|
24
|
+
::Avm::Git::FileAutoFixup.new(runner_context.call(:git), file, rules).run
|
25
|
+
end
|
24
26
|
end
|
25
27
|
|
26
28
|
private
|
27
29
|
|
28
|
-
def
|
29
|
-
|
30
|
+
def files_uncached
|
31
|
+
(files_from_option + dirty_files).sort.uniq
|
30
32
|
end
|
31
33
|
|
32
|
-
def
|
33
|
-
|
34
|
-
runner_context.call(:git).system!('reset', 'HEAD')
|
35
|
-
end
|
36
|
-
|
37
|
-
def dirty_paths
|
38
|
-
return [] unless parsed.dirty?
|
39
|
-
|
40
|
-
runner_context.call(:git).dirty_files.map do |d|
|
41
|
-
runner_context.call(:git).root_path.join / d.path
|
42
|
-
end
|
34
|
+
def files_from_option
|
35
|
+
parsed.files.map { |p| p.to_pathname.expand_path }
|
43
36
|
end
|
44
37
|
|
45
38
|
def format_files
|
46
39
|
return unless parsed.format?
|
47
40
|
|
48
41
|
infom 'Formating files...'
|
49
|
-
::Avm::Files::Formatter.new(
|
50
|
-
::Avm::Files::Formatter::OPTION_APPLY => true).run
|
42
|
+
::Avm::Files::Formatter.new(files, ::Avm::Files::Formatter::OPTION_APPLY => true).run
|
51
43
|
end
|
52
44
|
|
53
|
-
def
|
54
|
-
|
55
|
-
|
56
|
-
|
45
|
+
def dirty_files
|
46
|
+
return [] unless parsed.dirty?
|
47
|
+
|
48
|
+
runner_context.call(:git).dirty_files.map do |file|
|
49
|
+
file.path.to_pathname.expand_path(runner_context.call(:git).root_path)
|
50
|
+
end
|
51
|
+
end
|
52
|
+
|
53
|
+
def rules
|
54
|
+
parsed.rule.map do |rule_string|
|
55
|
+
::Avm::Git::AutoCommit::Rules.parse(rule_string)
|
56
|
+
end
|
57
57
|
end
|
58
58
|
|
59
|
-
def
|
60
|
-
|
59
|
+
def select
|
60
|
+
parsed.last? ? 1 : parsed.select
|
61
61
|
end
|
62
62
|
end
|
63
63
|
end
|
@@ -30,7 +30,7 @@ module Avm
|
|
30
30
|
local_repos.dirty_files.each do |file|
|
31
31
|
infov ' * Ammending', file.path
|
32
32
|
::Avm::Git::FileAutoFixup.new(runner_context.call(:git), file.path,
|
33
|
-
::Avm::Git::
|
33
|
+
[::Avm::Git::AutoCommit::Rules::Unique.new]).run
|
34
34
|
end
|
35
35
|
end
|
36
36
|
|
@@ -1,19 +1,15 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
3
|
require 'avm/patches/eac_ruby_gems_utils/gem'
|
4
|
-
require 'eac_cli/
|
5
|
-
require 'eac_ruby_utils/console/docopt_runner'
|
6
|
-
require 'eac_ruby_utils/core_ext'
|
4
|
+
require 'eac_cli/core_ext'
|
7
5
|
|
8
6
|
module Avm
|
9
7
|
module Tools
|
10
8
|
class Runner
|
11
9
|
class LocalProject
|
12
|
-
class Ruby
|
10
|
+
class Ruby
|
13
11
|
require_sub __FILE__
|
14
|
-
|
15
|
-
|
16
|
-
runner_definition do
|
12
|
+
runner_with :help, :subcommands do
|
17
13
|
desc 'Ruby utitilies for local projects.'
|
18
14
|
subcommands
|
19
15
|
end
|
@@ -1,19 +1,15 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
require '
|
4
|
-
require 'eac_ruby_utils/console/docopt_runner'
|
5
|
-
require 'eac_ruby_utils/core_ext'
|
3
|
+
require 'eac_ruby_base0/core_ext'
|
6
4
|
|
7
5
|
module Avm
|
8
6
|
module Tools
|
9
7
|
class Runner
|
10
8
|
class LocalProject
|
11
|
-
class Ruby
|
12
|
-
class Bundler
|
9
|
+
class Ruby
|
10
|
+
class Bundler
|
13
11
|
require_sub __FILE__
|
14
|
-
|
15
|
-
|
16
|
-
runner_definition do
|
12
|
+
runner_with :help, :subcommands do
|
17
13
|
desc 'Ruby\'s bundler utitilies for local projects.'
|
18
14
|
subcommands
|
19
15
|
end
|
@@ -1,18 +1,15 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
require '
|
4
|
-
require 'eac_ruby_utils/console/docopt_runner'
|
3
|
+
require 'eac_ruby_base0/core_ext'
|
5
4
|
|
6
5
|
module Avm
|
7
6
|
module Tools
|
8
7
|
class Runner
|
9
8
|
class LocalProject
|
10
|
-
class Ruby
|
11
|
-
class Bundler
|
12
|
-
class GemfileLock
|
13
|
-
|
14
|
-
|
15
|
-
runner_definition do
|
9
|
+
class Ruby
|
10
|
+
class Bundler
|
11
|
+
class GemfileLock
|
12
|
+
runner_with :help do
|
16
13
|
desc 'Manipulage a "Gemfile.lock" file.'
|
17
14
|
bool_opt '-c', '--continue', 'Continue Git rebase/cherry-pick.'
|
18
15
|
bool_opt '-i', '--install', 'Run "bundle install".'
|
@@ -34,7 +31,7 @@ module Avm
|
|
34
31
|
private
|
35
32
|
|
36
33
|
def complete?
|
37
|
-
!option_or_all?(
|
34
|
+
!option_or_all?(:recursive) || !conflict?
|
38
35
|
end
|
39
36
|
|
40
37
|
def rebasing?
|
@@ -51,21 +48,21 @@ module Avm
|
|
51
48
|
end
|
52
49
|
|
53
50
|
def bundle_install
|
54
|
-
return unless check_capability(__method__, :ruby_gem,
|
51
|
+
return unless check_capability(__method__, :ruby_gem, :install)
|
55
52
|
|
56
53
|
infom '"bundle install"...'
|
57
54
|
bundle_run('install')
|
58
55
|
end
|
59
56
|
|
60
57
|
def bundle_update
|
61
|
-
return unless check_capability(__method__, :ruby_gem,
|
58
|
+
return unless check_capability(__method__, :ruby_gem, :update)
|
62
59
|
|
63
60
|
infom '"bundle update"...'
|
64
61
|
bundle_run('update')
|
65
62
|
end
|
66
63
|
|
67
64
|
def git_continue
|
68
|
-
return unless check_capability(__method__, :git_repo,
|
65
|
+
return unless check_capability(__method__, :git_repo, :continue)
|
69
66
|
|
70
67
|
infom "Adding \"#{gemfile_lock}\"..."
|
71
68
|
instance.git_repo.command('add', gemfile_lock).execute!
|
@@ -115,11 +112,11 @@ module Avm
|
|
115
112
|
end
|
116
113
|
|
117
114
|
def option_or_all?(option)
|
118
|
-
|
115
|
+
parsed[option] || parsed.all?
|
119
116
|
end
|
120
117
|
|
121
118
|
def instance
|
122
|
-
|
119
|
+
runner_context.call(:instance)
|
123
120
|
end
|
124
121
|
|
125
122
|
def check_capability(caller, capability, option)
|