avm-apps 0.1.0 → 0.4.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: 2933ffb6aafbf506d273504900e5ac52449c05953bd2f5d7b7ad9139e144e399
4
- data.tar.gz: 15cda68d915b0b0c07766c7a9e5275bf5a19283651981d275dac6af798b40146
3
+ metadata.gz: bb27c8659fe34cfc387a23c02751f601dc670b0a99179bb7d5b3850641d9c710
4
+ data.tar.gz: 5f173bab0761ce9f33f8421fa49b56f1c37eaa0b69a3eaced7deaf30e77e8ce0
5
5
  SHA512:
6
- metadata.gz: 03e264d925a3dc13c0e8edaf393b749282d6a12ebaccb2206ba7283393f5f400e37d385af9abbf73f8f99afe623711d98134c90918ff2ffa7d701bbbf6057ea8
7
- data.tar.gz: 6f2578f159791884f912698b669164b899159b3785981af98616092765c18371874ea4a2766597ca8f4c14ba75e9bb0122ff6c4ba1df81629cdaefa83d50aa10
6
+ metadata.gz: 43faefd0225f71b28945091990b825abd93cb17841a82119558d2f2f2a66799a2db80bf599508c237b5826480d350ba0530fca86a6cb1df05e07bb830f9e0c81
7
+ data.tar.gz: ef90ae080cb7fed4692b0397bd414da327de834af90f6ef11db109f1b0629cd80575472f3a0e89a63ed4f753cada16ddefa4a75f3f043f5d31dac5d7b365785b
@@ -0,0 +1,19 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'eac_ruby_utils/core_ext'
4
+
5
+ module Avm
6
+ module Apps
7
+ class Config
8
+ class << self
9
+ # @deprecated Use EacConfig::Node.context instead.
10
+ # @return [EacRubyUtils::Context<EacConfig::Node>]
11
+ def context
12
+ ::EacConfig::Node.context
13
+ end
14
+
15
+ delegate :current, to: :context
16
+ end
17
+ end
18
+ end
19
+ end
@@ -1,7 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  require 'avm/apps/jobs/variables_source'
4
- require 'eac_ruby_utils/core_ext'
4
+ require 'eac_cli/core_ext'
5
5
 
6
6
  module Avm
7
7
  module Apps
@@ -10,7 +10,7 @@ module Avm
10
10
  common_concern do
11
11
  include ::ActiveSupport::Callbacks
12
12
 
13
- enable_console_speaker
13
+ enable_speaker
14
14
  enable_simple_cache
15
15
  enable_listable
16
16
  common_constructor :instance, :options, default: [{}] do
@@ -0,0 +1,57 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'eac_config/old_configs'
4
+ require 'eac_ruby_utils/core_ext'
5
+ require 'yaml'
6
+
7
+ module Avm
8
+ module Apps
9
+ module Sources
10
+ class Configuration < ::EacConfig::OldConfigs
11
+ require_sub __FILE__
12
+
13
+ FILENAMES = %w[.avm.yml .avm.yaml].freeze
14
+
15
+ class << self
16
+ def find_by_path(path)
17
+ path = ::Pathname.new(path.to_s) unless path.is_a?(::Pathname)
18
+ internal_find_path(path.expand_path)
19
+ end
20
+
21
+ def find_in_path(path)
22
+ absolute_pathname = path.to_pathname.expand_path
23
+ if absolute_pathname.directory?
24
+ FILENAMES.each do |filename|
25
+ file = absolute_pathname.join(filename)
26
+ return new(file) if file.exist?
27
+ end
28
+ end
29
+ nil
30
+ end
31
+
32
+ private
33
+
34
+ def internal_find_path(absolute_pathname)
35
+ r = find_in_path(absolute_pathname)
36
+ return r if r.present?
37
+
38
+ internal_find_path(absolute_pathname.dirname) unless absolute_pathname.root?
39
+ end
40
+ end
41
+
42
+ def initialize(path)
43
+ super(nil, storage_path: path)
44
+ end
45
+
46
+ # Utility to read a configuration as a [EacRubyUtils::Envs::Command].
47
+ # @return [EacRubyUtils::Envs::Command]
48
+ def read_command(key)
49
+ read_entry(key).if_present do |v|
50
+ args = v.is_a?(::Enumerable) ? v.map(&:to_s) : ::Shellwords.split(v)
51
+ ::EacRubyUtils::Envs.local.command(args).chdir(::File.dirname(storage_path))
52
+ end
53
+ end
54
+ end
55
+ end
56
+ end
57
+ end
@@ -0,0 +1,18 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'avm/patches/eac_ruby_gems_utils/gem'
4
+ require 'i18n'
5
+
6
+ module Avm
7
+ module Apps
8
+ module Sources
9
+ class Configuration < ::EacConfig::OldConfigs
10
+ LOCALE_KEY = :locale
11
+
12
+ def locale
13
+ read_entry(LOCALE_KEY) || ::I18n.default_locale
14
+ end
15
+ end
16
+ end
17
+ end
18
+ end
@@ -0,0 +1,26 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Avm
4
+ module Apps
5
+ module Sources
6
+ class Configuration < ::EacConfig::OldConfigs
7
+ RUBOCOP_COMMAND_KEY = 'ruby.rubocop.command'
8
+ RUBOCOP_GEMFILE_KEY = 'ruby.rubocop.gemfile'
9
+
10
+ def rubocop_command
11
+ read_command(RUBOCOP_COMMAND_KEY)
12
+ end
13
+
14
+ def rubocop_gemfile
15
+ gemfile_path = read_entry(RUBOCOP_GEMFILE_KEY)
16
+ return nil if gemfile_path.blank?
17
+
18
+ gemfile_path = gemfile_path.to_pathname.expand_path(storage_path.parent)
19
+ return gemfile_path if gemfile_path.file?
20
+
21
+ raise "Gemfile path \"#{gemfile_path}\" does not exist or is not a file"
22
+ end
23
+ end
24
+ end
25
+ end
26
+ end
@@ -0,0 +1,29 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'avm/patches/eac_ruby_gems_utils/gem'
4
+
5
+ module Avm
6
+ module Apps
7
+ module Sources
8
+ class Configuration < ::EacConfig::OldConfigs
9
+ BUNDLE_TEST_COMMAND_KEY = 'test.bundle_command'
10
+ TEST_COMMAND_KEY = 'test.command'
11
+
12
+ def any_test_command
13
+ bundle_test_command || test_command
14
+ end
15
+
16
+ def test_command
17
+ read_command(TEST_COMMAND_KEY)
18
+ end
19
+
20
+ def bundle_test_command
21
+ read_entry(BUNDLE_TEST_COMMAND_KEY).if_present do |v|
22
+ args = v.is_a?(::Enumerable) ? v.map(&:to_s) : ::Shellwords.split(v)
23
+ ::EacRubyGemsUtils::Gem.new(::File.dirname(storage_path)).bundle(*args).chdir_root
24
+ end
25
+ end
26
+ end
27
+ end
28
+ end
29
+ end
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Avm
4
4
  module Apps
5
- VERSION = '0.1.0'
5
+ VERSION = '0.4.0'
6
6
  end
7
7
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: avm-apps
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.4.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: 2021-02-21 00:00:00.000000000 Z
11
+ date: 2021-06-27 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: eac_ruby_utils
@@ -16,40 +16,28 @@ dependencies:
16
16
  requirements:
17
17
  - - "~>"
18
18
  - !ruby/object:Gem::Version
19
- version: '0.58'
20
- - - ">="
21
- - !ruby/object:Gem::Version
22
- version: 0.58.1
19
+ version: '0.67'
23
20
  type: :runtime
24
21
  prerelease: false
25
22
  version_requirements: !ruby/object:Gem::Requirement
26
23
  requirements:
27
24
  - - "~>"
28
25
  - !ruby/object:Gem::Version
29
- version: '0.58'
30
- - - ">="
31
- - !ruby/object:Gem::Version
32
- version: 0.58.1
26
+ version: '0.67'
33
27
  - !ruby/object:Gem::Dependency
34
28
  name: eac_ruby_gem_support
35
29
  requirement: !ruby/object:Gem::Requirement
36
30
  requirements:
37
31
  - - "~>"
38
32
  - !ruby/object:Gem::Version
39
- version: '0.1'
40
- - - ">="
41
- - !ruby/object:Gem::Version
42
- version: 0.1.2
33
+ version: '0.2'
43
34
  type: :development
44
35
  prerelease: false
45
36
  version_requirements: !ruby/object:Gem::Requirement
46
37
  requirements:
47
38
  - - "~>"
48
39
  - !ruby/object:Gem::Version
49
- version: '0.1'
50
- - - ">="
51
- - !ruby/object:Gem::Version
52
- version: 0.1.2
40
+ version: '0.2'
53
41
  description:
54
42
  email:
55
43
  executables: []
@@ -57,9 +45,14 @@ extensions: []
57
45
  extra_rdoc_files: []
58
46
  files:
59
47
  - lib/avm/apps.rb
48
+ - lib/avm/apps/config.rb
60
49
  - lib/avm/apps/jobs.rb
61
50
  - lib/avm/apps/jobs/base.rb
62
51
  - lib/avm/apps/jobs/variables_source.rb
52
+ - lib/avm/apps/sources/configuration.rb
53
+ - lib/avm/apps/sources/configuration/_locale.rb
54
+ - lib/avm/apps/sources/configuration/_rubocop.rb
55
+ - lib/avm/apps/sources/configuration/_tests.rb
63
56
  - lib/avm/apps/version.rb
64
57
  homepage:
65
58
  licenses: []
@@ -79,7 +72,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
79
72
  - !ruby/object:Gem::Version
80
73
  version: '0'
81
74
  requirements: []
82
- rubygems_version: 3.0.8
75
+ rubygems_version: 3.0.9
83
76
  signing_key:
84
77
  specification_version: 4
85
78
  summary: AVM components for applications.