eac_tools 0.32.0 → 0.34.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (26) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile.lock +11 -11
  3. data/lib/eac_tools/version.rb +1 -1
  4. data/sub/avm-eac_ruby_base1/avm-eac_ruby_base1.gemspec +2 -2
  5. data/sub/avm-eac_ruby_base1/lib/avm/eac_ruby_base1/sources/runners/bundler/gemfile_local.rb +21 -4
  6. data/sub/avm-eac_ruby_base1/lib/avm/eac_ruby_base1/sources/runners/bundler/gemfile_lock/git.rb +60 -0
  7. data/sub/avm-eac_ruby_base1/lib/avm/eac_ruby_base1/sources/runners/bundler/gemfile_lock.rb +89 -0
  8. data/sub/avm-eac_ruby_base1/lib/avm/eac_ruby_base1/version.rb +1 -1
  9. data/sub/avm-tools/avm-tools.gemspec +3 -3
  10. data/sub/avm-tools/lib/avm/tools/runner/{app_src → source}/info.rb +1 -1
  11. data/sub/avm-tools/lib/avm/tools/runner/{app_src → source}/issue/complete.rb +1 -1
  12. data/sub/avm-tools/lib/avm/tools/runner/{app_src → source}/issue/deliver.rb +1 -1
  13. data/sub/avm-tools/lib/avm/tools/runner/{app_src → source}/issue.rb +1 -1
  14. data/sub/avm-tools/lib/avm/tools/runner/{app_src → source}/subs.rb +1 -1
  15. data/sub/avm-tools/lib/avm/tools/runner/{app_src → source}/test.rb +2 -2
  16. data/sub/avm-tools/lib/avm/tools/runner/{app_src → source}/update.rb +1 -1
  17. data/sub/avm-tools/lib/avm/tools/runner/{app_src → source}/version_bump.rb +1 -1
  18. data/sub/avm-tools/lib/avm/tools/runner/{app_src.rb → source.rb} +3 -3
  19. data/sub/avm-tools/lib/avm/tools/{app_src.rb → source.rb} +1 -1
  20. data/sub/avm-tools/lib/avm/tools/version.rb +1 -1
  21. data/sub/avm-tools/spec/lib/avm/tools/runner/{app_src → source}/issue/complete_spec.rb +2 -2
  22. metadata +19 -27
  23. data/sub/avm-tools/lib/avm/tools/runner/app_src/ruby/bundler/gemfile_lock/git.rb +0 -62
  24. data/sub/avm-tools/lib/avm/tools/runner/app_src/ruby/bundler/gemfile_lock.rb +0 -105
  25. data/sub/avm-tools/lib/avm/tools/runner/app_src/ruby/bundler.rb +0 -21
  26. data/sub/avm-tools/lib/avm/tools/runner/app_src/ruby.rb +0 -19
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 81dc6bdf661e34dc3a4136b707733bea7f9528829dc30e9b918a656c156db423
4
- data.tar.gz: 87651ba1f7ea344fc8d53e29f7360e65a391b4acf0c4f77456104bfbd6a6af43
3
+ metadata.gz: 1a07350e5f6e203f916c6b9ef70f92f59eff8d4c3af4159a086385608d56119b
4
+ data.tar.gz: 03f349d5cee7e0865d05c26fb7e8a2e394f070cc22199bd4b306a81131f955af
5
5
  SHA512:
6
- metadata.gz: 39579d9d45e8a0b0064553aec347e5d0915c8bdf9e14037af7ea5f29c3bb8f4d5622a16405095906db82e0691c1d5ca33a5a3808b5f6acfdb478775961a04003
7
- data.tar.gz: f0b3749dcf1ebc71f2a15bb04a2a2bbbf1785655b9ce7a0cb2331ddd3d44dc9a389247e963595e0899a75fc0bd5505743e5954890ec3df0800638b193873ee78
6
+ metadata.gz: c44c9eedc11252a33e9f23cc07a13bd732b2808fd9d63900fa6a7d3583f15758dc0b561533ceb2f271e628d135e05786398744efce321ac8022219c55458da76
7
+ data.tar.gz: 83a02656f81b1248636ba07fbe6b96ebccbd74f3d4c2a09587e5b2f8561a03832a57ac75d79a6db6fed85edb67462c2b347fed11954258b43ad3b74d543c98ab
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- eac_tools (0.32.0)
4
+ eac_tools (0.34.0)
5
5
  avm (~> 0.45)
6
6
  avm-eac_asciidoctor_base0 (~> 0.7, >= 0.7.1)
7
7
  avm-eac_generic_base0 (~> 0.5)
@@ -10,10 +10,10 @@ PATH
10
10
  avm-eac_rails_base1 (~> 0.7)
11
11
  avm-eac_redmine_base0 (~> 0.16)
12
12
  avm-eac_redmine_plugin_base0 (~> 0.3)
13
- avm-eac_ruby_base1 (~> 0.21)
13
+ avm-eac_ruby_base1 (~> 0.22)
14
14
  avm-eac_webapp_base0 (~> 0.9)
15
15
  avm-eac_wordpress_base0 (~> 0.2, >= 0.2.1)
16
- avm-tools (~> 0.136, >= 0.136.2)
16
+ avm-tools (~> 0.138)
17
17
  eac_ruby_utils (~> 0.104)
18
18
 
19
19
  PATH
@@ -80,10 +80,10 @@ PATH
80
80
  PATH
81
81
  remote: sub/avm-eac_ruby_base1
82
82
  specs:
83
- avm-eac_ruby_base1 (0.21.0)
84
- avm (~> 0.41, >= 0.41.1)
83
+ avm-eac_ruby_base1 (0.22.0)
84
+ avm (~> 0.45)
85
85
  avm-eac_generic_base0 (~> 0.5)
86
- eac_ruby_utils (~> 0.103)
86
+ eac_ruby_utils (~> 0.104)
87
87
 
88
88
  PATH
89
89
  remote: sub/avm-eac_webapp_base0
@@ -116,16 +116,16 @@ PATH
116
116
  PATH
117
117
  remote: sub/avm-tools
118
118
  specs:
119
- avm-tools (0.136.2)
119
+ avm-tools (0.138.0)
120
120
  aranha-parsers (~> 0.14, >= 0.14.3)
121
- avm (~> 0.44)
122
- avm-eac_ruby_base1 (~> 0.21)
121
+ avm (~> 0.45)
122
+ avm-eac_ruby_base1 (~> 0.22)
123
123
  avm-eac_ubuntu_base0 (~> 0.3)
124
124
  avm-files (~> 0.4, >= 0.4.1)
125
125
  avm-git (~> 0.4)
126
126
  clipboard (~> 1.3, >= 1.3.6)
127
127
  curb (~> 0.9, >= 0.9.11)
128
- eac_git (~> 0.12, >= 0.12.2)
128
+ eac_git (~> 0.12, >= 0.12.3)
129
129
  eac_ruby_base0 (~> 0.17)
130
130
  eac_templates (~> 0.3, >= 0.3.2)
131
131
  git (~> 1.12)
@@ -342,7 +342,7 @@ GEM
342
342
  tzinfo (2.0.5)
343
343
  concurrent-ruby (~> 1.0)
344
344
  unicode-display_width (1.6.1)
345
- zeitwerk (2.6.0)
345
+ zeitwerk (2.6.1)
346
346
  zlib (2.1.1)
347
347
 
348
348
  PLATFORMS
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module EacTools
4
- VERSION = '0.32.0'
4
+ VERSION = '0.34.0'
5
5
  end
@@ -12,9 +12,9 @@ Gem::Specification.new do |s|
12
12
 
13
13
  s.files = Dir['{lib,locale,template}/**/*']
14
14
 
15
- s.add_dependency 'avm', '~> 0.41', '>= 0.41.1'
15
+ s.add_dependency 'avm', '~> 0.45'
16
16
  s.add_dependency 'avm-eac_generic_base0', '~> 0.5'
17
- s.add_dependency 'eac_ruby_utils', '~> 0.103'
17
+ s.add_dependency 'eac_ruby_utils', '~> 0.104'
18
18
 
19
19
  s.add_development_dependency 'aranha-parsers', '~> 0.14', '>= 0.14.1'
20
20
  s.add_development_dependency 'eac_ruby_gem_support', '~> 0.5.1'
@@ -29,17 +29,34 @@ module Avm
29
29
  siblings.map { |s| sibling_gemfile_local_line(s) }.join
30
30
  end
31
31
 
32
+ def on_unexisting_gemfile_local
33
+ return yield unless gemfile_local_path.exist?
34
+
35
+ ::EacRubyUtils::Fs::Temp.on_file do |temp_file|
36
+ ::FileUtils.cp(gemfile_local_path, temp_file)
37
+ begin
38
+ ::FileUtils.rm_f(gemfile_local_path)
39
+ yield
40
+ ensure
41
+ ::FileUtils.cp(temp_file, gemfile_local_path)
42
+ end
43
+ end
44
+ end
45
+
32
46
  def run_bundle
33
- the_source.bundle.execute!
34
- rescue ::RuntimeError
35
- the_source.bundle('update').execute!
47
+ on_unexisting_gemfile_local do
48
+ the_source.bundle.execute!
49
+ rescue ::RuntimeError
50
+ the_source.bundle('update').execute!
51
+ end
36
52
  end
37
53
 
38
54
  def sibling_gemfile_local_line(sibling)
39
55
  ["gem '#{sibling.gem_name}'",
40
56
  "path: ::File.expand_path('" +
41
57
  sibling.path.relative_path_from(the_source.path).to_path +
42
- "', __dir__)"].join(', ') + "\n"
58
+ "', __dir__)",
59
+ 'require: false'].join(', ') + "\n"
43
60
  end
44
61
 
45
62
  def start_banner
@@ -0,0 +1,60 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'eac_ruby_utils/core_ext'
4
+
5
+ module Avm
6
+ module EacRubyBase1
7
+ module Sources
8
+ module Runners
9
+ class Bundler
10
+ class GemfileLock
11
+ module Git
12
+ private
13
+
14
+ def git_continue
15
+ infom "Adding \"#{gemfile_lock}\"..."
16
+ git_repo.command('add', gemfile_lock).execute!
17
+ if rebase_conflict?
18
+ git_continue_run('rebase')
19
+ elsif cherry_conflict?
20
+ git_continue_run('cherry-pick')
21
+ else
22
+ raise 'Unknown how to continue'
23
+ end
24
+ end
25
+
26
+ def git_continue_run(command)
27
+ infom "\"#{command}\" --continue..."
28
+ cmd = git_repo.command(command, '--continue')
29
+ .envvar('GIT_EDITOR', 'true')
30
+ return unless !cmd.system && !conflict?
31
+
32
+ fatal_error "\"#{cmd}\" failed and there is no conflict"
33
+ end
34
+
35
+ def git_repo
36
+ instance.scm.git_repo
37
+ end
38
+
39
+ def git_reset_checkout
40
+ git_reset_gemfile_lock
41
+ git_checkout_gemfile_lock
42
+ end
43
+
44
+ def git_checkout_gemfile_lock
45
+ infom 'Checkouting...'
46
+ git_repo.command('checkout', '--', gemfile_lock).system!
47
+ end
48
+
49
+ def git_reset_gemfile_lock
50
+ infom 'Reseting...'
51
+ git_repo.command('reset', gemfile_lock).system! if
52
+ ::File.exist?(gemfile_lock)
53
+ end
54
+ end
55
+ end
56
+ end
57
+ end
58
+ end
59
+ end
60
+ end
@@ -0,0 +1,89 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'eac_cli/core_ext'
4
+
5
+ module Avm
6
+ module EacRubyBase1
7
+ module Sources
8
+ module Runners
9
+ class Bundler
10
+ class GemfileLock
11
+ require_sub __FILE__, include_modules: true
12
+ runner_with :help do
13
+ desc 'Manipulage a "Gemfile.lock" file.'
14
+ bool_opt '-c', '--continue', 'Continue Git rebase/cherry-pick.'
15
+ bool_opt '-i', '--install', 'Run "bundle install".'
16
+ bool_opt '-u', '--update', 'Run "bundle update".'
17
+ bool_opt '-r', '--recursive', 'Run until Git rebase/cherry-pick is finished.'
18
+ bool_opt '-a', '--all', 'Same as "-cirud".'
19
+ bool_opt '-d', '--delete', 'Delete Gemfile.lock'
20
+ end
21
+
22
+ def run
23
+ loop do
24
+ git_reset_checkout
25
+ delete_gemfile_lock
26
+ bundle_update
27
+ bundle_install
28
+ git_continue
29
+ break if complete?
30
+ end
31
+ end
32
+
33
+ private
34
+
35
+ def complete?
36
+ !option_or_all?(:recursive) || !conflict?
37
+ end
38
+
39
+ def delete_gemfile_lock
40
+ ::FileUtils.rm_f(gemfile_lock)
41
+ end
42
+
43
+ def rebasing?
44
+ git_repo.root_path.join('.git', 'rebase-merge').exist?
45
+ end
46
+
47
+ def bundle_install
48
+ infom '"bundle install"...'
49
+ bundle_run('install')
50
+ end
51
+
52
+ def bundle_update
53
+ infom '"bundle update"...'
54
+ bundle_run('update')
55
+ end
56
+
57
+ def gemfile_lock
58
+ 'Gemfile.lock'
59
+ end
60
+
61
+ def bundle_run(*args)
62
+ instance.bundle(*args).system!
63
+ end
64
+
65
+ def conflict?
66
+ rebase_conflict? || cherry_conflict?
67
+ end
68
+
69
+ def rebase_conflict?
70
+ git_repo.root_path.join('.git', 'REBASE_HEAD').exist?
71
+ end
72
+
73
+ def cherry_conflict?
74
+ git_repo.root_path.join('.git', 'CHERRY_PICK_HEAD').exist?
75
+ end
76
+
77
+ def option_or_all?(option)
78
+ parsed[option] || parsed.all?
79
+ end
80
+
81
+ def instance
82
+ runner_context.call(:subject)
83
+ end
84
+ end
85
+ end
86
+ end
87
+ end
88
+ end
89
+ end
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Avm
4
4
  module EacRubyBase1
5
- VERSION = '0.21.0'
5
+ VERSION = '0.22.0'
6
6
  end
7
7
  end
@@ -15,14 +15,14 @@ Gem::Specification.new do |s|
15
15
  s.executables = s.files.grep(%r{^exe/}) { |f| File.basename(f) }
16
16
 
17
17
  s.add_dependency 'aranha-parsers', '~> 0.14', '>= 0.14.3'
18
- s.add_dependency 'avm', '~> 0.44'
19
- s.add_dependency 'avm-eac_ruby_base1', '~> 0.21'
18
+ s.add_dependency 'avm', '~> 0.45'
19
+ s.add_dependency 'avm-eac_ruby_base1', '~> 0.22'
20
20
  s.add_dependency 'avm-eac_ubuntu_base0', '~> 0.3'
21
21
  s.add_dependency 'avm-files', '~> 0.4', '>= 0.4.1'
22
22
  s.add_dependency 'avm-git', '~> 0.4'
23
23
  s.add_dependency 'clipboard', '~> 1.3', '>= 1.3.6'
24
24
  s.add_dependency 'curb', '~> 0.9', '>= 0.9.11'
25
- s.add_dependency 'eac_git', '~> 0.12', '>= 0.12.2'
25
+ s.add_dependency 'eac_git', '~> 0.12', '>= 0.12.3'
26
26
  s.add_dependency 'eac_ruby_base0', '~> 0.17'
27
27
  s.add_dependency 'eac_templates', '~> 0.3', '>= 0.3.2'
28
28
  s.add_dependency 'git', '~> 1.12'
@@ -5,7 +5,7 @@ require 'avm/tools/core_ext'
5
5
  module Avm
6
6
  module Tools
7
7
  class Runner
8
- class AppSrc
8
+ class Source < ::Avm::Sources::Runner
9
9
  class Info
10
10
  SOURCE_PROPERTIES = {
11
11
  path: 'Path',
@@ -6,7 +6,7 @@ require 'avm/git/issue/complete'
6
6
  module Avm
7
7
  module Tools
8
8
  class Runner
9
- class AppSrc
9
+ class Source < ::Avm::Sources::Runner
10
10
  class Issue
11
11
  class Complete
12
12
  runner_with :confirmation, :help do
@@ -6,7 +6,7 @@ require 'avm/git/issue/deliver'
6
6
  module Avm
7
7
  module Tools
8
8
  class Runner
9
- class AppSrc
9
+ class Source < ::Avm::Sources::Runner
10
10
  class Issue
11
11
  class Deliver
12
12
  runner_with :confirmation, :help do
@@ -5,7 +5,7 @@ require 'avm/tools/core_ext'
5
5
  module Avm
6
6
  module Tools
7
7
  class Runner
8
- class AppSrc
8
+ class Source < ::Avm::Sources::Runner
9
9
  class Issue
10
10
  require_sub __FILE__
11
11
  runner_with :help, :subcommands do
@@ -5,7 +5,7 @@ require 'avm/tools/core_ext'
5
5
  module Avm
6
6
  module Tools
7
7
  class Runner
8
- class AppSrc
8
+ class Source < ::Avm::Sources::Runner
9
9
  class Subs
10
10
  PADDING = ' '
11
11
 
@@ -6,7 +6,7 @@ require 'avm/sources/tests/builder'
6
6
  module Avm
7
7
  module Tools
8
8
  class Runner
9
- class AppSrc
9
+ class Source < ::Avm::Sources::Runner
10
10
  class Test
11
11
  runner_with :help do
12
12
  desc 'Test local project.'
@@ -83,7 +83,7 @@ module Avm
83
83
  def unit_result(unit)
84
84
  (
85
85
  [unit.result.to_label] +
86
- %i[stdout stderr].map { |label| "#{label.to_s.upcase}: #{unit.logs[label]}" }
86
+ %i[stdout stderr].map { |label| "#{label.to_s.upcase}: #{unit.logs[label]}" }
87
87
  ).join(' | '.blue)
88
88
  end
89
89
  end
@@ -5,7 +5,7 @@ require 'avm/tools/core_ext'
5
5
  module Avm
6
6
  module Tools
7
7
  class Runner
8
- class AppSrc
8
+ class Source < ::Avm::Sources::Runner
9
9
  class Update
10
10
  runner_with :help do
11
11
  desc 'Update local project.'
@@ -6,7 +6,7 @@ require 'eac_cli/core_ext'
6
6
  module Avm
7
7
  module Tools
8
8
  class Runner
9
- class AppSrc
9
+ class Source < ::Avm::Sources::Runner
10
10
  class VersionBump
11
11
  runner_with :help, :confirmation do
12
12
  desc 'Bump version of a local project.'
@@ -1,13 +1,13 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  require 'avm/sources/runner'
4
- require 'avm/tools/app_src'
4
+ require 'avm/tools/source'
5
5
  require 'eac_cli/core_ext'
6
6
 
7
7
  module Avm
8
8
  module Tools
9
9
  class Runner
10
- class AppSrc < ::Avm::Sources::Runner
10
+ class Source < ::Avm::Sources::Runner
11
11
  require_sub __FILE__
12
12
 
13
13
  def instance_banner
@@ -22,7 +22,7 @@ module Avm
22
22
  private
23
23
 
24
24
  def instance_uncached
25
- ::Avm::Tools::AppSrc.new(source_path)
25
+ ::Avm::Tools::Source.new(source_path)
26
26
  end
27
27
  end
28
28
  end
@@ -10,7 +10,7 @@ require 'i18n'
10
10
 
11
11
  module Avm
12
12
  module Tools
13
- class AppSrc
13
+ class Source
14
14
  enable_simple_cache
15
15
  common_constructor :path do
16
16
  self.path = path.to_pathname
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Avm
4
4
  module Tools
5
- VERSION = '0.136.2'
5
+ VERSION = '0.138.0'
6
6
  end
7
7
  end
@@ -5,7 +5,7 @@ require 'avm/tools/runner'
5
5
  require 'tmpdir'
6
6
  require 'fileutils'
7
7
 
8
- ::RSpec.describe ::Avm::Tools::Runner::AppSrc::Issue::Complete, git: true do
8
+ ::RSpec.describe ::Avm::Tools::Runner::Source::Issue::Complete, git: true do
9
9
  let(:remote_name) { 'origin' }
10
10
  let(:issue_ref) { 'issue_123' }
11
11
  let(:remote_repos) { stubbed_git_local_repo(true) }
@@ -32,7 +32,7 @@ require 'fileutils'
32
32
 
33
33
  context 'when "git issue complete" is called' do
34
34
  before do
35
- ::Avm::Tools::Runner.run(argv: ['app-src', '-C', eac_local_repos] +
35
+ ::Avm::Tools::Runner.run(argv: ['source', '-C', eac_local_repos] +
36
36
  %w[issue complete --yes])
37
37
  end
38
38
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: eac_tools
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.32.0
4
+ version: 0.34.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Put here the authors
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-09-25 00:00:00.000000000 Z
11
+ date: 2022-10-02 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: avm
@@ -146,14 +146,14 @@ dependencies:
146
146
  requirements:
147
147
  - - "~>"
148
148
  - !ruby/object:Gem::Version
149
- version: '0.21'
149
+ version: '0.22'
150
150
  type: :runtime
151
151
  prerelease: false
152
152
  version_requirements: !ruby/object:Gem::Requirement
153
153
  requirements:
154
154
  - - "~>"
155
155
  - !ruby/object:Gem::Version
156
- version: '0.21'
156
+ version: '0.22'
157
157
  - !ruby/object:Gem::Dependency
158
158
  name: avm-eac_webapp_base0
159
159
  requirement: !ruby/object:Gem::Requirement
@@ -194,20 +194,14 @@ dependencies:
194
194
  requirements:
195
195
  - - "~>"
196
196
  - !ruby/object:Gem::Version
197
- version: '0.136'
198
- - - ">="
199
- - !ruby/object:Gem::Version
200
- version: 0.136.2
197
+ version: '0.138'
201
198
  type: :runtime
202
199
  prerelease: false
203
200
  version_requirements: !ruby/object:Gem::Requirement
204
201
  requirements:
205
202
  - - "~>"
206
203
  - !ruby/object:Gem::Version
207
- version: '0.136'
208
- - - ">="
209
- - !ruby/object:Gem::Version
210
- version: 0.136.2
204
+ version: '0.138'
211
205
  - !ruby/object:Gem::Dependency
212
206
  name: eac_ruby_utils
213
207
  requirement: !ruby/object:Gem::Requirement
@@ -481,6 +475,8 @@ files:
481
475
  - sub/avm-eac_ruby_base1/lib/avm/eac_ruby_base1/sources/runners.rb
482
476
  - sub/avm-eac_ruby_base1/lib/avm/eac_ruby_base1/sources/runners/bundler.rb
483
477
  - sub/avm-eac_ruby_base1/lib/avm/eac_ruby_base1/sources/runners/bundler/gemfile_local.rb
478
+ - sub/avm-eac_ruby_base1/lib/avm/eac_ruby_base1/sources/runners/bundler/gemfile_lock.rb
479
+ - sub/avm-eac_ruby_base1/lib/avm/eac_ruby_base1/sources/runners/bundler/gemfile_lock/git.rb
484
480
  - sub/avm-eac_ruby_base1/lib/avm/eac_ruby_base1/sources/runners/bundler/incompatible.rb
485
481
  - sub/avm-eac_ruby_base1/lib/avm/eac_ruby_base1/sources/runners/update_dependencies_requirements.rb
486
482
  - sub/avm-eac_ruby_base1/lib/avm/eac_ruby_base1/sources/tests.rb
@@ -683,22 +679,8 @@ files:
683
679
  - sub/avm-tools/lib/avm/projects/stereotypes/ruby_gem/publish.rb
684
680
  - sub/avm-tools/lib/avm/stereotypes.rb
685
681
  - sub/avm-tools/lib/avm/tools.rb
686
- - sub/avm-tools/lib/avm/tools/app_src.rb
687
682
  - sub/avm-tools/lib/avm/tools/core_ext.rb
688
683
  - sub/avm-tools/lib/avm/tools/runner.rb
689
- - sub/avm-tools/lib/avm/tools/runner/app_src.rb
690
- - sub/avm-tools/lib/avm/tools/runner/app_src/info.rb
691
- - sub/avm-tools/lib/avm/tools/runner/app_src/issue.rb
692
- - sub/avm-tools/lib/avm/tools/runner/app_src/issue/complete.rb
693
- - sub/avm-tools/lib/avm/tools/runner/app_src/issue/deliver.rb
694
- - sub/avm-tools/lib/avm/tools/runner/app_src/ruby.rb
695
- - sub/avm-tools/lib/avm/tools/runner/app_src/ruby/bundler.rb
696
- - sub/avm-tools/lib/avm/tools/runner/app_src/ruby/bundler/gemfile_lock.rb
697
- - sub/avm-tools/lib/avm/tools/runner/app_src/ruby/bundler/gemfile_lock/git.rb
698
- - sub/avm-tools/lib/avm/tools/runner/app_src/subs.rb
699
- - sub/avm-tools/lib/avm/tools/runner/app_src/test.rb
700
- - sub/avm-tools/lib/avm/tools/runner/app_src/update.rb
701
- - sub/avm-tools/lib/avm/tools/runner/app_src/version_bump.rb
702
684
  - sub/avm-tools/lib/avm/tools/runner/application_stereotypes.rb
703
685
  - sub/avm-tools/lib/avm/tools/runner/application_stereotypes/list.rb
704
686
  - sub/avm-tools/lib/avm/tools/runner/config.rb
@@ -726,8 +708,18 @@ files:
726
708
  - sub/avm-tools/lib/avm/tools/runner/self.rb
727
709
  - sub/avm-tools/lib/avm/tools/runner/self/docker.rb
728
710
  - sub/avm-tools/lib/avm/tools/runner/self/registry.rb
711
+ - sub/avm-tools/lib/avm/tools/runner/source.rb
712
+ - sub/avm-tools/lib/avm/tools/runner/source/info.rb
713
+ - sub/avm-tools/lib/avm/tools/runner/source/issue.rb
714
+ - sub/avm-tools/lib/avm/tools/runner/source/issue/complete.rb
715
+ - sub/avm-tools/lib/avm/tools/runner/source/issue/deliver.rb
716
+ - sub/avm-tools/lib/avm/tools/runner/source/subs.rb
717
+ - sub/avm-tools/lib/avm/tools/runner/source/test.rb
718
+ - sub/avm-tools/lib/avm/tools/runner/source/update.rb
719
+ - sub/avm-tools/lib/avm/tools/runner/source/version_bump.rb
729
720
  - sub/avm-tools/lib/avm/tools/runner/source_generate.rb
730
721
  - sub/avm-tools/lib/avm/tools/self.rb
722
+ - sub/avm-tools/lib/avm/tools/source.rb
731
723
  - sub/avm-tools/lib/avm/tools/version.rb
732
724
  - sub/avm-tools/locale/en.yml
733
725
  - sub/avm-tools/locale/pt-BR.yml
@@ -750,7 +742,6 @@ files:
750
742
  - sub/avm-tools/spec/lib/avm/projects/stereotypes/git_subrepo/warp_spec_settings.yml
751
743
  - sub/avm-tools/spec/lib/avm/projects/stereotypes/ruby_gem/publish_spec.rb
752
744
  - sub/avm-tools/spec/lib/avm/projects/stereotypes/ruby_gem_spec.rb
753
- - sub/avm-tools/spec/lib/avm/tools/runner/app_src/issue/complete_spec.rb
754
745
  - sub/avm-tools/spec/lib/avm/tools/runner/files/format_spec.rb
755
746
  - sub/avm-tools/spec/lib/avm/tools/runner/files/format_spec_files/Gemfile.source
756
747
  - sub/avm-tools/spec/lib/avm/tools/runner/files/format_spec_files/Gemfile.target
@@ -782,6 +773,7 @@ files:
782
773
  - sub/avm-tools/spec/lib/avm/tools/runner/git/deploy_spec.rb
783
774
  - sub/avm-tools/spec/lib/avm/tools/runner/git/deploy_spec_files/append1/stub3.txt.template
784
775
  - sub/avm-tools/spec/lib/avm/tools/runner/git/deploy_spec_files/append2/stub4.txt
776
+ - sub/avm-tools/spec/lib/avm/tools/runner/source/issue/complete_spec.rb
785
777
  - sub/avm-tools/spec/lib/avm/tools/runner_spec.rb
786
778
  - sub/avm-tools/spec/rubocop_spec.rb
787
779
  - sub/avm-tools/spec/spec_helper.rb
@@ -1,62 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- require 'eac_ruby_base0/core_ext'
4
-
5
- module Avm
6
- module Tools
7
- class Runner
8
- class AppSrc
9
- class Ruby
10
- class Bundler
11
- class GemfileLock
12
- module Git
13
- private
14
-
15
- def git_continue
16
- return unless check_capability(__method__, :git_repo, :continue)
17
-
18
- infom "Adding \"#{gemfile_lock}\"..."
19
- instance.git_repo.command('add', gemfile_lock).execute!
20
- if rebase_conflict?
21
- git_continue_run('rebase')
22
- elsif cherry_conflict?
23
- git_continue_run('cherry-pick')
24
- else
25
- raise 'Unknown how to continue'
26
- end
27
- end
28
-
29
- def git_continue_run(command)
30
- infom "\"#{command}\" --continue..."
31
- cmd = instance.git_repo.command(command, '--continue')
32
- .envvar('GIT_EDITOR', 'true')
33
- return unless !cmd.system && !conflict?
34
-
35
- fatal_error "\"#{cmd}\" failed and there is no conflict"
36
- end
37
-
38
- def git_reset_checkout
39
- return unless check_capability(__method__, :git_repo, nil)
40
-
41
- git_reset_gemfile_lock
42
- git_checkout_gemfile_lock
43
- end
44
-
45
- def git_checkout_gemfile_lock
46
- infom 'Checkouting...'
47
- instance.git_repo.command('checkout', '--', gemfile_lock).system!
48
- end
49
-
50
- def git_reset_gemfile_lock
51
- infom 'Reseting...'
52
- instance.git_repo.command('reset', gemfile_lock).system! if
53
- ::File.exist?(gemfile_lock)
54
- end
55
- end
56
- end
57
- end
58
- end
59
- end
60
- end
61
- end
62
- end
@@ -1,105 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- require 'eac_ruby_base0/core_ext'
4
-
5
- module Avm
6
- module Tools
7
- class Runner
8
- class AppSrc
9
- class Ruby
10
- class Bundler
11
- class GemfileLock
12
- require_sub __FILE__, include_modules: true
13
- runner_with :help do
14
- desc 'Manipulage a "Gemfile.lock" file.'
15
- bool_opt '-c', '--continue', 'Continue Git rebase/cherry-pick.'
16
- bool_opt '-i', '--install', 'Run "bundle install".'
17
- bool_opt '-u', '--update', 'Run "bundle update".'
18
- bool_opt '-r', '--recursive', 'Run until Git rebase/cherry-pick is finished.'
19
- bool_opt '-a', '--all', 'Same as "-cirud".'
20
- bool_opt '-d', '--delete', 'Delete Gemfile.lock'
21
- end
22
-
23
- def run
24
- loop do
25
- git_reset_checkout
26
- delete_gemfile_lock
27
- bundle_update
28
- bundle_install
29
- git_continue
30
- break if complete?
31
- end
32
- end
33
-
34
- private
35
-
36
- def complete?
37
- !option_or_all?(:recursive) || !conflict?
38
- end
39
-
40
- def delete_gemfile_lock
41
- return unless check_capability(__method__, nil, :delete)
42
-
43
- ::FileUtils.rm_f(gemfile_lock)
44
- end
45
-
46
- def rebasing?
47
- instance.git_repo.root_path.join('.git', 'rebase-merge').exist?
48
- end
49
-
50
- def bundle_install
51
- return unless check_capability(__method__, :ruby_gem, :install)
52
-
53
- infom '"bundle install"...'
54
- bundle_run('install')
55
- end
56
-
57
- def bundle_update
58
- return unless check_capability(__method__, :ruby_gem, :update)
59
-
60
- infom '"bundle update"...'
61
- bundle_run('update')
62
- end
63
-
64
- def gemfile_lock
65
- 'Gemfile.lock'
66
- end
67
-
68
- def bundle_run(*args)
69
- instance.ruby_gem.bundle(*args).system!
70
- end
71
-
72
- def conflict?
73
- rebase_conflict? || cherry_conflict?
74
- end
75
-
76
- def rebase_conflict?
77
- instance.git_repo.root_path.join('.git', 'REBASE_HEAD').exist?
78
- end
79
-
80
- def cherry_conflict?
81
- instance.git_repo.root_path.join('.git', 'CHERRY_PICK_HEAD').exist?
82
- end
83
-
84
- def option_or_all?(option)
85
- parsed[option] || parsed.all?
86
- end
87
-
88
- def instance
89
- runner_context.call(:instance)
90
- end
91
-
92
- def check_capability(caller, capability, option)
93
- return false unless option.blank? || option_or_all?(option)
94
- return true if capability.if_present(true) { |v| instance.respond_to?(v) }
95
-
96
- warn "Cannot run #{caller}: instance has no capability \"#{capability}\""
97
- false
98
- end
99
- end
100
- end
101
- end
102
- end
103
- end
104
- end
105
- end
@@ -1,21 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- require 'eac_ruby_base0/core_ext'
4
-
5
- module Avm
6
- module Tools
7
- class Runner
8
- class AppSrc
9
- class Ruby
10
- class Bundler
11
- require_sub __FILE__
12
- runner_with :help, :subcommands do
13
- desc 'Ruby\'s bundler utitilies for local projects.'
14
- subcommands
15
- end
16
- end
17
- end
18
- end
19
- end
20
- end
21
- end
@@ -1,19 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- require 'eac_cli/core_ext'
4
-
5
- module Avm
6
- module Tools
7
- class Runner
8
- class AppSrc
9
- class Ruby
10
- require_sub __FILE__
11
- runner_with :help, :subcommands do
12
- desc 'Ruby utitilies for local projects.'
13
- subcommands
14
- end
15
- end
16
- end
17
- end
18
- end
19
- end