avm-tools 0.136.2 → 0.138.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 0a16025cdb4bf25acd67dc6129fd68ce1fdeeafc2b983c5251d98bd7768189cb
4
- data.tar.gz: 27290fc522bfb67f5635fc1d946e73d28c0c3be073c29401724f15dcce114f65
3
+ metadata.gz: e7bf83b886d7158f37723c559d52eab9c7212390f673937cd81fa75209b7f6ff
4
+ data.tar.gz: 88797a72e234d4fa2900365cf3793fd7f2ea91ae9f8f804e8d624bc2946c3f17
5
5
  SHA512:
6
- metadata.gz: d1c3f2b1a5633e78d96793be7b29af113fd25a03a3931a9d849b41d83c4a25a3a8850265c4807cc202384b0fa7aa9627f11b3d162e58fc739c450cb3cd339323
7
- data.tar.gz: 28a42aabc9c7421010c20e2cb732b8942c306a98e88d659a57221990a3a2e8732cf2a171a3278653a2abe0faa33c056aaaf7cc2f253c8c59ab579dac9b3b9df8
6
+ metadata.gz: 3ea44e51d1adf4b4607f08f12437c6cda8bb26a180ff1b3be138cf492e4b025e0364be3e6a70bcc35704c9755a087636e111f7ffb187ebfed1654e0943489aa7
7
+ data.tar.gz: 504f1b7e9c8e8019452078ba76abc89a13daee3969a8e25cb4a4a671e26c297a4efd8bf3ba34b383efde402217644c1779552ff9eef03b32892b4e0f6ab30ca8
@@ -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
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.136.2
4
+ version: 0.138.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: 2022-09-22 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: aranha-parsers
@@ -36,28 +36,28 @@ dependencies:
36
36
  requirements:
37
37
  - - "~>"
38
38
  - !ruby/object:Gem::Version
39
- version: '0.44'
39
+ version: '0.45'
40
40
  type: :runtime
41
41
  prerelease: false
42
42
  version_requirements: !ruby/object:Gem::Requirement
43
43
  requirements:
44
44
  - - "~>"
45
45
  - !ruby/object:Gem::Version
46
- version: '0.44'
46
+ version: '0.45'
47
47
  - !ruby/object:Gem::Dependency
48
48
  name: avm-eac_ruby_base1
49
49
  requirement: !ruby/object:Gem::Requirement
50
50
  requirements:
51
51
  - - "~>"
52
52
  - !ruby/object:Gem::Version
53
- version: '0.21'
53
+ version: '0.22'
54
54
  type: :runtime
55
55
  prerelease: false
56
56
  version_requirements: !ruby/object:Gem::Requirement
57
57
  requirements:
58
58
  - - "~>"
59
59
  - !ruby/object:Gem::Version
60
- version: '0.21'
60
+ version: '0.22'
61
61
  - !ruby/object:Gem::Dependency
62
62
  name: avm-eac_ubuntu_base0
63
63
  requirement: !ruby/object:Gem::Requirement
@@ -155,7 +155,7 @@ dependencies:
155
155
  version: '0.12'
156
156
  - - ">="
157
157
  - !ruby/object:Gem::Version
158
- version: 0.12.2
158
+ version: 0.12.3
159
159
  type: :runtime
160
160
  prerelease: false
161
161
  version_requirements: !ruby/object:Gem::Requirement
@@ -165,7 +165,7 @@ dependencies:
165
165
  version: '0.12'
166
166
  - - ">="
167
167
  - !ruby/object:Gem::Version
168
- version: 0.12.2
168
+ version: 0.12.3
169
169
  - !ruby/object:Gem::Dependency
170
170
  name: eac_ruby_base0
171
171
  requirement: !ruby/object:Gem::Requirement
@@ -313,22 +313,8 @@ files:
313
313
  - lib/avm/projects/stereotypes/ruby_gem/publish.rb
314
314
  - lib/avm/stereotypes.rb
315
315
  - lib/avm/tools.rb
316
- - lib/avm/tools/app_src.rb
317
316
  - lib/avm/tools/core_ext.rb
318
317
  - lib/avm/tools/runner.rb
319
- - lib/avm/tools/runner/app_src.rb
320
- - lib/avm/tools/runner/app_src/info.rb
321
- - lib/avm/tools/runner/app_src/issue.rb
322
- - lib/avm/tools/runner/app_src/issue/complete.rb
323
- - lib/avm/tools/runner/app_src/issue/deliver.rb
324
- - lib/avm/tools/runner/app_src/ruby.rb
325
- - lib/avm/tools/runner/app_src/ruby/bundler.rb
326
- - lib/avm/tools/runner/app_src/ruby/bundler/gemfile_lock.rb
327
- - lib/avm/tools/runner/app_src/ruby/bundler/gemfile_lock/git.rb
328
- - lib/avm/tools/runner/app_src/subs.rb
329
- - lib/avm/tools/runner/app_src/test.rb
330
- - lib/avm/tools/runner/app_src/update.rb
331
- - lib/avm/tools/runner/app_src/version_bump.rb
332
318
  - lib/avm/tools/runner/application_stereotypes.rb
333
319
  - lib/avm/tools/runner/application_stereotypes/list.rb
334
320
  - lib/avm/tools/runner/config.rb
@@ -356,8 +342,18 @@ files:
356
342
  - lib/avm/tools/runner/self.rb
357
343
  - lib/avm/tools/runner/self/docker.rb
358
344
  - lib/avm/tools/runner/self/registry.rb
345
+ - lib/avm/tools/runner/source.rb
346
+ - lib/avm/tools/runner/source/info.rb
347
+ - lib/avm/tools/runner/source/issue.rb
348
+ - lib/avm/tools/runner/source/issue/complete.rb
349
+ - lib/avm/tools/runner/source/issue/deliver.rb
350
+ - lib/avm/tools/runner/source/subs.rb
351
+ - lib/avm/tools/runner/source/test.rb
352
+ - lib/avm/tools/runner/source/update.rb
353
+ - lib/avm/tools/runner/source/version_bump.rb
359
354
  - lib/avm/tools/runner/source_generate.rb
360
355
  - lib/avm/tools/self.rb
356
+ - lib/avm/tools/source.rb
361
357
  - lib/avm/tools/version.rb
362
358
  - locale/en.yml
363
359
  - locale/pt-BR.yml
@@ -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