avm 0.93.0 → 0.94.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 2c1fee20bfe64a0b6d97f7866255914971859fb503ab18825eaf9be01a137aad
4
- data.tar.gz: 964391eaa0ac606596e4aeb3b87ecd0c4ffcc1c78cadb86e98569e6ab660e06d
3
+ metadata.gz: 685447f38f30ac35c44b9863040c1159f9f6482d4b4f7da5371755bdeb07b60f
4
+ data.tar.gz: 4fa2fb246971340fddbab51a8d23256dc972442fb71e9d75bb141db6b10b3ab0
5
5
  SHA512:
6
- metadata.gz: 03a07968e45e58c41fcf6a5aed935b78f116b51e4fc536c9cd408b316404d5f8ac24ae262bd1d77e584fda8ad62641a13062b529a859483895389ac7ca6db732
7
- data.tar.gz: a1f51632e1d257cfbf50197c60bc9f8bd3acd18a9e136911387b12257b296373f72bf640de5b5cf09c187770ca47b0e3b8cf5a0b18efb264d0757893924c7db8
6
+ metadata.gz: a5815972de0a71ee75afa4957c9467a2b7aa6ee2de7ed4f4f12f800bbb13d92c4ce2db3d255a135806ae72099fadad20ec42a9258ee2a9c69b1b853dfdab4c0a
7
+ data.tar.gz: 6a9d84303d007faa4d359d156f65a38c955f6fa3946d233a2bde65bf99ec846ac61c8f4bf307787e47020936b97ae61547826d611a4ece0939b569ec361e1133
@@ -78,11 +78,6 @@ module Avm
78
78
  send("default_#{key}".underscore)
79
79
  end
80
80
 
81
- # @return [String]
82
- def default_projects_root
83
- '.'.to_pathname.expand_path.to_path
84
- end
85
-
86
81
  def default_settings_file
87
82
  ::File.join(::EacFs::Contexts.config.current.path, 'launcher.yaml')
88
83
  end
@@ -0,0 +1,96 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'avm/launcher/context'
4
+ require 'eac_config/node'
5
+ require 'eac_ruby_utils/core_ext'
6
+ require 'fileutils'
7
+ require 'ruby-progressbar'
8
+ require 'tmpdir'
9
+
10
+ module Avm
11
+ module Rspec
12
+ class LauncherController
13
+ attr_accessor :remotes_dir
14
+
15
+ # @param application_id [String]
16
+ # @param path [Pathname]
17
+ # @return void
18
+ def application_source_path(application_id, path)
19
+ EacConfig::Node.context.current.entry("#{application_id}_dev.install.path").value =
20
+ path.to_pathname.to_path
21
+ end
22
+
23
+ # @param settings_path [Pathname]
24
+ # @param projects_root [Pathname]
25
+ def context_set(settings_path, projects_root)
26
+ Avm::Launcher::Context.current = Avm::Launcher::Context.new(
27
+ settings_file: settings_path.to_pathname.to_path,
28
+ cache_root: Dir.mktmpdir
29
+ )
30
+ self.projects_root = projects_root
31
+ end
32
+
33
+ # @return [Pathname]
34
+ def default_settings_path
35
+ templates_directory.join('settings.yml')
36
+ end
37
+
38
+ # @return [Pathname]
39
+ def dummy_directory
40
+ templates_directory.join('dummy')
41
+ end
42
+
43
+ # @param settings_path [Pathname]
44
+ def temp_context(settings_path)
45
+ context_set(settings_path, Dir.mktmpdir)
46
+ end
47
+
48
+ def init_remote(name)
49
+ require 'avm/git/launcher/base'
50
+ r = Avm::Git::Launcher::Base.new(File.join(remotes_dir, name))
51
+ r.init_bare
52
+ r
53
+ end
54
+
55
+ def init_git(subdir)
56
+ require 'avm/git/launcher/base'
57
+ r = Avm::Git::Launcher::Base.new(File.join(projects_root, subdir))
58
+ r.git
59
+ r.execute!('config', 'user.email', 'theuser@example.net')
60
+ r.execute!('config', 'user.name', 'The User')
61
+ r
62
+ end
63
+
64
+ # @return [Avm::Launcher::Context]
65
+ def new_context
66
+ Avm::Launcher::Context.new(
67
+ settings_file: default_settings_path,
68
+ cache_root: Dir.mktmpdir
69
+ )
70
+ end
71
+
72
+ # @param path [String]
73
+ def projects_root
74
+ @projects_root ||= Dir.mktmpdir
75
+ end
76
+
77
+ # @param path [Pathname]
78
+ def projects_root=(path)
79
+ @projects_root = path.to_pathname.to_path
80
+ end
81
+
82
+ # @return [Pathname]
83
+ def templates_directory
84
+ '../../../template/avm/rspec/launcher_controller'.to_pathname.expand_path(__dir__)
85
+ end
86
+
87
+ def touch_commit(repos, subpath)
88
+ require 'fileutils'
89
+ FileUtils.mkdir_p(File.dirname(repos.subpath(subpath)))
90
+ FileUtils.touch(repos.subpath(subpath))
91
+ repos.execute!('add', repos.subpath(subpath))
92
+ repos.execute!('commit', '-m', subpath)
93
+ end
94
+ end
95
+ end
96
+ end
@@ -9,7 +9,7 @@ module Avm
9
9
  require_sub __FILE__
10
10
  EXAMPLES = %w[avm_file_formats_with_fixtures avm_file_format_file_resource_name
11
11
  avm_source_generated entries_values in_avm_registry not_in_avm_registry
12
- with_config].freeze
12
+ with_config with_launcher].freeze
13
13
 
14
14
  def self.extended(obj)
15
15
  obj.setup_examples
@@ -0,0 +1,16 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'avm/rspec/launcher_controller'
4
+
5
+ RSpec.shared_context 'with_launcher' do
6
+ let(:launcher_controller) { Avm::Rspec::LauncherController.new }
7
+
8
+ before do
9
+ Avm::Launcher::Context.current = launcher_controller.new_context
10
+ launcher_controller.remotes_dir = Dir.mktmpdir
11
+ allow(ProgressBar).to receive(:create).and_return(double.as_null_object)
12
+ end
13
+
14
+ delegate :application_source_path, :context_set, :init_git, :init_remote, :temp_context,
15
+ :projects_root, :projects_root=, :touch_commit, to: :launcher_controller
16
+ end
data/lib/avm/scms/base.rb CHANGED
@@ -12,7 +12,7 @@ module Avm
12
12
  include ::Avm::With::ApplicationStereotype
13
13
  abstract_methods :update, :valid?
14
14
  common_constructor :path do
15
- self.path = path.to_pathname
15
+ self.path = path.to_pathname.expand_path
16
16
  end
17
17
 
18
18
  # @return [Avm::Scms::ChangedFile]
@@ -11,7 +11,7 @@ module Avm
11
11
  # @param source [Avm::Sources::Base]
12
12
  # @param sub_path [Pathname]
13
13
  common_constructor :source, :sub_path do
14
- self.sub_path = sub_path.to_pathname
14
+ self.sub_path = sub_path.to_pathname.cleanpath
15
15
  end
16
16
 
17
17
  # @return [Pathname]
data/lib/avm/version.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Avm
4
- VERSION = '0.93.0'
4
+ VERSION = '0.94.0'
5
5
  end
@@ -0,0 +1,29 @@
1
+ # frozen_string_literal: true
2
+
3
+ $LOAD_PATH.push File.expand_path('lib', __dir__)
4
+
5
+ # Maintain your gem's version:
6
+ require 'avm/tools/version'
7
+
8
+ # Describe your gem and declare its dependencies:
9
+ Gem::Specification.new do |s|
10
+ s.name = 'avm/tools'
11
+ s.version = Avm::Tools::VERSION
12
+ s.authors = ['Esquilo Azul Company']
13
+ s.summary = 'Utilities to deploy applications and libraries.'
14
+ s.license = 'MIT'
15
+
16
+ s.files = Dir['{exe,lib}/**/*', 'Gemfile', 'MIT-LICENSE', 'README.rdoc']
17
+ s.required_ruby_version = '>= 2.7.0'
18
+ s.bindir = 'exe'
19
+ s.executables = s.files.grep(%r{^exe/}) { |f| File.basename(f) }
20
+
21
+ s.add_dependency 'activesupport', '~> 4.2', '>= 4.2.10'
22
+ s.add_dependency 'colorize', '~> 0.8.1'
23
+ s.add_dependency 'curb', '~> 0.9.4'
24
+ s.add_dependency 'eac_rails_utils', '~> 0.1', '>= 0.1.14'
25
+ s.add_dependency 'eac_ruby_utils', '~> 0.1'
26
+ s.add_dependency 'git', '~> 1.3.0'
27
+ s.add_development_dependency 'rspec', '~> 3.7'
28
+ s.add_development_dependency 'rubocop', '~> 0.48.1'
29
+ end
@@ -0,0 +1,7 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Avm
4
+ module Tools
5
+ VERSION = '1.0.0.pre.stub'
6
+ end
7
+ end
@@ -0,0 +1,6 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Avm
4
+ module Tools
5
+ end
6
+ end
@@ -0,0 +1,5 @@
1
+ # frozen_string_literal: true
2
+
3
+ module RubyGemStub
4
+ VERSION = '1.0.0.pre.stub'
5
+ end
@@ -0,0 +1,3 @@
1
+ # frozen_string_literal: true
2
+
3
+ module RubyGemStub; end
@@ -0,0 +1,16 @@
1
+ # frozen_string_literal: true
2
+
3
+ $LOAD_PATH.push File.expand_path('lib', __dir__)
4
+
5
+ # Maintain your gem's version:
6
+ require 'ruby_gem_stub/version'
7
+
8
+ # Describe your gem and declare its dependencies:
9
+ Gem::Specification.new do |s|
10
+ s.name = 'ruby_gem_stub'
11
+ s.version = RubyGemStub::VERSION
12
+ s.authors = ['Esquilo Azul Company']
13
+ s.summary = 'Ruby gem stub for tests.'
14
+ s.files = Dir['{lib}/**/*']
15
+ s.required_ruby_version = '>= 2.7.0'
16
+ end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: avm
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.93.0
4
+ version: 0.94.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Eduardo H. Bogoni
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2024-07-05 00:00:00.000000000 Z
11
+ date: 2024-08-22 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: eac_cli
@@ -64,14 +64,14 @@ dependencies:
64
64
  requirements:
65
65
  - - "~>"
66
66
  - !ruby/object:Gem::Version
67
- version: '0.17'
67
+ version: '0.18'
68
68
  type: :runtime
69
69
  prerelease: false
70
70
  version_requirements: !ruby/object:Gem::Requirement
71
71
  requirements:
72
72
  - - "~>"
73
73
  - !ruby/object:Gem::Version
74
- version: '0.17'
74
+ version: '0.18'
75
75
  - !ruby/object:Gem::Dependency
76
76
  name: eac_ruby_utils
77
77
  requirement: !ruby/object:Gem::Requirement
@@ -93,6 +93,9 @@ dependencies:
93
93
  - - "~>"
94
94
  - !ruby/object:Gem::Version
95
95
  version: '0.7'
96
+ - - ">="
97
+ - !ruby/object:Gem::Version
98
+ version: 0.7.1
96
99
  type: :runtime
97
100
  prerelease: false
98
101
  version_requirements: !ruby/object:Gem::Requirement
@@ -100,6 +103,9 @@ dependencies:
100
103
  - - "~>"
101
104
  - !ruby/object:Gem::Version
102
105
  version: '0.7'
106
+ - - ">="
107
+ - !ruby/object:Gem::Version
108
+ version: 0.7.1
103
109
  - !ruby/object:Gem::Dependency
104
110
  name: minitar
105
111
  requirement: !ruby/object:Gem::Requirement
@@ -319,6 +325,7 @@ files:
319
325
  - lib/avm/registry/with_path/cache.rb
320
326
  - lib/avm/result.rb
321
327
  - lib/avm/rspec.rb
328
+ - lib/avm/rspec/launcher_controller.rb
322
329
  - lib/avm/rspec/setup.rb
323
330
  - lib/avm/rspec/setup/launcher.rb
324
331
  - lib/avm/rspec/setup/source_generator.rb
@@ -329,6 +336,7 @@ files:
329
336
  - lib/avm/rspec/shared_examples/in_avm_registry.rb
330
337
  - lib/avm/rspec/shared_examples/not_in_avm_registry.rb
331
338
  - lib/avm/rspec/shared_examples/with_config.rb
339
+ - lib/avm/rspec/shared_examples/with_launcher.rb
332
340
  - lib/avm/runners/base.rb
333
341
  - lib/avm/scms.rb
334
342
  - lib/avm/scms/auto_commit.rb
@@ -401,6 +409,13 @@ files:
401
409
  - lib/avm/with/extra_subcommands.rb
402
410
  - locale/en.yml
403
411
  - locale/pt-BR.yml
412
+ - template/avm/rspec/launcher_controller/dummy/avm-tools_stub/avm-tools.gemspec
413
+ - template/avm/rspec/launcher_controller/dummy/avm-tools_stub/lib/avm/tools.rb
414
+ - template/avm/rspec/launcher_controller/dummy/avm-tools_stub/lib/avm/tools/version.rb
415
+ - template/avm/rspec/launcher_controller/dummy/ruby_gem_stub/lib/ruby_gem_stub.rb
416
+ - template/avm/rspec/launcher_controller/dummy/ruby_gem_stub/lib/ruby_gem_stub/version.rb
417
+ - template/avm/rspec/launcher_controller/dummy/ruby_gem_stub/ruby_gem_stub.gemspec
418
+ - template/avm/rspec/launcher_controller/settings.yml
404
419
  - template/avm/self/docker_image/Dockerfile
405
420
  - template/avm/self/docker_image/entrypoint.sh
406
421
  homepage: