avm 0.36.0 → 0.37.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: 7efc64412c406ca9b9575a704de3e3eaa48328ce07f95a9406f55edd323a6843
4
- data.tar.gz: 82b77ad19908de1401ba655e7ec16ddc5c4a119b9d4c52b47baa259c40db77ea
3
+ metadata.gz: '0821a30efc137201d1e73d98cf31b741458bacc8a297495e1d88a6a150d988d3'
4
+ data.tar.gz: da4de9f1f24f9638ee5158411a05494c5007ffad292f26c3f19a4c5665389b1c
5
5
  SHA512:
6
- metadata.gz: 37a7790ce5e98c0cfe0eca56d22fbbd44689ce63bb5796eacb5c762f0c8b9765972ac7c4666b401ecfa21f0feb2807e26361c9fe99a8c384732a29ece0943255
7
- data.tar.gz: e85973d4cc9064ac60e34697cdca985ffcce20f300560e91b6d134000fb5b628e603750db44e2f184397fa806b6b87b6bb33d834e9119fc04fca04e28e3a1197
6
+ metadata.gz: afad52fb0a1801a83d5d295b9e220d7040a8ed09205d9fafd783393abc08bafe750a882e4ce4a28c6bbb5d23d3039a97e843818ef6e75437f4f7b5b5d87f1458
7
+ data.tar.gz: b450f642ef1c8692264dd21d60195f669a1d58291cff3256f3c379b5f529bdd589b8b66537f10e19acafa796ec1eb0e4600bb788e31ca6e3712392534dd32b00
@@ -0,0 +1,34 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'avm/applications/base'
4
+ require 'eac_ruby_utils/core_ext'
5
+
6
+ module Avm
7
+ module Sources
8
+ class Base
9
+ module Application
10
+ APPLICATION_NAME_KEY = 'application'
11
+
12
+ # @return [Avm::Applications::Base]
13
+ def application
14
+ @application ||= ::Avm::Applications::Base.new(application_id)
15
+ end
16
+
17
+ # @return [String]
18
+ def application_id
19
+ application_id_by_configuration || application_id_by_directory
20
+ end
21
+
22
+ # @return [String, nil]
23
+ def application_id_by_configuration
24
+ configuration.entry(APPLICATION_NAME_KEY).value
25
+ end
26
+
27
+ # @return [String]
28
+ def application_id_by_directory
29
+ path.basename.to_path
30
+ end
31
+ end
32
+ end
33
+ end
34
+ end
@@ -24,6 +24,8 @@ module Avm
24
24
 
25
25
  # @return [EacRubyUtils::Envs::Command, nil]
26
26
  def configuration_value_to_env_command(value)
27
+ return value if value.is_a?(::EacRubyUtils::Envs::Command)
28
+
27
29
  configuration_value_to_shell_words(value).if_present { |v| env.command(v).chdir(path) }
28
30
  end
29
31
 
@@ -57,7 +57,7 @@ module Avm
57
57
 
58
58
  def configured_enumerable_value_as_test_commands(value)
59
59
  configured_hash_value_as_test_commands(
60
- value.each_with_index.map { |v| ["test_#{v[1]}", v[0]] }.to_h
60
+ value.each_with_index.map { |v, i| ["test_#{i}", v] }.to_h
61
61
  )
62
62
  end
63
63
 
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.36.0'
4
+ VERSION = '0.37.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.36.0
4
+ version: 0.37.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: 2022-08-13 00:00:00.000000000 Z
11
+ date: 2022-08-14 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: eac_cli
@@ -290,6 +290,7 @@ files:
290
290
  - lib/avm/source_generators/runner.rb
291
291
  - lib/avm/sources.rb
292
292
  - lib/avm/sources/base.rb
293
+ - lib/avm/sources/base/application.rb
293
294
  - lib/avm/sources/base/configuration.rb
294
295
  - lib/avm/sources/base/instance.rb
295
296
  - lib/avm/sources/base/locale.rb