avm-tools 0.58.1 → 0.59.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (53) hide show
  1. checksums.yaml +4 -4
  2. data/lib/avm/local_projects.rb +9 -0
  3. data/lib/avm/local_projects/instance.rb +28 -0
  4. data/lib/avm/projects.rb +9 -0
  5. data/lib/avm/projects/stereotype.rb +55 -0
  6. data/lib/avm/projects/stereotypes.rb +20 -0
  7. data/lib/avm/projects/stereotypes/git.rb +25 -0
  8. data/lib/avm/projects/stereotypes/git/publish.rb +15 -0
  9. data/lib/avm/projects/stereotypes/git/warp.rb +27 -0
  10. data/lib/avm/projects/stereotypes/git_subrepo.rb +34 -0
  11. data/lib/avm/projects/stereotypes/git_subrepo/publish.rb +14 -0
  12. data/lib/avm/projects/stereotypes/git_subrepo/warp.rb +87 -0
  13. data/lib/avm/projects/stereotypes/git_subtree.rb +51 -0
  14. data/lib/avm/projects/stereotypes/git_subtree/publish.rb +12 -0
  15. data/lib/avm/projects/stereotypes/git_subtree/warp.rb +29 -0
  16. data/lib/avm/projects/stereotypes/rails_application.rb +23 -0
  17. data/lib/avm/projects/stereotypes/redmine_plugin.rb +23 -0
  18. data/lib/avm/projects/stereotypes/ruby_gem.rb +30 -0
  19. data/lib/avm/projects/stereotypes/ruby_gem/publish.rb +129 -0
  20. data/lib/avm/tools/runner/launcher.rb +10 -2
  21. data/lib/avm/tools/runner/launcher/instances.rb +45 -0
  22. data/lib/avm/tools/runner/launcher/projects.rb +50 -0
  23. data/lib/avm/tools/runner/launcher/publish.rb +65 -0
  24. data/lib/avm/tools/runner/local_project.rb +32 -0
  25. data/lib/avm/tools/runner/local_project/info.rb +25 -0
  26. data/lib/avm/tools/version.rb +1 -1
  27. data/lib/eac_launcher.rb +1 -2
  28. data/lib/eac_launcher/git/publish_base.rb +1 -0
  29. data/lib/eac_launcher/git/sub_warp_base.rb +1 -1
  30. data/lib/eac_launcher/git/warp_base.rb +2 -2
  31. data/lib/eac_launcher/instances/base.rb +2 -2
  32. data/lib/eac_launcher/instances/runner_helper.rb +1 -1
  33. data/lib/eac_launcher/paths/logical.rb +2 -2
  34. metadata +25 -21
  35. data/lib/eac_launcher/runner.rb +0 -21
  36. data/lib/eac_launcher/runner/instances.rb +0 -41
  37. data/lib/eac_launcher/runner/projects.rb +0 -46
  38. data/lib/eac_launcher/runner/publish.rb +0 -59
  39. data/lib/eac_launcher/stereotype.rb +0 -52
  40. data/lib/eac_launcher/stereotypes.rb +0 -14
  41. data/lib/eac_launcher/stereotypes/git.rb +0 -21
  42. data/lib/eac_launcher/stereotypes/git/publish.rb +0 -13
  43. data/lib/eac_launcher/stereotypes/git/warp.rb +0 -25
  44. data/lib/eac_launcher/stereotypes/git_subrepo.rb +0 -30
  45. data/lib/eac_launcher/stereotypes/git_subrepo/publish.rb +0 -12
  46. data/lib/eac_launcher/stereotypes/git_subrepo/warp.rb +0 -85
  47. data/lib/eac_launcher/stereotypes/git_subtree.rb +0 -47
  48. data/lib/eac_launcher/stereotypes/git_subtree/publish.rb +0 -10
  49. data/lib/eac_launcher/stereotypes/git_subtree/warp.rb +0 -27
  50. data/lib/eac_launcher/stereotypes/rails.rb +0 -21
  51. data/lib/eac_launcher/stereotypes/redmine_plugin.rb +0 -21
  52. data/lib/eac_launcher/stereotypes/ruby_gem.rb +0 -27
  53. data/lib/eac_launcher/stereotypes/ruby_gem/publish.rb +0 -127
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Avm
4
4
  module Tools
5
- VERSION = '0.58.1'
5
+ VERSION = '0.59.0'
6
6
  end
7
7
  end
@@ -4,11 +4,10 @@ module EacLauncher
4
4
  require 'eac_launcher/context'
5
5
  require 'eac_launcher/paths'
6
6
  require 'eac_launcher/project'
7
- require 'eac_launcher/stereotype'
7
+ require 'avm/projects/stereotype'
8
8
  require 'eac_launcher/git'
9
9
  require 'eac_launcher/instances'
10
10
  require 'eac_launcher/publish'
11
11
  require 'eac_launcher/ruby'
12
- require 'eac_launcher/stereotypes'
13
12
  require 'eac_launcher/vendor'
14
13
  end
@@ -3,6 +3,7 @@
3
3
  require 'eac_ruby_utils/simple_cache'
4
4
  require 'eac_ruby_utils/simple_cache'
5
5
  require 'eac_launcher/publish/base'
6
+ require 'eac_launcher/publish/check_result'
6
7
 
7
8
  module EacLauncher
8
9
  module Git
@@ -15,7 +15,7 @@ module EacLauncher
15
15
  end
16
16
 
17
17
  def find_parent_instance(current)
18
- if ::EacLauncher::Stereotype.git_stereotypes.any? { |s| current.stereotype?(s) }
18
+ if ::Avm::Projects::Stereotype.git_stereotypes.any? { |s| current.stereotype?(s) }
19
19
  return current
20
20
  end
21
21
 
@@ -2,7 +2,7 @@
2
2
 
3
3
  require 'eac_launcher/git/mirror_update'
4
4
  require 'eac_launcher/vendor/github'
5
- require 'eac_launcher/stereotypes/git/publish'
5
+ require 'avm/projects/stereotypes/git/publish'
6
6
 
7
7
  module EacLauncher
8
8
  module Git
@@ -13,7 +13,7 @@ module EacLauncher
13
13
  class WarpBase < ::EacLauncher::Paths::Real
14
14
  include ::EacRubyUtils::SimpleCache
15
15
 
16
- TARGET_REMOTE = ::EacLauncher::Stereotypes::Git::Publish::PUBLISH_GIT_REMOTE_NAME
16
+ TARGET_REMOTE = ::Avm::Projects::Stereotypes::Git::Publish::PUBLISH_GIT_REMOTE_NAME
17
17
 
18
18
  def initialize(instance)
19
19
  @instance = instance
@@ -48,7 +48,7 @@ module EacLauncher
48
48
  stereotypes.each do |s|
49
49
  next unless publish?(s)
50
50
 
51
- infov(name, "publishing #{s.stereotype_name_in_color}")
51
+ infov(name, "publishing #{s.label}")
52
52
  s.publish_class.new(self).run
53
53
  end
54
54
  end
@@ -57,7 +57,7 @@ module EacLauncher
57
57
  stereotypes.each do |s|
58
58
  next unless publish?(s)
59
59
 
60
- puts "#{name.to_s.cyan}|#{s.stereotype_name_in_color}|" \
60
+ puts "#{name.to_s.cyan}|#{s.label}|" \
61
61
  "#{s.publish_class.new(self).check}"
62
62
  end
63
63
  end
@@ -31,7 +31,7 @@ module EacLauncher
31
31
  end
32
32
 
33
33
  def instance_stereotypes(instance)
34
- instance.stereotypes.map(&:stereotype_name_in_color).join(', ')
34
+ instance.stereotypes.map(&:label).join(', ')
35
35
  end
36
36
 
37
37
  def instance_label(instance)
@@ -1,7 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
+ require 'avm/stereotypes'
3
4
  require 'eac_launcher/paths/real'
4
- require 'eac_launcher/stereotypes'
5
5
 
6
6
  module EacLauncher
7
7
  module Paths
@@ -55,7 +55,7 @@ module EacLauncher
55
55
  private
56
56
 
57
57
  def stereotypes_uncached
58
- ::EacLauncher::Stereotype.stereotypes.select { |s| s.match?(self) }
58
+ ::Avm::Projects::Stereotype.stereotypes.select { |s| s.match?(self) }
59
59
  end
60
60
 
61
61
  def build_child(name)
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.58.1
4
+ version: 0.59.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: 2020-07-24 00:00:00.000000000 Z
11
+ date: 2020-07-25 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: aranha-parsers
@@ -358,9 +358,27 @@ files:
358
358
  - lib/avm/instances/entries.rb
359
359
  - lib/avm/instances/entries/entry_reader.rb
360
360
  - lib/avm/instances/entry_keys.rb
361
+ - lib/avm/local_projects.rb
362
+ - lib/avm/local_projects/instance.rb
361
363
  - lib/avm/patches.rb
362
364
  - lib/avm/patches/object/template.rb
363
365
  - lib/avm/path_string.rb
366
+ - lib/avm/projects.rb
367
+ - lib/avm/projects/stereotype.rb
368
+ - lib/avm/projects/stereotypes.rb
369
+ - lib/avm/projects/stereotypes/git.rb
370
+ - lib/avm/projects/stereotypes/git/publish.rb
371
+ - lib/avm/projects/stereotypes/git/warp.rb
372
+ - lib/avm/projects/stereotypes/git_subrepo.rb
373
+ - lib/avm/projects/stereotypes/git_subrepo/publish.rb
374
+ - lib/avm/projects/stereotypes/git_subrepo/warp.rb
375
+ - lib/avm/projects/stereotypes/git_subtree.rb
376
+ - lib/avm/projects/stereotypes/git_subtree/publish.rb
377
+ - lib/avm/projects/stereotypes/git_subtree/warp.rb
378
+ - lib/avm/projects/stereotypes/rails_application.rb
379
+ - lib/avm/projects/stereotypes/redmine_plugin.rb
380
+ - lib/avm/projects/stereotypes/ruby_gem.rb
381
+ - lib/avm/projects/stereotypes/ruby_gem/publish.rb
364
382
  - lib/avm/rails.rb
365
383
  - lib/avm/rails/runners.rb
366
384
  - lib/avm/rails/runners/bundle.rb
@@ -445,6 +463,11 @@ files:
445
463
  - lib/avm/tools/runner/git/subrepo.rb
446
464
  - lib/avm/tools/runner/git/subrepo/check.rb
447
465
  - lib/avm/tools/runner/launcher.rb
466
+ - lib/avm/tools/runner/launcher/instances.rb
467
+ - lib/avm/tools/runner/launcher/projects.rb
468
+ - lib/avm/tools/runner/launcher/publish.rb
469
+ - lib/avm/tools/runner/local_project.rb
470
+ - lib/avm/tools/runner/local_project/info.rb
448
471
  - lib/avm/tools/runner/ruby.rb
449
472
  - lib/avm/tools/runner/ruby/gems.rb
450
473
  - lib/avm/tools/runner/ruby/gems/generate.rb
@@ -487,25 +510,6 @@ files:
487
510
  - lib/eac_launcher/ruby/gem.rb
488
511
  - lib/eac_launcher/ruby/gem/build.rb
489
512
  - lib/eac_launcher/ruby/gem/specification.rb
490
- - lib/eac_launcher/runner.rb
491
- - lib/eac_launcher/runner/instances.rb
492
- - lib/eac_launcher/runner/projects.rb
493
- - lib/eac_launcher/runner/publish.rb
494
- - lib/eac_launcher/stereotype.rb
495
- - lib/eac_launcher/stereotypes.rb
496
- - lib/eac_launcher/stereotypes/git.rb
497
- - lib/eac_launcher/stereotypes/git/publish.rb
498
- - lib/eac_launcher/stereotypes/git/warp.rb
499
- - lib/eac_launcher/stereotypes/git_subrepo.rb
500
- - lib/eac_launcher/stereotypes/git_subrepo/publish.rb
501
- - lib/eac_launcher/stereotypes/git_subrepo/warp.rb
502
- - lib/eac_launcher/stereotypes/git_subtree.rb
503
- - lib/eac_launcher/stereotypes/git_subtree/publish.rb
504
- - lib/eac_launcher/stereotypes/git_subtree/warp.rb
505
- - lib/eac_launcher/stereotypes/rails.rb
506
- - lib/eac_launcher/stereotypes/redmine_plugin.rb
507
- - lib/eac_launcher/stereotypes/ruby_gem.rb
508
- - lib/eac_launcher/stereotypes/ruby_gem/publish.rb
509
513
  - lib/eac_launcher/vendor.rb
510
514
  - lib/eac_launcher/vendor/github.rb
511
515
  - lib/eac_launcher/version.rb
@@ -1,21 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- require 'eac_ruby_utils/console/docopt_runner'
4
- require 'eac_launcher/runner/instances'
5
- require 'eac_launcher/runner/projects'
6
- require 'eac_launcher/runner/publish'
7
-
8
- module EacLauncher
9
- class Runner < ::EacRubyUtils::Console::DocoptRunner
10
- DOC = <<~DOCOPT
11
- Utilities to deploy applications and libraries.
12
-
13
- Usage:
14
- __PROGRAM__ [options] __SUBCOMMANDS__
15
- __PROGRAM__ -h | --help
16
-
17
- Options:
18
- -h --help Show this screen.
19
- DOCOPT
20
- end
21
- end
@@ -1,41 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- require 'eac_launcher/instances/runner_helper'
4
-
5
- module EacLauncher
6
- class Runner < ::EacRubyUtils::Console::DocoptRunner
7
- class Instances < ::EacLauncher::Instances::RunnerHelper
8
- DOC = <<~DOCOPT
9
- Mostra informações sobre instâncias.
10
-
11
- Usage:
12
- __PROGRAM__ [options] [<instance_path>...]
13
- __PROGRAM__ -h | --help
14
-
15
- Options:
16
- -h --help Show this screen.
17
- --all Get all instances.
18
- --recache Rewrite instances cache.
19
-
20
- DOCOPT
21
-
22
- def run
23
- ::EacLauncher::Context.current.recache = options['--recache']
24
- instances.each { |i| show_instance(i) }
25
- end
26
-
27
- private
28
-
29
- def show_instance(instance)
30
- puts instance_label(instance)
31
- infov(' * Parent', (instance.parent ? instance_label(instance.parent) : '-'))
32
- infov(' * Git current revision', instance.options.git_current_revision)
33
- infov(' * Git publish remote', instance.options.git_publish_remote)
34
- end
35
-
36
- def instance_path
37
- options['<instance_path>']
38
- end
39
- end
40
- end
41
- end
@@ -1,46 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- require 'eac_launcher/context'
4
- require 'eac_launcher/instances/runner_helper'
5
-
6
- module EacLauncher
7
- class Runner < ::EacRubyUtils::Console::DocoptRunner
8
- class Projects < ::EacLauncher::Instances::RunnerHelper
9
- DOC = <<~DOCOPT
10
- Shows available projects.
11
-
12
- Usage:
13
- __PROGRAM__ [options]
14
- __PROGRAM__ -h | --help
15
-
16
- Options:
17
- -h --help Show this screen.
18
- -i --instances Show instances.
19
- --recache Rewrite instances cache.
20
-
21
- DOCOPT
22
-
23
- def run
24
- ::EacLauncher::Context.current.recache = options['--recache']
25
- ::EacLauncher::Context.current.projects.each do |p|
26
- show_project(p)
27
- end
28
- end
29
-
30
- private
31
-
32
- def show_project(project)
33
- puts project_label(project)
34
- return unless options['--instances']
35
-
36
- project.instances.each do |i|
37
- puts " * #{instance_label(i)}"
38
- end
39
- end
40
-
41
- def project_label(project)
42
- project.to_s.cyan.to_s
43
- end
44
- end
45
- end
46
- end
@@ -1,59 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- module EacLauncher
4
- class Runner < ::EacRubyUtils::Console::DocoptRunner
5
- class Publish < ::EacLauncher::Instances::RunnerHelper
6
- DOC = <<~DOCOPT
7
- Publica projetos ou instâncias.
8
-
9
- Usage:
10
- __PROGRAM__ [options] [<instance_path>...]
11
- __PROGRAM__ -h | --help
12
-
13
- Options:
14
- -h --help Show this screen.
15
- --new Publish projects not published before.
16
- -s --stereotype=<st> Publish only for stereotype <stereotype>.
17
- --all Publish all instances.
18
- -d --dry-run "Dry run" publishing.
19
- --pending Publish only pending.
20
- --recache Rewrite instances cache.
21
- --run Confirm publishing.
22
-
23
- DOCOPT
24
-
25
- def run
26
- ::EacLauncher::Context.current.recache = options['--recache']
27
- build_publish_options
28
- instances.each do |i|
29
- next unless i.options.publishable?
30
-
31
- i.send(instance_method)
32
- end
33
- end
34
-
35
- private
36
-
37
- def dry_run?
38
- options.fetch('--dry-run')
39
- end
40
-
41
- def instance_method
42
- run? || dry_run? ? 'publish_run' : 'publish_check'
43
- end
44
-
45
- def build_publish_options
46
- ::EacLauncher::Context.current.publish_options = publish_options
47
- end
48
-
49
- def publish_options
50
- { new: options.fetch('--new'), stereotype: options.fetch('--stereotype'),
51
- confirm: run? }
52
- end
53
-
54
- def run?
55
- options.fetch('--run') && !dry_run?
56
- end
57
- end
58
- end
59
- end
@@ -1,52 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- require 'active_support/core_ext/string/inflections'
4
-
5
- module EacLauncher
6
- module Stereotype
7
- class << self
8
- attr_reader :stereotypes
9
-
10
- def included(base)
11
- @stereotypes ||= []
12
- @stereotypes << base
13
- base.extend(ClassMethods)
14
- end
15
-
16
- def git_stereotypes
17
- stereotypes.select { |c| c.name.demodulize.downcase.match('git') }
18
- end
19
-
20
- def nogit_stereotypes
21
- stereotypes - git_stereotypes
22
- end
23
- end
24
-
25
- module ClassMethods
26
- def stereotype_name
27
- name.gsub(/^.*::/, '')
28
- end
29
-
30
- def stereotype_name_in_color
31
- stereotype_name.send(color)
32
- end
33
-
34
- def publish_class
35
- sub_class('Publish')
36
- end
37
-
38
- def warp_class
39
- sub_class('Warp')
40
- end
41
-
42
- private
43
-
44
- def sub_class(sub_class_name)
45
- klass = const_get(sub_class_name)
46
- klass.is_a?(Class) ? klass : nil
47
- rescue NameError
48
- nil
49
- end
50
- end
51
- end
52
- end
@@ -1,14 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- require 'eac_launcher/stereotypes/git'
4
- require 'eac_launcher/stereotypes/git_subrepo'
5
- require 'eac_launcher/stereotypes/git_subtree'
6
- require 'eac_launcher/stereotypes/rails'
7
- require 'eac_launcher/stereotypes/redmine_plugin'
8
- require 'eac_launcher/stereotypes/ruby_gem'
9
- require 'eac_launcher/stereotypes/git/publish'
10
- require 'eac_launcher/stereotypes/git/warp'
11
- require 'eac_launcher/stereotypes/git_subrepo/publish'
12
- require 'eac_launcher/stereotypes/git_subrepo/warp'
13
- require 'eac_launcher/stereotypes/git_subtree/publish'
14
- require 'eac_launcher/stereotypes/git_subtree/warp'
@@ -1,21 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- require 'eac_launcher/stereotype'
4
-
5
- module EacLauncher
6
- module Stereotypes
7
- class Git
8
- include EacLauncher::Stereotype
9
-
10
- class << self
11
- def match?(path)
12
- File.directory?(path.real.subpath('.git'))
13
- end
14
-
15
- def color
16
- :white
17
- end
18
- end
19
- end
20
- end
21
- end