avm-apps 0.4.1 → 0.5.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/avm/apps/version.rb +1 -1
- metadata +3 -11
- data/lib/avm/apps/config.rb +0 -19
- data/lib/avm/apps/jobs/base.rb +0 -64
- data/lib/avm/apps/jobs/variables_source.rb +0 -24
- data/lib/avm/apps/jobs.rb +0 -11
- data/lib/avm/apps/sources/configuration/_locale.rb +0 -18
- data/lib/avm/apps/sources/configuration/_rubocop.rb +0 -26
- data/lib/avm/apps/sources/configuration/_tests.rb +0 -29
- data/lib/avm/apps/sources/configuration.rb +0 -57
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6658d95cf6b9a020db7ed798f387feccd4e73060f7d85b23e039526b1fce7a06
|
4
|
+
data.tar.gz: 6b71f87b0358f6f3aea1a1831c519b841fc3d2c35bf4361732a249bc44aed49f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6ca1a0924f058b4711d7e05dc941c8fd7c58cac015fea8c60c24b9664b91f05d5e6da12f1389d9e28d8896441aa0260ccb9d15c22f816cfc051b56825f401c63
|
7
|
+
data.tar.gz: 864302926b697fcf1216012333f63268b766a3e27741d392d05585f00adac6f7d60f0ef520a412b0dd377af6ca9e1f12ea90a0708fda41d5fb36005bd70bf61a
|
data/lib/avm/apps/version.rb
CHANGED
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.
|
4
|
+
version: 0.5.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-09-
|
11
|
+
date: 2021-09-25 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: eac_ruby_utils
|
@@ -45,14 +45,6 @@ extensions: []
|
|
45
45
|
extra_rdoc_files: []
|
46
46
|
files:
|
47
47
|
- lib/avm/apps.rb
|
48
|
-
- lib/avm/apps/config.rb
|
49
|
-
- lib/avm/apps/jobs.rb
|
50
|
-
- lib/avm/apps/jobs/base.rb
|
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
|
56
48
|
- lib/avm/apps/version.rb
|
57
49
|
homepage:
|
58
50
|
licenses: []
|
@@ -75,5 +67,5 @@ requirements: []
|
|
75
67
|
rubygems_version: 3.1.6
|
76
68
|
signing_key:
|
77
69
|
specification_version: 4
|
78
|
-
summary:
|
70
|
+
summary: 'DEPRECATED: use gem "avm" instead.'
|
79
71
|
test_files: []
|
data/lib/avm/apps/config.rb
DELETED
@@ -1,19 +0,0 @@
|
|
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
|
data/lib/avm/apps/jobs/base.rb
DELETED
@@ -1,64 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
require 'avm/apps/jobs/variables_source'
|
4
|
-
require 'eac_cli/core_ext'
|
5
|
-
|
6
|
-
module Avm
|
7
|
-
module Apps
|
8
|
-
module Jobs
|
9
|
-
module Base
|
10
|
-
common_concern do
|
11
|
-
include ::ActiveSupport::Callbacks
|
12
|
-
|
13
|
-
enable_speaker
|
14
|
-
enable_simple_cache
|
15
|
-
enable_listable
|
16
|
-
common_constructor :instance, :options, default: [{}] do
|
17
|
-
if option_list.present?
|
18
|
-
self.options = option_list.hash_keys_validate!(options.symbolize_keys)
|
19
|
-
end
|
20
|
-
end
|
21
|
-
define_callbacks(*jobs)
|
22
|
-
end
|
23
|
-
|
24
|
-
module ClassMethods
|
25
|
-
def jobs
|
26
|
-
const_get('JOBS').dup
|
27
|
-
end
|
28
|
-
end
|
29
|
-
|
30
|
-
module InstanceMethods
|
31
|
-
def option_list
|
32
|
-
nil
|
33
|
-
end
|
34
|
-
|
35
|
-
def run
|
36
|
-
start_banner if respond_to?(:start_banner)
|
37
|
-
run_jobs
|
38
|
-
::Avm::Result.success('Done!')
|
39
|
-
rescue ::Avm::Result::Error => e
|
40
|
-
e.to_result
|
41
|
-
end
|
42
|
-
|
43
|
-
def variables_source
|
44
|
-
::Avm::Apps::Jobs::VariablesSource.new(self, instance)
|
45
|
-
end
|
46
|
-
|
47
|
-
protected
|
48
|
-
|
49
|
-
def run_jobs
|
50
|
-
jobs.each do |job|
|
51
|
-
run_callbacks job do
|
52
|
-
send(job)
|
53
|
-
end
|
54
|
-
end
|
55
|
-
end
|
56
|
-
|
57
|
-
def jobs
|
58
|
-
self.class.jobs
|
59
|
-
end
|
60
|
-
end
|
61
|
-
end
|
62
|
-
end
|
63
|
-
end
|
64
|
-
end
|
@@ -1,24 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
require 'eac_ruby_utils/core_ext'
|
4
|
-
|
5
|
-
module Avm
|
6
|
-
module Apps
|
7
|
-
module Jobs
|
8
|
-
class VariablesSource
|
9
|
-
common_constructor :job, :instance
|
10
|
-
|
11
|
-
def read_entry(path, options = {})
|
12
|
-
entry_from_job(path) || instance.read_entry(path, options)
|
13
|
-
end
|
14
|
-
|
15
|
-
private
|
16
|
-
|
17
|
-
def entry_from_job(path)
|
18
|
-
method = path.gsub('.', '_').underscore
|
19
|
-
return job.send(method) if job.respond_to?(method, true)
|
20
|
-
end
|
21
|
-
end
|
22
|
-
end
|
23
|
-
end
|
24
|
-
end
|
data/lib/avm/apps/jobs.rb
DELETED
@@ -1,18 +0,0 @@
|
|
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
|
@@ -1,26 +0,0 @@
|
|
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
|
@@ -1,29 +0,0 @@
|
|
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
|
@@ -1,57 +0,0 @@
|
|
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
|