eac_launcher 0.5.1 → 0.6.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (50) hide show
  1. checksums.yaml +4 -4
  2. data/exe/eac_launcher +8 -0
  3. data/lib/eac_launcher.rb +7 -45
  4. data/lib/eac_launcher/context.rb +10 -1
  5. data/lib/eac_launcher/context/instance_discovery.rb +3 -0
  6. data/lib/eac_launcher/context/instance_manager.rb +3 -1
  7. data/lib/eac_launcher/context/settings.rb +5 -1
  8. data/lib/eac_launcher/git.rb +5 -0
  9. data/lib/eac_launcher/git/base.rb +6 -3
  10. data/lib/eac_launcher/git/base/subrepo.rb +2 -0
  11. data/lib/eac_launcher/git/base/underlying.rb +4 -0
  12. data/lib/eac_launcher/git/mirror_update.rb +3 -1
  13. data/lib/eac_launcher/git/publish_base.rb +3 -1
  14. data/lib/eac_launcher/git/sub_warp_base.rb +2 -0
  15. data/lib/eac_launcher/git/warp_base.rb +4 -1
  16. data/lib/eac_launcher/instances.rb +4 -0
  17. data/lib/eac_launcher/instances/base.rb +1 -1
  18. data/lib/eac_launcher/instances/runner_helper.rb +3 -0
  19. data/lib/eac_launcher/paths.rb +2 -0
  20. data/lib/eac_launcher/paths/logical.rb +2 -1
  21. data/lib/eac_launcher/publish.rb +2 -0
  22. data/lib/eac_launcher/publish/base.rb +2 -0
  23. data/lib/eac_launcher/publish/check_result.rb +2 -0
  24. data/lib/eac_launcher/ruby.rb +1 -0
  25. data/lib/eac_launcher/ruby/gem.rb +2 -0
  26. data/lib/eac_launcher/ruby/gem/build.rb +5 -0
  27. data/lib/eac_launcher/ruby/gem/specification.rb +2 -0
  28. data/lib/eac_launcher/runner.rb +19 -0
  29. data/lib/eac_launcher/runner/instances.rb +39 -0
  30. data/lib/eac_launcher/runner/projects.rb +43 -0
  31. data/lib/eac_launcher/runner/publish.rb +49 -0
  32. data/lib/eac_launcher/stereotype.rb +2 -0
  33. data/lib/eac_launcher/stereotypes.rb +12 -0
  34. data/lib/eac_launcher/stereotypes/git.rb +2 -0
  35. data/lib/eac_launcher/stereotypes/git/publish.rb +2 -0
  36. data/lib/eac_launcher/stereotypes/git/warp.rb +2 -0
  37. data/lib/eac_launcher/stereotypes/git_subrepo.rb +3 -0
  38. data/lib/eac_launcher/stereotypes/git_subrepo/publish.rb +2 -0
  39. data/lib/eac_launcher/stereotypes/git_subrepo/warp.rb +5 -1
  40. data/lib/eac_launcher/stereotypes/git_subtree.rb +3 -0
  41. data/lib/eac_launcher/stereotypes/rails.rb +2 -0
  42. data/lib/eac_launcher/stereotypes/redmine_plugin.rb +2 -0
  43. data/lib/eac_launcher/stereotypes/ruby_gem.rb +4 -0
  44. data/lib/eac_launcher/stereotypes/ruby_gem/publish.rb +10 -1
  45. data/lib/eac_launcher/vendor.rb +1 -0
  46. data/lib/eac_launcher/version.rb +1 -1
  47. metadata +18 -16
  48. data/exe/eac_launcher_instance +0 -42
  49. data/exe/eac_launcher_projects +0 -45
  50. data/exe/eac_launcher_publish +0 -53
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 7a3eea76a642eeaa21b7b3b39a1f287391dbc207d1135c3120d011f1fe2c1c6f
4
- data.tar.gz: 1e55d0b9e8ce28356eec47911362448d911898ec1b0e071df7fdf7aa26b572c3
3
+ metadata.gz: cd361cfa7ad448a1aeee023d843863bf0419744a0b17de9406399da242d0a6ee
4
+ data.tar.gz: d93808ebacfada34ac429c36bdb446908e7c67359f9dd2e52cbe93f763d242b5
5
5
  SHA512:
6
- metadata.gz: 730e7358551d454ee9459cd0cbeb9abf0f22be04b59ead7ab46c15e56cae439075d27466ca9ab04229896249ef7b11047a989b487492cfc54953d28494d455b4
7
- data.tar.gz: 335671d8a1f5ee2fd82e3f0fba4866009cba988921770b1cbee60431c01a9d470be0e1a3683f9f61ca10ffd3f2b27731afd415ff61f8b1617282f6b69df9dc5a
6
+ metadata.gz: 18d69da69e448fff130c5cb94d74943c706f7999af039443979091217822ed5444b6dd9998f1b59804d1ae6a8df71cd0ecfc548bb70ead6d7a0197a357fcd2c4
7
+ data.tar.gz: c3a5e35ca0ed7739fb2defe422d86511ce6e5ba95ab21a67341bf170ed745cc7ec101c7e33c1630f59b64b6dda728c610e75da7f5a0b5d51535bd6e00ae4ab1b
@@ -0,0 +1,8 @@
1
+ #!/usr/bin/env ruby
2
+ # frozen_string_literal: true
3
+
4
+ $LOAD_PATH.unshift("#{__dir__}/../lib")
5
+
6
+ require 'eac_launcher/runner'
7
+
8
+ ::EacLauncher::Runner.run(program_name: ::File.basename(__FILE__))
@@ -1,55 +1,17 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require('active_support')
4
- require('active_support/core_ext')
5
- require('colorize')
6
- require('curb')
7
- require('eac/simple_cache')
8
- require('eac_ruby_utils')
9
- require('git')
10
- require('json')
11
- require('ruby-progressbar')
12
- require('rubygems')
13
- require('shellwords')
14
- require('yaml')
15
-
16
3
  GIT_SUBREPO_LIB = ::File.join(::File.dirname(__dir__), 'vendor', 'git-subrepo', 'lib')
17
4
  ENV['PATH'] = "#{GIT_SUBREPO_LIB}#{::File::PATH_SEPARATOR}#{ENV['PATH']}"
18
5
 
19
6
  module EacLauncher
20
7
  require 'eac_launcher/context'
21
- require 'eac_launcher/paths/logical'
22
- require 'eac_launcher/paths/real'
8
+ require 'eac_launcher/paths'
23
9
  require 'eac_launcher/project'
24
10
  require 'eac_launcher/stereotype'
25
- require 'eac_launcher/context/instance_discovery'
26
- require 'eac_launcher/context/instance_manager'
27
- require 'eac_launcher/context/settings'
28
- require 'eac_launcher/git/base'
29
- require 'eac_launcher/git/error'
30
- require 'eac_launcher/git/mirror_update'
31
- require 'eac_launcher/git/publish_base'
32
- require 'eac_launcher/git/warp_base'
33
- require 'eac_launcher/instances/base'
34
- require 'eac_launcher/instances/error'
35
- require 'eac_launcher/instances/runner_helper'
36
- require 'eac_launcher/instances/settings'
37
- require 'eac_launcher/publish/base'
38
- require 'eac_launcher/publish/check_result'
39
- require 'eac_launcher/ruby/gem/build'
40
- require 'eac_launcher/ruby/gem/specification'
41
- require 'eac_launcher/stereotypes/git'
42
- require 'eac_launcher/stereotypes/git_subrepo'
43
- require 'eac_launcher/stereotypes/git_subtree'
44
- require 'eac_launcher/stereotypes/rails'
45
- require 'eac_launcher/stereotypes/redmine_plugin'
46
- require 'eac_launcher/stereotypes/ruby_gem'
47
- require 'eac_launcher/stereotypes/git/publish'
48
- require 'eac_launcher/stereotypes/git/warp'
49
- require 'eac_launcher/stereotypes/git_subrepo/publish'
50
- require 'eac_launcher/stereotypes/git_subrepo/warp'
51
- require 'eac_launcher/stereotypes/git_subtree/publish'
52
- require 'eac_launcher/stereotypes/git_subtree/warp'
53
- require 'eac_launcher/stereotypes/ruby_gem/publish'
54
- require 'eac_launcher/vendor/github'
11
+ require 'eac_launcher/git'
12
+ require 'eac_launcher/instances'
13
+ require 'eac_launcher/publish'
14
+ require 'eac_launcher/ruby'
15
+ require 'eac_launcher/stereotypes'
16
+ require 'eac_launcher/vendor'
55
17
  end
@@ -1,6 +1,15 @@
1
+ require 'active_support/core_ext/hash/indifferent_access'
2
+ require 'eac_ruby_utils/simple_cache'
3
+ require 'eac_ruby_utils/console/speaker'
4
+ require 'eac_launcher/context/instance_discovery'
5
+ require 'eac_launcher/context/instance_manager'
6
+ require 'eac_launcher/context/settings'
7
+ require 'eac_launcher/paths/logical'
8
+ require 'eac_launcher/project'
9
+
1
10
  module EacLauncher
2
11
  class Context
3
- include ::Eac::SimpleCache
12
+ include ::EacRubyUtils::SimpleCache
4
13
  include ::EacRubyUtils::Console::Speaker
5
14
 
6
15
  DEFAULT_PROJECTS_ROOT = '.'.freeze
@@ -1,3 +1,6 @@
1
+ require 'ruby-progressbar'
2
+ require 'eac_launcher/instances/base'
3
+
1
4
  module EacLauncher
2
5
  class Context
3
6
  class InstanceDiscovery
@@ -1,7 +1,9 @@
1
+ require('yaml')
2
+
1
3
  module EacLauncher
2
4
  class Context
3
5
  class InstanceManager
4
- include ::Eac::SimpleCache
6
+ include ::EacRubyUtils::SimpleCache
5
7
 
6
8
  def initialize(context)
7
9
  @context = context
@@ -1,7 +1,11 @@
1
+ require 'eac_ruby_utils/simple_cache'
2
+ require 'yaml'
3
+ require 'eac_launcher/instances/settings'
4
+
1
5
  module EacLauncher
2
6
  class Context
3
7
  class Settings
4
- include ::Eac::SimpleCache
8
+ include ::EacRubyUtils::SimpleCache
5
9
 
6
10
  def initialize(file)
7
11
  @data = YAML.load_file(file)
@@ -0,0 +1,5 @@
1
+ require 'eac_launcher/git/base'
2
+ require 'eac_launcher/git/error'
3
+ require 'eac_launcher/git/mirror_update'
4
+ require 'eac_launcher/git/publish_base'
5
+ require 'eac_launcher/git/warp_base'
@@ -1,10 +1,13 @@
1
- require_relative 'base/underlying'
2
- require_relative 'base/subrepo'
1
+ require 'eac_ruby_utils/simple_cache'
2
+ require 'eac_ruby_utils/envs'
3
+ require 'eac_launcher/paths/real'
4
+ require 'eac_launcher/git/base/underlying'
5
+ require 'eac_launcher/git/base/subrepo'
3
6
 
4
7
  module EacLauncher
5
8
  module Git
6
9
  class Base < ::EacLauncher::Paths::Real
7
- include ::Eac::SimpleCache
10
+ include ::EacRubyUtils::SimpleCache
8
11
  include ::EacLauncher::Git::Base::Subrepo
9
12
  include ::EacLauncher::Git::Base::Underlying
10
13
 
@@ -1,3 +1,5 @@
1
+ require 'active_support/core_ext/object'
2
+
1
3
  module EacLauncher
2
4
  module Git
3
5
  class Base < ::EacLauncher::Paths::Real
@@ -1,3 +1,7 @@
1
+ require 'eac_ruby_utils/envs'
2
+ require 'git'
3
+ require 'eac_launcher/paths/real'
4
+
1
5
  module EacLauncher
2
6
  module Git
3
7
  class Base < ::EacLauncher::Paths::Real
@@ -1,7 +1,9 @@
1
+ require 'eac_launcher/git/base'
2
+
1
3
  module EacLauncher
2
4
  module Git
3
5
  class MirrorUpdate < ::EacLauncher::Paths::Real
4
- include ::Eac::SimpleCache
6
+ include ::EacRubyUtils::SimpleCache
5
7
 
6
8
  def initialize(target_path, source_path, source_rev)
7
9
  super(target_path)
@@ -1,9 +1,11 @@
1
+ require 'eac_ruby_utils/simple_cache'
2
+ require 'eac_ruby_utils/simple_cache'
1
3
  require 'eac_launcher/publish/base'
2
4
 
3
5
  module EacLauncher
4
6
  module Git
5
7
  class PublishBase < ::EacLauncher::Publish::Base
6
- include ::Eac::SimpleCache
8
+ include ::EacRubyUtils::SimpleCache
7
9
  include ::EacRubyUtils::Console::Speaker
8
10
 
9
11
  CHECKERS = %w[publish_remote_no_exist remote_equal remote_following local_following].freeze
@@ -1,3 +1,5 @@
1
+ require 'eac_launcher/instances/error'
2
+
1
3
  module EacLauncher
2
4
  module Git
3
5
  module SubWarpBase
@@ -1,3 +1,6 @@
1
+ require 'eac_launcher/git/mirror_update'
2
+ require 'eac_launcher/vendor/github'
3
+
1
4
  module EacLauncher
2
5
  module Git
3
6
  # Métodos abstratos:
@@ -5,7 +8,7 @@ module EacLauncher
5
8
  # * source_remote_name
6
9
  # * current_ref
7
10
  class WarpBase < ::EacLauncher::Paths::Real
8
- include ::Eac::SimpleCache
11
+ include ::EacRubyUtils::SimpleCache
9
12
 
10
13
  TARGET_REMOTE = 'target'.freeze
11
14
 
@@ -0,0 +1,4 @@
1
+ require 'eac_launcher/instances/base'
2
+ require 'eac_launcher/instances/error'
3
+ require 'eac_launcher/instances/runner_helper'
4
+ require 'eac_launcher/instances/settings'
@@ -5,7 +5,7 @@ module EacLauncher
5
5
  module Base
6
6
  class << self
7
7
  def extend_object(object)
8
- object.extend ::Eac::SimpleCache
8
+ object.extend ::EacRubyUtils::SimpleCache
9
9
  object.extend ::EacRubyUtils::Console::Speaker
10
10
  object.extend ::EacLauncher::Instances::Base::Cache
11
11
  super
@@ -1,3 +1,6 @@
1
+ require 'eac_ruby_utils/console/docopt_runner'
2
+ require 'eac_ruby_utils/console/speaker'
3
+
1
4
  module EacLauncher
2
5
  module Instances
3
6
  class RunnerHelper < ::EacRubyUtils::Console::DocoptRunner
@@ -0,0 +1,2 @@
1
+ require 'eac_launcher/paths/logical'
2
+ require 'eac_launcher/paths/real'
@@ -1,9 +1,10 @@
1
1
  require 'eac_launcher/paths/real'
2
+ require 'eac_launcher/stereotypes'
2
3
 
3
4
  module EacLauncher
4
5
  module Paths
5
6
  class Logical
6
- include ::Eac::SimpleCache
7
+ include ::EacRubyUtils::SimpleCache
7
8
 
8
9
  class << self
9
10
  def from_h(context, h)
@@ -0,0 +1,2 @@
1
+ require 'eac_launcher/publish/base'
2
+ require 'eac_launcher/publish/check_result'
@@ -1,3 +1,5 @@
1
+ require 'eac_launcher/instances/error'
2
+
1
3
  module EacLauncher
2
4
  module Publish
3
5
  class Base
@@ -1,3 +1,5 @@
1
+ require 'active_support/concern' # Missing on "eac/listable"
2
+ require 'active_support/hash_with_indifferent_access'
1
3
  require 'eac/listable'
2
4
 
3
5
  module EacLauncher
@@ -0,0 +1 @@
1
+ require 'eac_launcher/ruby/gem'
@@ -0,0 +1,2 @@
1
+ require 'eac_launcher/ruby/gem/build'
2
+ require 'eac_launcher/ruby/gem/specification'
@@ -1,3 +1,8 @@
1
+ require 'tmpdir'
2
+ require 'eac_ruby_utils/console/speaker'
3
+ require 'eac_ruby_utils/envs'
4
+ require 'eac_launcher/ruby/gem/specification'
5
+
1
6
  module EacLauncher
2
7
  module Ruby
3
8
  module Gem
@@ -1,3 +1,5 @@
1
+ require 'active_support/core_ext/object'
2
+
1
3
  module EacLauncher
2
4
  module Ruby
3
5
  module Gem
@@ -0,0 +1,19 @@
1
+ require 'eac_ruby_utils/console/docopt_runner'
2
+ require 'eac_launcher/runner/instances'
3
+ require 'eac_launcher/runner/projects'
4
+ require 'eac_launcher/runner/publish'
5
+
6
+ module EacLauncher
7
+ class Runner < ::EacRubyUtils::Console::DocoptRunner
8
+ DOC = <<DOCOPT.freeze
9
+ Utilities to deploy applications and libraries.
10
+
11
+ Usage:
12
+ __PROGRAM__ [options] __SUBCOMMANDS__
13
+ __PROGRAM__ -h | --help
14
+
15
+ Options:
16
+ -h --help Show this screen.
17
+ DOCOPT
18
+ end
19
+ end
@@ -0,0 +1,39 @@
1
+ require 'eac_launcher/instances/runner_helper'
2
+
3
+ module EacLauncher
4
+ class Runner < ::EacRubyUtils::Console::DocoptRunner
5
+ class Instances < ::EacLauncher::Instances::RunnerHelper
6
+ DOC = <<DOCOPT.freeze
7
+ Mostra informações sobre instâncias.
8
+
9
+ Usage:
10
+ __PROGRAM__ [options] [<instance_path>...]
11
+ __PROGRAM__ -h | --help
12
+
13
+ Options:
14
+ -h --help Show this screen.
15
+ --all Get all instances.
16
+ --recache Rewrite instances cache.
17
+
18
+ DOCOPT
19
+
20
+ def run
21
+ ::EacLauncher::Context.current.recache = options['--recache']
22
+ instances.each { |i| show_instance(i) }
23
+ end
24
+
25
+ private
26
+
27
+ def show_instance(i)
28
+ puts instance_label(i)
29
+ infov(' * Parent', (i.parent ? instance_label(i.parent) : '-'))
30
+ infov(' * Git current revision', i.options.git_current_revision)
31
+ infov(' * Git publish remote', i.options.git_publish_remote)
32
+ end
33
+
34
+ def instance_path
35
+ options['<instance_path>']
36
+ end
37
+ end
38
+ end
39
+ end
@@ -0,0 +1,43 @@
1
+ require 'eac_launcher/context'
2
+ require 'eac_launcher/instances/runner_helper'
3
+
4
+ module EacLauncher
5
+ class Runner < ::EacRubyUtils::Console::DocoptRunner
6
+ class Projects < ::EacLauncher::Instances::RunnerHelper
7
+ DOC = <<DOCOPT.freeze
8
+ Shows available projects.
9
+
10
+ Usage:
11
+ __PROGRAM__ [options]
12
+ __PROGRAM__ -h | --help
13
+
14
+ Options:
15
+ -h --help Show this screen.
16
+ -i --instances Show instances.
17
+ --recache Rewrite instances cache.
18
+
19
+ DOCOPT
20
+
21
+ def run
22
+ ::EacLauncher::Context.current.recache = options['--recache']
23
+ ::EacLauncher::Context.current.projects.each do |p|
24
+ show_project(p)
25
+ end
26
+ end
27
+
28
+ private
29
+
30
+ def show_project(p)
31
+ puts project_label(p)
32
+ return unless options['--instances']
33
+ p.instances.each do |i|
34
+ puts " * #{instance_label(i)}"
35
+ end
36
+ end
37
+
38
+ def project_label(p)
39
+ p.to_s.cyan.to_s
40
+ end
41
+ end
42
+ end
43
+ end
@@ -0,0 +1,49 @@
1
+ module EacLauncher
2
+ class Runner < ::EacRubyUtils::Console::DocoptRunner
3
+ class Publish < ::EacLauncher::Instances::RunnerHelper
4
+ DOC = <<DOCOPT.freeze
5
+ Publica projetos ou instâncias.
6
+
7
+ Usage:
8
+ __PROGRAM__ (check|dry-run|run) [options] [<instance_path>...]
9
+ __PROGRAM__ -h | --help
10
+
11
+ Options:
12
+ -h --help Show this screen.
13
+ --new Publish projects not published before.
14
+ -s --stereotype=<st> Publish only for stereotype <stereotype>.
15
+ --all Publish all instances.
16
+ --pending Publish only pending.
17
+ --recache Rewrite instances cache.
18
+
19
+ DOCOPT
20
+
21
+ OPTIONS = {
22
+ new: '--new', confirm: 'run', stereotype: '--stereotype'
23
+ }.freeze
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
+ i.send(instance_method)
31
+ end
32
+ end
33
+
34
+ private
35
+
36
+ def instance_method
37
+ options['run'] || options['dry-run'] ? 'publish_run' : 'publish_check'
38
+ end
39
+
40
+ def build_publish_options
41
+ ::EacLauncher::Context.current.publish_options = publish_options
42
+ end
43
+
44
+ def publish_options
45
+ Hash[OPTIONS.map { |k, v| [k, options[v]] }]
46
+ end
47
+ end
48
+ end
49
+ end
@@ -1,3 +1,5 @@
1
+ require 'active_support/core_ext/string/inflections'
2
+
1
3
  module EacLauncher
2
4
  module Stereotype
3
5
  class << self
@@ -0,0 +1,12 @@
1
+ require 'eac_launcher/stereotypes/git'
2
+ require 'eac_launcher/stereotypes/git_subrepo'
3
+ require 'eac_launcher/stereotypes/git_subtree'
4
+ require 'eac_launcher/stereotypes/rails'
5
+ require 'eac_launcher/stereotypes/redmine_plugin'
6
+ require 'eac_launcher/stereotypes/ruby_gem'
7
+ require 'eac_launcher/stereotypes/git/publish'
8
+ require 'eac_launcher/stereotypes/git/warp'
9
+ require 'eac_launcher/stereotypes/git_subrepo/publish'
10
+ require 'eac_launcher/stereotypes/git_subrepo/warp'
11
+ require 'eac_launcher/stereotypes/git_subtree/publish'
12
+ require 'eac_launcher/stereotypes/git_subtree/warp'
@@ -1,3 +1,5 @@
1
+ require 'eac_launcher/stereotype'
2
+
1
3
  module EacLauncher
2
4
  module Stereotypes
3
5
  class Git
@@ -1,3 +1,5 @@
1
+ require 'eac_launcher/git/publish_base'
2
+
1
3
  module EacLauncher
2
4
  module Stereotypes
3
5
  class Git
@@ -1,3 +1,5 @@
1
+ require 'eac_launcher/git/warp_base'
2
+
1
3
  module EacLauncher
2
4
  module Stereotypes
3
5
  class Git
@@ -1,3 +1,6 @@
1
+ require 'eac_launcher/git/error'
2
+ require 'eac_launcher/stereotype'
3
+
1
4
  module EacLauncher
2
5
  module Stereotypes
3
6
  class GitSubrepo
@@ -1,3 +1,5 @@
1
+ require 'eac_launcher/git/publish_base'
2
+
1
3
  module EacLauncher
2
4
  module Stereotypes
3
5
  class GitSubrepo
@@ -1,11 +1,15 @@
1
+ require 'eac_ruby_utils/simple_cache'
1
2
  require 'eac_launcher/git/sub_warp_base'
3
+ require 'eac_launcher/instances/error'
4
+ require 'eac_launcher/paths/real'
5
+ require 'eac_launcher/vendor/github'
2
6
 
3
7
  module EacLauncher
4
8
  module Stereotypes
5
9
  class GitSubrepo
6
10
  class Warp < ::EacLauncher::Paths::Real
7
11
  include ::EacLauncher::Git::SubWarpBase
8
- include ::Eac::SimpleCache
12
+ include ::EacRubyUtils::SimpleCache
9
13
 
10
14
  attr_reader :instance
11
15
 
@@ -1,3 +1,6 @@
1
+ require 'eac_launcher/stereotype'
2
+ require 'eac_launcher/stereotypes/git'
3
+
1
4
  module EacLauncher
2
5
  module Stereotypes
3
6
  class GitSubtree
@@ -1,3 +1,5 @@
1
+ require 'eac_launcher/stereotype'
2
+
1
3
  module EacLauncher
2
4
  module Stereotypes
3
5
  class Rails
@@ -1,3 +1,5 @@
1
+ require 'eac_launcher/stereotype'
2
+
1
3
  module EacLauncher
2
4
  module Stereotypes
3
5
  class RedminePlugin
@@ -1,3 +1,7 @@
1
+ require 'eac_launcher/ruby/gem/specification'
2
+ require 'eac_launcher/stereotype'
3
+ require 'eac_launcher/stereotypes/ruby_gem/publish'
4
+
1
5
  module EacLauncher
2
6
  module Stereotypes
3
7
  class RubyGem
@@ -1,8 +1,17 @@
1
+ require 'curb'
2
+ require 'json'
3
+ require 'eac_ruby_utils/simple_cache'
4
+ require 'rubygems'
5
+ require 'eac_ruby_utils/console/speaker'
6
+ require 'eac_launcher/publish/base'
7
+ require 'eac_launcher/publish/check_result'
8
+ require 'eac_launcher/ruby/gem'
9
+
1
10
  module EacLauncher
2
11
  module Stereotypes
3
12
  class RubyGem
4
13
  class Publish < ::EacLauncher::Publish::Base
5
- include ::Eac::SimpleCache
14
+ include ::EacRubyUtils::SimpleCache
6
15
  include ::EacRubyUtils::Console::Speaker
7
16
 
8
17
  protected
@@ -0,0 +1 @@
1
+ require 'eac_launcher/vendor/github'
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module EacLauncher
4
- VERSION = '0.5.1'.freeze
4
+ VERSION = '0.6.0'.freeze
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: eac_launcher
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.1
4
+ version: 0.6.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: 2019-07-17 00:00:00.000000000 Z
11
+ date: 2019-07-29 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport
@@ -84,20 +84,14 @@ dependencies:
84
84
  requirements:
85
85
  - - "~>"
86
86
  - !ruby/object:Gem::Version
87
- version: '0.1'
88
- - - ">="
89
- - !ruby/object:Gem::Version
90
- version: 0.1.2
87
+ version: '0.7'
91
88
  type: :runtime
92
89
  prerelease: false
93
90
  version_requirements: !ruby/object:Gem::Requirement
94
91
  requirements:
95
92
  - - "~>"
96
93
  - !ruby/object:Gem::Version
97
- version: '0.1'
98
- - - ">="
99
- - !ruby/object:Gem::Version
100
- version: 0.1.2
94
+ version: '0.7'
101
95
  - !ruby/object:Gem::Dependency
102
96
  name: git
103
97
  requirement: !ruby/object:Gem::Requirement
@@ -157,22 +151,19 @@ dependencies:
157
151
  description:
158
152
  email:
159
153
  executables:
160
- - eac_launcher_instance
161
- - eac_launcher_projects
162
- - eac_launcher_publish
154
+ - eac_launcher
163
155
  extensions: []
164
156
  extra_rdoc_files: []
165
157
  files:
166
158
  - Gemfile
167
159
  - README.rdoc
168
- - exe/eac_launcher_instance
169
- - exe/eac_launcher_projects
170
- - exe/eac_launcher_publish
160
+ - exe/eac_launcher
171
161
  - lib/eac_launcher.rb
172
162
  - lib/eac_launcher/context.rb
173
163
  - lib/eac_launcher/context/instance_discovery.rb
174
164
  - lib/eac_launcher/context/instance_manager.rb
175
165
  - lib/eac_launcher/context/settings.rb
166
+ - lib/eac_launcher/git.rb
176
167
  - lib/eac_launcher/git/base.rb
177
168
  - lib/eac_launcher/git/base/subrepo.rb
178
169
  - lib/eac_launcher/git/base/underlying.rb
@@ -181,19 +172,29 @@ files:
181
172
  - lib/eac_launcher/git/publish_base.rb
182
173
  - lib/eac_launcher/git/sub_warp_base.rb
183
174
  - lib/eac_launcher/git/warp_base.rb
175
+ - lib/eac_launcher/instances.rb
184
176
  - lib/eac_launcher/instances/base.rb
185
177
  - lib/eac_launcher/instances/base/cache.rb
186
178
  - lib/eac_launcher/instances/error.rb
187
179
  - lib/eac_launcher/instances/runner_helper.rb
188
180
  - lib/eac_launcher/instances/settings.rb
181
+ - lib/eac_launcher/paths.rb
189
182
  - lib/eac_launcher/paths/logical.rb
190
183
  - lib/eac_launcher/paths/real.rb
191
184
  - lib/eac_launcher/project.rb
185
+ - lib/eac_launcher/publish.rb
192
186
  - lib/eac_launcher/publish/base.rb
193
187
  - lib/eac_launcher/publish/check_result.rb
188
+ - lib/eac_launcher/ruby.rb
189
+ - lib/eac_launcher/ruby/gem.rb
194
190
  - lib/eac_launcher/ruby/gem/build.rb
195
191
  - lib/eac_launcher/ruby/gem/specification.rb
192
+ - lib/eac_launcher/runner.rb
193
+ - lib/eac_launcher/runner/instances.rb
194
+ - lib/eac_launcher/runner/projects.rb
195
+ - lib/eac_launcher/runner/publish.rb
196
196
  - lib/eac_launcher/stereotype.rb
197
+ - lib/eac_launcher/stereotypes.rb
197
198
  - lib/eac_launcher/stereotypes/git.rb
198
199
  - lib/eac_launcher/stereotypes/git/publish.rb
199
200
  - lib/eac_launcher/stereotypes/git/warp.rb
@@ -207,6 +208,7 @@ files:
207
208
  - lib/eac_launcher/stereotypes/redmine_plugin.rb
208
209
  - lib/eac_launcher/stereotypes/ruby_gem.rb
209
210
  - lib/eac_launcher/stereotypes/ruby_gem/publish.rb
211
+ - lib/eac_launcher/vendor.rb
210
212
  - lib/eac_launcher/vendor/github.rb
211
213
  - lib/eac_launcher/version.rb
212
214
  - vendor/git-subrepo/Changes
@@ -1,42 +0,0 @@
1
- #!/usr/bin/env ruby
2
- # frozen_string_literal: true
3
-
4
- require 'rubygems'
5
- require 'bundler/setup'
6
- require 'eac_launcher'
7
-
8
- class Runner < ::EacLauncher::Instances::RunnerHelper
9
- DOC = <<DOCOPT.freeze
10
- Mostra informações sobre instâncias.
11
-
12
- Usage:
13
- __PROGRAM__ [options] [<instance_path>...]
14
- __PROGRAM__ -h | --help
15
-
16
- Options:
17
- -h --help Show this screen.
18
- --all Get all instances.
19
- --recache Rewrite instances cache.
20
-
21
- DOCOPT
22
-
23
- private
24
-
25
- def run
26
- ::EacLauncher::Context.current.recache = options['--recache']
27
- instances.each { |i| show_instance(i) }
28
- end
29
-
30
- def show_instance(i)
31
- puts instance_label(i)
32
- infov(' * Parent', (i.parent ? instance_label(i.parent) : '-'))
33
- infov(' * Git current revision', i.options.git_current_revision)
34
- infov(' * Git publish remote', i.options.git_publish_remote)
35
- end
36
-
37
- def instance_path
38
- options['<instance_path>']
39
- end
40
- end
41
-
42
- Runner.new
@@ -1,45 +0,0 @@
1
- #!/usr/bin/env ruby
2
-
3
- require 'rubygems'
4
- require 'bundler/setup'
5
- require 'eac_launcher'
6
-
7
- class Runner < ::EacLauncher::Instances::RunnerHelper
8
- DOC = <<DOCOPT.freeze
9
- Listas os projetos disponíveis.
10
-
11
- Usage:
12
- __PROGRAM__
13
- __PROGRAM__ -i | --instances
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
- private
24
-
25
- def run
26
- ::EacLauncher::Context.current.recache = options['--recache']
27
- ::EacLauncher::Context.current.projects.each do |p|
28
- show_project(p)
29
- end
30
- end
31
-
32
- def show_project(p)
33
- puts project_label(p)
34
- return unless options['--instances']
35
- p.instances.each do |i|
36
- puts " * #{instance_label(i)}"
37
- end
38
- end
39
-
40
- def project_label(p)
41
- p.to_s.cyan.to_s
42
- end
43
- end
44
-
45
- Runner.new
@@ -1,53 +0,0 @@
1
- #!/usr/bin/env ruby
2
-
3
- require 'rubygems'
4
- require 'bundler/setup'
5
- require 'eac_launcher'
6
-
7
- class Runner < ::EacLauncher::Instances::RunnerHelper
8
- DOC = <<DOCOPT.freeze
9
- Publica projetos ou instâncias.
10
-
11
- Usage:
12
- __PROGRAM__ (check|dry-run|run) [options] [<instance_path>...]
13
- __PROGRAM__ -h | --help
14
-
15
- Options:
16
- -h --help Show this screen.
17
- --new Publish projects not published before.
18
- -s --stereotype=<st> Publish only for stereotype <stereotype>.
19
- --all Publish all instances.
20
- --pending Publish only pending.
21
- --recache Rewrite instances cache.
22
-
23
- DOCOPT
24
-
25
- OPTIONS = {
26
- new: '--new', confirm: 'run', stereotype: '--stereotype'
27
- }.freeze
28
-
29
- private
30
-
31
- def run
32
- ::EacLauncher::Context.current.recache = options['--recache']
33
- build_publish_options
34
- instances.each do |i|
35
- next unless i.options.publishable?
36
- i.send(instance_method)
37
- end
38
- end
39
-
40
- def instance_method
41
- options['run'] || options['dry-run'] ? 'publish_run' : 'publish_check'
42
- end
43
-
44
- def build_publish_options
45
- ::EacLauncher::Context.current.publish_options = publish_options
46
- end
47
-
48
- def publish_options
49
- Hash[OPTIONS.map { |k, v| [k, options[v]] }]
50
- end
51
- end
52
-
53
- Runner.new