avm 0.81.0 → 0.82.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: c5aaacb2872fccfe58ccdafad10e0a1c431b2c86e020cdda80a9d352d6771451
4
- data.tar.gz: cf56541de76d828f5fdfa7fb1bd192fee610614ca7b51c02941f6e5293c801c0
3
+ metadata.gz: ba7de7fb51ef4cb64b226e0f9797ceee1253fd91aec2db6dc97d51fa9ea1d9a0
4
+ data.tar.gz: f6d75846fd246eba14ebb2b20dd0075c3c83d4177b4d017f806763bf1f9bf5df
5
5
  SHA512:
6
- metadata.gz: dd31baa92bd54625915361d83eec55ecd425f241ecb216c3c01c13fa0f320dbc86e59d5e19509eeab0746911e48845881f880bd7e13382426fed44aab4b6ede0
7
- data.tar.gz: c96a21e64aed4dd953128bee69bfb72107dc5abc6f7977154dd8e8495ad1ddc7daa93dbbdf829a4e8435547ff9da5d3153e8080c9d1e7a6c9497500bd8b347e5
6
+ metadata.gz: 79c47096a1c10051bfa2c1371f8417a65375c386c81be0dc85998e95a3f11e4fba147760571a3f1e8506ab6e16dcfebcbb45307ab64bef6695c00c283cf2802f
7
+ data.tar.gz: 9e92f65585c980504fc39eb098728c8be153a9cf70d7e0ba9656e0572cf6a9db593d20e829ba94bbbbc71480b6afeca16a6d0cb01069f6f7e378e9dd96f6ed74
@@ -5,6 +5,8 @@ require 'eac_ruby_utils/core_ext'
5
5
  module Avm
6
6
  module ApplicationScms
7
7
  class Base
8
+ acts_as_abstract
9
+
8
10
  class << self
9
11
  # @return [String]
10
12
  def type_name
@@ -12,16 +14,25 @@ module Avm
12
14
  end
13
15
  end
14
16
 
15
- # !method initialize(url)
16
- # @param url [Addressable::URI]
17
- common_constructor :url do
18
- self.url = url.to_uri
19
- end
17
+ # !method initialize(application)
18
+ # @param application [Avm::Application::Base]
19
+ common_constructor :application
20
20
  delegate :type_name, to: :class
21
21
 
22
+ # @param path [Pathname]
23
+ # @return [Pathname]
24
+ def assert_main_at(path) # rubocop:disable Lint/UnusedMethodArgument
25
+ raise_abstract_method __method__
26
+ end
27
+
22
28
  # @return [String]
23
29
  def to_s
24
- "#{type_name}[#{url}]"
30
+ "#{type_name}[#{to_s_type_specific}]"
31
+ end
32
+
33
+ # @return [String]
34
+ def to_s_type_specific
35
+ ''
25
36
  end
26
37
  end
27
38
  end
@@ -0,0 +1,24 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'eac_fs/core_ext'
4
+
5
+ module Avm
6
+ module Applications
7
+ class Base
8
+ class AutoLocalSourcePath
9
+ acts_as_instance_method
10
+ common_constructor :application
11
+
12
+ # @return [Pathname]
13
+ def result
14
+ application.scm.assert_main_at(fs_cache.path.to_pathname)
15
+ end
16
+
17
+ # @return [String]
18
+ def fs_object_id
19
+ application.id.to_s.parameterize
20
+ end
21
+ end
22
+ end
23
+ end
24
+ end
@@ -10,7 +10,7 @@ module Avm
10
10
  module LocalSource
11
11
  # @return [Pathname]
12
12
  def local_source_path
13
- local_source_path_entry.value!.to_pathname
13
+ (local_source_path_entry.value || auto_local_source_path).to_pathname
14
14
  end
15
15
 
16
16
  # @return [EacConfig::Entry]
@@ -8,12 +8,12 @@ module Avm
8
8
  class Base
9
9
  module Scm
10
10
  common_concern do
11
- uri_components_entries_values 'scm', %w[repos_path type]
11
+ uri_components_entries_values 'scm', %w[repos_path ssh_username type]
12
12
  end
13
13
 
14
14
  # @return [Avm::ApplicationScms::Base]
15
15
  def scm
16
- @scm ||= ::Avm::Registry.application_scms.detect(scm_type, scm_url)
16
+ @scm ||= ::Avm::Registry.application_scms.detect(self)
17
17
  end
18
18
 
19
19
  # @param value [String]
@@ -6,9 +6,9 @@ module Avm
6
6
  module Registry
7
7
  class ApplicationScms < ::Avm::Registry::FromGems
8
8
  def class_detect(klass, detect_args)
9
- return nil unless klass.type_name == detect_args[0]
9
+ return nil unless klass.type_name == detect_args.fetch(0).scm_type
10
10
 
11
- klass.new(*detect_args[1..-1])
11
+ klass.new(*detect_args)
12
12
  end
13
13
  end
14
14
  end
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.81.0'
4
+ VERSION = '0.82.0'
5
5
  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.81.0
4
+ version: 0.82.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: 2023-10-31 00:00:00.000000000 Z
11
+ date: 2023-11-04 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: aranha-parsers
@@ -243,6 +243,7 @@ files:
243
243
  - lib/avm/application_stereotypes/base.rb
244
244
  - lib/avm/applications.rb
245
245
  - lib/avm/applications/base.rb
246
+ - lib/avm/applications/base/auto_local_source_path.rb
246
247
  - lib/avm/applications/base/local_instance.rb
247
248
  - lib/avm/applications/base/local_source.rb
248
249
  - lib/avm/applications/base/naming.rb