avm-tools 0.96.0 → 0.97.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 +4 -4
- data/lib/avm/app_src.rb +3 -3
- data/lib/avm/eac_asciidoctor_base0/deploy.rb +5 -5
- data/lib/avm/git/issue/complete/_test.rb +2 -2
- data/lib/avm/patches/eac_ruby_gems_utils/gem.rb +2 -2
- data/lib/avm/ruby/rubocop/_configured.rb +2 -2
- data/lib/avm/tools/runner/app_src/eac_asciidoctor_base0/build.rb +17 -4
- data/lib/avm/tools/version.rb +1 -1
- data/vendor/avm-apps/lib/avm/apps/sources/configuration.rb +57 -0
- data/vendor/avm-apps/lib/avm/apps/sources/configuration/_locale.rb +18 -0
- data/vendor/avm-apps/lib/avm/apps/sources/configuration/_rubocop.rb +26 -0
- data/vendor/avm-apps/lib/avm/apps/sources/configuration/_tests.rb +29 -0
- data/vendor/avm-apps/lib/avm/apps/version.rb +1 -1
- data/vendor/avm-eac_asciidoctor_base0/Gemfile +5 -0
- data/vendor/avm-eac_asciidoctor_base0/avm-eac_asciidoctor_base0.gemspec +19 -0
- data/vendor/avm-eac_asciidoctor_base0/lib/avm/eac_asciidoctor_base0.rb +9 -0
- data/{lib/avm/eac_asciidoctor_base0/project.rb → vendor/avm-eac_asciidoctor_base0/lib/avm/eac_asciidoctor_base0/sources.rb} +2 -4
- data/vendor/avm-eac_asciidoctor_base0/lib/avm/eac_asciidoctor_base0/sources/base.rb +15 -0
- data/vendor/avm-eac_asciidoctor_base0/lib/avm/eac_asciidoctor_base0/sources/build.rb +49 -0
- data/vendor/avm-eac_asciidoctor_base0/lib/avm/eac_asciidoctor_base0/sources/build/file.rb +30 -0
- data/vendor/avm-eac_asciidoctor_base0/lib/avm/eac_asciidoctor_base0/version.rb +7 -0
- data/vendor/avm-eac_asciidoctor_base0/spec/rubocop_spec.rb +3 -0
- data/vendor/avm-eac_asciidoctor_base0/spec/spec_helper.rb +102 -0
- data/vendor/eac_ruby_gems_utils/eac_ruby_gems_utils.gemspec +3 -2
- data/vendor/eac_ruby_gems_utils/lib/eac_ruby_gems_utils/version.rb +1 -1
- metadata +30 -9
- data/lib/avm/eac_asciidoctor_base0/build.rb +0 -47
- data/lib/avm/eac_asciidoctor_base0/build/file.rb +0 -28
- data/lib/avm/instances/configuration.rb +0 -55
- data/lib/avm/instances/configuration/_locale.rb +0 -16
- data/lib/avm/instances/configuration/_rubocop.rb +0 -24
- data/lib/avm/instances/configuration/_tests.rb +0 -27
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 1f1e0a305ededda2855b91810dc19b61599d5160877ec4ce3ed6f30fef7fba53
|
|
4
|
+
data.tar.gz: 30b9f99be2526baec4a9f9c47717689a7addbfb554d81f7d8100aafbf4fb9e7b
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 01aad2b75c533011cca20448bb5df00608d43124c905844d1f7c3bf9aa3a8f2c23258e3ad630df9c8fe32591f4d7e620253f9e7e2724e8ffebe89dcbc049c992
|
|
7
|
+
data.tar.gz: e94c3356ab0c629d8ba0c02e091fdb2da88cb9c4441142be581628abe2585e02af117177c255a436e64a1d7010ed0e3ce985ac25d689e17b84ecb473cd329af6
|
data/lib/avm/app_src.rb
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# frozen_string_literal: true
|
|
2
2
|
|
|
3
|
-
require 'avm/
|
|
3
|
+
require 'avm/apps/sources/configuration'
|
|
4
4
|
require 'eac_launcher/paths/real'
|
|
5
5
|
require 'eac_ruby_utils/core_ext'
|
|
6
6
|
require 'avm/projects/stereotypes'
|
|
@@ -32,9 +32,9 @@ module Avm
|
|
|
32
32
|
|
|
33
33
|
private
|
|
34
34
|
|
|
35
|
-
# @return [Avm::
|
|
35
|
+
# @return [Avm::Apps::Sources::Configuration]
|
|
36
36
|
def configuration_uncached
|
|
37
|
-
::Avm::
|
|
37
|
+
::Avm::Apps::Sources::Configuration.find_in_path(path)
|
|
38
38
|
end
|
|
39
39
|
|
|
40
40
|
def run_stereotype_job(stereotype, job, job_args)
|
|
@@ -1,23 +1,23 @@
|
|
|
1
1
|
# frozen_string_literal: true
|
|
2
2
|
|
|
3
3
|
require 'avm/eac_webapp_base0/deploy'
|
|
4
|
-
require 'avm/eac_asciidoctor_base0/
|
|
5
|
-
require 'avm/eac_asciidoctor_base0/build'
|
|
4
|
+
require 'avm/eac_asciidoctor_base0/sources/base'
|
|
5
|
+
require 'avm/eac_asciidoctor_base0/sources/build'
|
|
6
6
|
|
|
7
7
|
module Avm
|
|
8
8
|
module EacAsciidoctorBase0
|
|
9
9
|
class Deploy < ::Avm::EacWebappBase0::Deploy
|
|
10
10
|
def build_content
|
|
11
|
-
::Avm::EacAsciidoctorBase0::Build.new(
|
|
11
|
+
::Avm::EacAsciidoctorBase0::Sources::Build.new(
|
|
12
12
|
project,
|
|
13
|
-
::Avm::EacAsciidoctorBase0::Build::OPTION_TARGET_DIRECTORY => build_dir
|
|
13
|
+
::Avm::EacAsciidoctorBase0::Sources::Build::OPTION_TARGET_DIRECTORY => build_dir
|
|
14
14
|
).run
|
|
15
15
|
end
|
|
16
16
|
|
|
17
17
|
private
|
|
18
18
|
|
|
19
19
|
def project_uncached
|
|
20
|
-
::Avm::EacAsciidoctorBase0::
|
|
20
|
+
::Avm::EacAsciidoctorBase0::Sources::Base.new(
|
|
21
21
|
instance.source_instance.read_entry(::Avm::Instances::EntryKeys::FS_PATH)
|
|
22
22
|
)
|
|
23
23
|
end
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# frozen_string_literal: true
|
|
2
2
|
|
|
3
|
-
require 'avm/
|
|
3
|
+
require 'avm/apps/sources/configuration'
|
|
4
4
|
require 'avm/result'
|
|
5
5
|
require 'eac_ruby_utils/fs/temp'
|
|
6
6
|
|
|
@@ -35,7 +35,7 @@ module Avm
|
|
|
35
35
|
end
|
|
36
36
|
|
|
37
37
|
def configuration_uncached
|
|
38
|
-
::Avm::
|
|
38
|
+
::Avm::Apps::Sources::Configuration.find_by_path(@git)
|
|
39
39
|
end
|
|
40
40
|
end
|
|
41
41
|
end
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# frozen_string_literal: true
|
|
2
2
|
|
|
3
|
-
require 'avm/
|
|
3
|
+
require 'avm/apps/sources/configuration'
|
|
4
4
|
require 'eac_ruby_gems_utils/gem'
|
|
5
5
|
require 'eac_ruby_utils/core_ext'
|
|
6
6
|
|
|
@@ -13,7 +13,7 @@ module Avm
|
|
|
13
13
|
private
|
|
14
14
|
|
|
15
15
|
def configuration_uncached
|
|
16
|
-
::Avm::
|
|
16
|
+
::Avm::Apps::Sources::Configuration.find_in_path(root)
|
|
17
17
|
end
|
|
18
18
|
|
|
19
19
|
def gemfile_path_uncached
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# frozen_string_literal: true
|
|
2
2
|
|
|
3
|
-
require 'avm/
|
|
3
|
+
require 'avm/apps/sources/configuration'
|
|
4
4
|
|
|
5
5
|
module Avm
|
|
6
6
|
module Ruby
|
|
@@ -22,7 +22,7 @@ module Avm
|
|
|
22
22
|
private
|
|
23
23
|
|
|
24
24
|
def configuration_uncached
|
|
25
|
-
::Avm::
|
|
25
|
+
::Avm::Apps::Sources::Configuration.find_by_path(base_path)
|
|
26
26
|
end
|
|
27
27
|
end
|
|
28
28
|
end
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
# frozen_string_literal: true
|
|
2
2
|
|
|
3
3
|
require 'avm/core_ext'
|
|
4
|
-
require 'avm/eac_asciidoctor_base0/build'
|
|
5
|
-
require '
|
|
4
|
+
require 'avm/eac_asciidoctor_base0/sources/build'
|
|
5
|
+
require 'os'
|
|
6
6
|
|
|
7
7
|
module Avm
|
|
8
8
|
module Tools
|
|
@@ -13,24 +13,37 @@ module Avm
|
|
|
13
13
|
runner_with :help do
|
|
14
14
|
desc 'Build the project'
|
|
15
15
|
arg_opt '-d', '--target-dir', 'Directory to build'
|
|
16
|
+
bool_opt '--open', 'Show the result.'
|
|
16
17
|
end
|
|
17
18
|
|
|
18
19
|
def run
|
|
19
20
|
start_banner
|
|
20
21
|
build.run
|
|
22
|
+
open
|
|
21
23
|
end
|
|
22
24
|
|
|
23
25
|
private
|
|
24
26
|
|
|
25
27
|
def build_uncached
|
|
26
|
-
::Avm::EacAsciidoctorBase0::Build.new(runner_context.call(:project),
|
|
27
|
-
|
|
28
|
+
::Avm::EacAsciidoctorBase0::Sources::Build.new(runner_context.call(:project),
|
|
29
|
+
target_directory: parsed.target_dir)
|
|
28
30
|
end
|
|
29
31
|
|
|
30
32
|
def default_target_directory
|
|
31
33
|
runner_context.call(:project).root.join('build')
|
|
32
34
|
end
|
|
33
35
|
|
|
36
|
+
def open
|
|
37
|
+
return unless parsed.open?
|
|
38
|
+
|
|
39
|
+
infom "Opening \"#{open_path}\"..."
|
|
40
|
+
::EacRubyUtils::Envs.local.command(OS.open_file_command, open_path).system!
|
|
41
|
+
end
|
|
42
|
+
|
|
43
|
+
def open_path
|
|
44
|
+
build.source_files.first.target_path
|
|
45
|
+
end
|
|
46
|
+
|
|
34
47
|
def start_banner
|
|
35
48
|
runner_context.call(:project_banner)
|
|
36
49
|
infov 'Target directory', build.target_directory
|
data/lib/avm/tools/version.rb
CHANGED
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
require 'eac_ruby_utils/configs'
|
|
4
|
+
require 'eac_ruby_utils/core_ext'
|
|
5
|
+
require 'yaml'
|
|
6
|
+
|
|
7
|
+
module Avm
|
|
8
|
+
module Apps
|
|
9
|
+
module Sources
|
|
10
|
+
class Configuration < ::EacRubyUtils::Configs
|
|
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 < ::EacRubyUtils::Configs
|
|
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 < ::EacRubyUtils::Configs
|
|
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 < ::EacRubyUtils::Configs
|
|
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
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
$LOAD_PATH.push File.expand_path('lib', __dir__)
|
|
4
|
+
|
|
5
|
+
require 'avm/eac_asciidoctor_base0/version'
|
|
6
|
+
|
|
7
|
+
Gem::Specification.new do |s|
|
|
8
|
+
s.name = 'avm-eac_asciidoctor_base0'
|
|
9
|
+
s.version = Avm::EacAsciidoctorBase0::VERSION
|
|
10
|
+
s.authors = ['Put here the authors']
|
|
11
|
+
s.summary = 'Put here de description.'
|
|
12
|
+
|
|
13
|
+
s.files = Dir['{lib}/**/*']
|
|
14
|
+
|
|
15
|
+
s.add_dependency 'eac_ruby_utils', '~> 0.63'
|
|
16
|
+
s.add_dependency 'rouge', '~> 3.26'
|
|
17
|
+
|
|
18
|
+
s.add_development_dependency 'eac_ruby_gem_support', '~> 0.2'
|
|
19
|
+
end
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
require 'eac_ruby_utils/core_ext'
|
|
4
|
+
require 'eac_ruby_utils/fs/clearable_directory'
|
|
5
|
+
|
|
6
|
+
module Avm
|
|
7
|
+
module EacAsciidoctorBase0
|
|
8
|
+
module Sources
|
|
9
|
+
class Build
|
|
10
|
+
require_sub __FILE__
|
|
11
|
+
enable_console_speaker
|
|
12
|
+
enable_simple_cache
|
|
13
|
+
enable_listable
|
|
14
|
+
lists.add_symbol :option, :target_directory
|
|
15
|
+
common_constructor :project, :options, default: [{}] do
|
|
16
|
+
self.options = self.class.lists.option.hash_keys_validate!(options.symbolize_keys)
|
|
17
|
+
end
|
|
18
|
+
|
|
19
|
+
SOURCE_EXTNAMES = %w[.adoc .asc].freeze
|
|
20
|
+
|
|
21
|
+
def run
|
|
22
|
+
infov 'Files to build', source_files.count
|
|
23
|
+
target_directory.clear
|
|
24
|
+
source_files.each(&:run)
|
|
25
|
+
end
|
|
26
|
+
|
|
27
|
+
def default_target_directory
|
|
28
|
+
project.root.join('build')
|
|
29
|
+
end
|
|
30
|
+
|
|
31
|
+
def target_directory
|
|
32
|
+
::EacRubyUtils::Fs::ClearableDirectory.new(
|
|
33
|
+
options[OPTION_TARGET_DIRECTORY] || default_target_directory
|
|
34
|
+
)
|
|
35
|
+
end
|
|
36
|
+
|
|
37
|
+
def source_files_uncached
|
|
38
|
+
r = []
|
|
39
|
+
project.root.children.each do |child|
|
|
40
|
+
next unless SOURCE_EXTNAMES.include?(child.extname)
|
|
41
|
+
|
|
42
|
+
r << ::Avm::EacAsciidoctorBase0::Sources::Build::File.new(self, child.basename)
|
|
43
|
+
end
|
|
44
|
+
r
|
|
45
|
+
end
|
|
46
|
+
end
|
|
47
|
+
end
|
|
48
|
+
end
|
|
49
|
+
end
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
require 'asciidoctor'
|
|
4
|
+
|
|
5
|
+
module Avm
|
|
6
|
+
module EacAsciidoctorBase0
|
|
7
|
+
module Sources
|
|
8
|
+
class Build
|
|
9
|
+
class File
|
|
10
|
+
enable_console_speaker
|
|
11
|
+
common_constructor :build, :subpath
|
|
12
|
+
|
|
13
|
+
def run
|
|
14
|
+
infov 'Building', subpath
|
|
15
|
+
::Asciidoctor.convert_file source_path.to_path,
|
|
16
|
+
to_file: target_path.to_path, safe: :unsafe, mkdirs: true
|
|
17
|
+
end
|
|
18
|
+
|
|
19
|
+
def source_path
|
|
20
|
+
build.project.root.join(subpath)
|
|
21
|
+
end
|
|
22
|
+
|
|
23
|
+
def target_path
|
|
24
|
+
build.target_directory.join(subpath).basename_sub('.*') { |b| "#{b}.html" }
|
|
25
|
+
end
|
|
26
|
+
end
|
|
27
|
+
end
|
|
28
|
+
end
|
|
29
|
+
end
|
|
30
|
+
end
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
# This file was generated by the `rspec --init` command. Conventionally, all
|
|
4
|
+
# specs live under a `spec` directory, which RSpec adds to the `$LOAD_PATH`.
|
|
5
|
+
# The generated `.rspec` file contains `--require spec_helper` which will cause
|
|
6
|
+
# this file to always be loaded, without a need to explicitly require it in any
|
|
7
|
+
# files.
|
|
8
|
+
#
|
|
9
|
+
# Given that it is always loaded, you are encouraged to keep this file as
|
|
10
|
+
# light-weight as possible. Requiring heavyweight dependencies from this file
|
|
11
|
+
# will add to the boot time of your test suite on EVERY test run, even for an
|
|
12
|
+
# individual file that may not need all of that loaded. Instead, consider making
|
|
13
|
+
# a separate helper file that requires the additional dependencies and performs
|
|
14
|
+
# the additional setup, and require it from the spec files that actually need
|
|
15
|
+
# it.
|
|
16
|
+
#
|
|
17
|
+
# See http://rubydoc.info/gems/rspec-core/RSpec/Core/Configuration
|
|
18
|
+
RSpec.configure do |config|
|
|
19
|
+
# rspec-expectations config goes here. You can use an alternate
|
|
20
|
+
# assertion/expectation library such as wrong or the stdlib/minitest
|
|
21
|
+
# assertions if you prefer.
|
|
22
|
+
config.expect_with :rspec do |expectations|
|
|
23
|
+
# This option will default to `true` in RSpec 4. It makes the `description`
|
|
24
|
+
# and `failure_message` of custom matchers include text for helper methods
|
|
25
|
+
# defined using `chain`, e.g.:
|
|
26
|
+
# be_bigger_than(2).and_smaller_than(4).description
|
|
27
|
+
# # => "be bigger than 2 and smaller than 4"
|
|
28
|
+
# ...rather than:
|
|
29
|
+
# # => "be bigger than 2"
|
|
30
|
+
expectations.include_chain_clauses_in_custom_matcher_descriptions = true
|
|
31
|
+
end
|
|
32
|
+
|
|
33
|
+
# rspec-mocks config goes here. You can use an alternate test double
|
|
34
|
+
# library (such as bogus or mocha) by changing the `mock_with` option here.
|
|
35
|
+
config.mock_with :rspec do |mocks|
|
|
36
|
+
# Prevents you from mocking or stubbing a method that does not exist on
|
|
37
|
+
# a real object. This is generally recommended, and will default to
|
|
38
|
+
# `true` in RSpec 4.
|
|
39
|
+
mocks.verify_partial_doubles = true
|
|
40
|
+
end
|
|
41
|
+
|
|
42
|
+
# This option will default to `:apply_to_host_groups` in RSpec 4 (and will
|
|
43
|
+
# have no way to turn it off -- the option exists only for backwards
|
|
44
|
+
# compatibility in RSpec 3). It causes shared context metadata to be
|
|
45
|
+
# inherited by the metadata hash of host groups and examples, rather than
|
|
46
|
+
# triggering implicit auto-inclusion in groups with matching metadata.
|
|
47
|
+
config.shared_context_metadata_behavior = :apply_to_host_groups
|
|
48
|
+
|
|
49
|
+
# The settings below are suggested to provide a good initial experience
|
|
50
|
+
# with RSpec, but feel free to customize to your heart's content.
|
|
51
|
+
# # This allows you to limit a spec run to individual examples or groups
|
|
52
|
+
# # you care about by tagging them with `:focus` metadata. When nothing
|
|
53
|
+
# # is tagged with `:focus`, all examples get run. RSpec also provides
|
|
54
|
+
# # aliases for `it`, `describe`, and `context` that include `:focus`
|
|
55
|
+
# # metadata: `fit`, `fdescribe` and `fcontext`, respectively.
|
|
56
|
+
# config.filter_run_when_matching :focus
|
|
57
|
+
#
|
|
58
|
+
# # Allows RSpec to persist some state between runs in order to support
|
|
59
|
+
# # the `--only-failures` and `--next-failure` CLI options. We recommend
|
|
60
|
+
# # you configure your source control system to ignore this file.
|
|
61
|
+
# config.example_status_persistence_file_path = "spec/examples.txt"
|
|
62
|
+
#
|
|
63
|
+
# # Limits the available syntax to the non-monkey patched syntax that is
|
|
64
|
+
# # recommended. For more details, see:
|
|
65
|
+
# # - http://rspec.info/blog/2012/06/rspecs-new-expectation-syntax/
|
|
66
|
+
# # - http://www.teaisaweso.me/blog/2013/05/27/rspecs-new-message-expectation-syntax/
|
|
67
|
+
# # - http://rspec.info/blog/2014/05/notable-changes-in-rspec-3/#zero-monkey-patching-mode
|
|
68
|
+
# config.disable_monkey_patching!
|
|
69
|
+
#
|
|
70
|
+
# # This setting enables warnings. It's recommended, but in some cases may
|
|
71
|
+
# # be too noisy due to issues in dependencies.
|
|
72
|
+
# config.warnings = true
|
|
73
|
+
#
|
|
74
|
+
# # Many RSpec users commonly either run the entire suite or an individual
|
|
75
|
+
# # file, and it's useful to allow more verbose output when running an
|
|
76
|
+
# # individual spec file.
|
|
77
|
+
# if config.files_to_run.one?
|
|
78
|
+
# # Use the documentation formatter for detailed output,
|
|
79
|
+
# # unless a formatter has already been configured
|
|
80
|
+
# # (e.g. via a command-line flag).
|
|
81
|
+
# config.default_formatter = "doc"
|
|
82
|
+
# end
|
|
83
|
+
#
|
|
84
|
+
# # Print the 10 slowest examples and example groups at the
|
|
85
|
+
# # end of the spec run, to help surface which specs are running
|
|
86
|
+
# # particularly slow.
|
|
87
|
+
# config.profile_examples = 10
|
|
88
|
+
#
|
|
89
|
+
# # Run specs in random order to surface order dependencies. If you find an
|
|
90
|
+
# # order dependency and want to debug it, you can fix the order by providing
|
|
91
|
+
# # the seed, which is printed after each run.
|
|
92
|
+
# # --seed 1234
|
|
93
|
+
# config.order = :random
|
|
94
|
+
#
|
|
95
|
+
# # Seed global randomization in this process using the `--seed` CLI option.
|
|
96
|
+
# # Setting this allows you to use `--seed` to deterministically reproduce
|
|
97
|
+
# # test failures related to randomization by passing the same `--seed` value
|
|
98
|
+
# # as the one that triggered the failure.
|
|
99
|
+
# Kernel.srand config.seed
|
|
100
|
+
require 'eac_ruby_gem_support/rspec'
|
|
101
|
+
::EacRubyGemSupport::Rspec.setup(::File.expand_path('..', __dir__))
|
|
102
|
+
end
|
|
@@ -19,9 +19,10 @@ Gem::Specification.new do |s|
|
|
|
19
19
|
s.rdoc_options = ['--charset=UTF-8']
|
|
20
20
|
|
|
21
21
|
s.require_paths = ['lib']
|
|
22
|
-
s.files =
|
|
23
|
-
s.test_files =
|
|
22
|
+
s.files = Dir['{lib}/**/*', 'Gemfile']
|
|
23
|
+
s.test_files = Dir['{spec}/**/*', '.rspec']
|
|
24
24
|
|
|
25
|
+
s.add_dependency 'bundler', '~> 2.2', '>= 2.2.17'
|
|
25
26
|
s.add_dependency 'eac_ruby_utils', '~> 0.29'
|
|
26
27
|
|
|
27
28
|
# Tests
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: avm-tools
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.
|
|
4
|
+
version: 0.97.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Esquilo Azul Company
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: exe
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2021-05-
|
|
11
|
+
date: 2021-05-14 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: aranha-parsers
|
|
@@ -258,6 +258,20 @@ dependencies:
|
|
|
258
258
|
- - ">="
|
|
259
259
|
- !ruby/object:Gem::Version
|
|
260
260
|
version: '0'
|
|
261
|
+
- !ruby/object:Gem::Dependency
|
|
262
|
+
name: os
|
|
263
|
+
requirement: !ruby/object:Gem::Requirement
|
|
264
|
+
requirements:
|
|
265
|
+
- - ">="
|
|
266
|
+
- !ruby/object:Gem::Version
|
|
267
|
+
version: '0'
|
|
268
|
+
type: :runtime
|
|
269
|
+
prerelease: false
|
|
270
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
271
|
+
requirements:
|
|
272
|
+
- - ">="
|
|
273
|
+
- !ruby/object:Gem::Version
|
|
274
|
+
version: '0'
|
|
261
275
|
- !ruby/object:Gem::Dependency
|
|
262
276
|
name: ruby-progressbar
|
|
263
277
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -309,11 +323,8 @@ files:
|
|
|
309
323
|
- lib/avm/eac_asciidoctor_base0.rb
|
|
310
324
|
- lib/avm/eac_asciidoctor_base0/apache_host.rb
|
|
311
325
|
- lib/avm/eac_asciidoctor_base0/apache_path.rb
|
|
312
|
-
- lib/avm/eac_asciidoctor_base0/build.rb
|
|
313
|
-
- lib/avm/eac_asciidoctor_base0/build/file.rb
|
|
314
326
|
- lib/avm/eac_asciidoctor_base0/deploy.rb
|
|
315
327
|
- lib/avm/eac_asciidoctor_base0/instance.rb
|
|
316
|
-
- lib/avm/eac_asciidoctor_base0/project.rb
|
|
317
328
|
- lib/avm/eac_rails_base0.rb
|
|
318
329
|
- lib/avm/eac_rails_base0/apache_host.rb
|
|
319
330
|
- lib/avm/eac_rails_base0/apache_path.rb
|
|
@@ -455,10 +466,6 @@ files:
|
|
|
455
466
|
- lib/avm/instances/base/auto_values/web.rb
|
|
456
467
|
- lib/avm/instances/base/dockerizable.rb
|
|
457
468
|
- lib/avm/instances/base/entry_keys.rb
|
|
458
|
-
- lib/avm/instances/configuration.rb
|
|
459
|
-
- lib/avm/instances/configuration/_locale.rb
|
|
460
|
-
- lib/avm/instances/configuration/_rubocop.rb
|
|
461
|
-
- lib/avm/instances/configuration/_tests.rb
|
|
462
469
|
- lib/avm/instances/entries.rb
|
|
463
470
|
- lib/avm/instances/entry.rb
|
|
464
471
|
- lib/avm/instances/entry_keys.rb
|
|
@@ -656,9 +663,23 @@ files:
|
|
|
656
663
|
- vendor/avm-apps/lib/avm/apps/jobs.rb
|
|
657
664
|
- vendor/avm-apps/lib/avm/apps/jobs/base.rb
|
|
658
665
|
- vendor/avm-apps/lib/avm/apps/jobs/variables_source.rb
|
|
666
|
+
- vendor/avm-apps/lib/avm/apps/sources/configuration.rb
|
|
667
|
+
- vendor/avm-apps/lib/avm/apps/sources/configuration/_locale.rb
|
|
668
|
+
- vendor/avm-apps/lib/avm/apps/sources/configuration/_rubocop.rb
|
|
669
|
+
- vendor/avm-apps/lib/avm/apps/sources/configuration/_tests.rb
|
|
659
670
|
- vendor/avm-apps/lib/avm/apps/version.rb
|
|
660
671
|
- vendor/avm-apps/spec/rubocop_spec.rb
|
|
661
672
|
- vendor/avm-apps/spec/spec_helper.rb
|
|
673
|
+
- vendor/avm-eac_asciidoctor_base0/Gemfile
|
|
674
|
+
- vendor/avm-eac_asciidoctor_base0/avm-eac_asciidoctor_base0.gemspec
|
|
675
|
+
- vendor/avm-eac_asciidoctor_base0/lib/avm/eac_asciidoctor_base0.rb
|
|
676
|
+
- vendor/avm-eac_asciidoctor_base0/lib/avm/eac_asciidoctor_base0/sources.rb
|
|
677
|
+
- vendor/avm-eac_asciidoctor_base0/lib/avm/eac_asciidoctor_base0/sources/base.rb
|
|
678
|
+
- vendor/avm-eac_asciidoctor_base0/lib/avm/eac_asciidoctor_base0/sources/build.rb
|
|
679
|
+
- vendor/avm-eac_asciidoctor_base0/lib/avm/eac_asciidoctor_base0/sources/build/file.rb
|
|
680
|
+
- vendor/avm-eac_asciidoctor_base0/lib/avm/eac_asciidoctor_base0/version.rb
|
|
681
|
+
- vendor/avm-eac_asciidoctor_base0/spec/rubocop_spec.rb
|
|
682
|
+
- vendor/avm-eac_asciidoctor_base0/spec/spec_helper.rb
|
|
662
683
|
- vendor/eac_cli/Gemfile
|
|
663
684
|
- vendor/eac_cli/eac_cli.gemspec
|
|
664
685
|
- vendor/eac_cli/lib/eac_cli.rb
|
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
# frozen_string_literal: true
|
|
2
|
-
|
|
3
|
-
require 'eac_ruby_utils/core_ext'
|
|
4
|
-
require 'eac_ruby_utils/fs/clearable_directory'
|
|
5
|
-
|
|
6
|
-
module Avm
|
|
7
|
-
module EacAsciidoctorBase0
|
|
8
|
-
class Build
|
|
9
|
-
require_sub __FILE__
|
|
10
|
-
enable_console_speaker
|
|
11
|
-
enable_simple_cache
|
|
12
|
-
enable_listable
|
|
13
|
-
lists.add_symbol :option, :target_directory
|
|
14
|
-
common_constructor :project, :options, default: [{}] do
|
|
15
|
-
self.options = self.class.lists.option.hash_keys_validate!(options.symbolize_keys)
|
|
16
|
-
end
|
|
17
|
-
|
|
18
|
-
SOURCE_EXTNAMES = %w[.adoc .asc].freeze
|
|
19
|
-
|
|
20
|
-
def run
|
|
21
|
-
infov 'Files to build', source_files.count
|
|
22
|
-
target_directory.clear
|
|
23
|
-
source_files.each(&:run)
|
|
24
|
-
end
|
|
25
|
-
|
|
26
|
-
def default_target_directory
|
|
27
|
-
project.root.join('build')
|
|
28
|
-
end
|
|
29
|
-
|
|
30
|
-
def target_directory
|
|
31
|
-
::EacRubyUtils::Fs::ClearableDirectory.new(
|
|
32
|
-
options[OPTION_TARGET_DIRECTORY] || default_target_directory
|
|
33
|
-
)
|
|
34
|
-
end
|
|
35
|
-
|
|
36
|
-
def source_files_uncached
|
|
37
|
-
r = []
|
|
38
|
-
project.root.children.each do |child|
|
|
39
|
-
next unless SOURCE_EXTNAMES.include?(child.extname)
|
|
40
|
-
|
|
41
|
-
r << ::Avm::EacAsciidoctorBase0::Build::File.new(self, child.basename)
|
|
42
|
-
end
|
|
43
|
-
r
|
|
44
|
-
end
|
|
45
|
-
end
|
|
46
|
-
end
|
|
47
|
-
end
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
# frozen_string_literal: true
|
|
2
|
-
|
|
3
|
-
require 'asciidoctor'
|
|
4
|
-
|
|
5
|
-
module Avm
|
|
6
|
-
module EacAsciidoctorBase0
|
|
7
|
-
class Build
|
|
8
|
-
class File
|
|
9
|
-
enable_console_speaker
|
|
10
|
-
common_constructor :build, :subpath
|
|
11
|
-
|
|
12
|
-
def run
|
|
13
|
-
infov 'Building', subpath
|
|
14
|
-
::Asciidoctor.convert_file source_path.to_path,
|
|
15
|
-
to_file: target_path.to_path, safe: :unsafe, mkdirs: true
|
|
16
|
-
end
|
|
17
|
-
|
|
18
|
-
def source_path
|
|
19
|
-
build.project.root.join(subpath)
|
|
20
|
-
end
|
|
21
|
-
|
|
22
|
-
def target_path
|
|
23
|
-
build.target_directory.join(subpath).basename_sub('.*') { |b| "#{b}.html" }
|
|
24
|
-
end
|
|
25
|
-
end
|
|
26
|
-
end
|
|
27
|
-
end
|
|
28
|
-
end
|
|
@@ -1,55 +0,0 @@
|
|
|
1
|
-
# frozen_string_literal: true
|
|
2
|
-
|
|
3
|
-
require 'eac_ruby_utils/configs'
|
|
4
|
-
require 'eac_ruby_utils/core_ext'
|
|
5
|
-
require 'yaml'
|
|
6
|
-
|
|
7
|
-
module Avm
|
|
8
|
-
module Instances
|
|
9
|
-
class Configuration < ::EacRubyUtils::Configs
|
|
10
|
-
require_sub __FILE__
|
|
11
|
-
|
|
12
|
-
FILENAMES = %w[.avm.yml .avm.yaml].freeze
|
|
13
|
-
|
|
14
|
-
class << self
|
|
15
|
-
def find_by_path(path)
|
|
16
|
-
path = ::Pathname.new(path.to_s) unless path.is_a?(::Pathname)
|
|
17
|
-
internal_find_path(path.expand_path)
|
|
18
|
-
end
|
|
19
|
-
|
|
20
|
-
def find_in_path(path)
|
|
21
|
-
absolute_pathname = path.to_pathname.expand_path
|
|
22
|
-
if absolute_pathname.directory?
|
|
23
|
-
FILENAMES.each do |filename|
|
|
24
|
-
file = absolute_pathname.join(filename)
|
|
25
|
-
return new(file) if file.exist?
|
|
26
|
-
end
|
|
27
|
-
end
|
|
28
|
-
nil
|
|
29
|
-
end
|
|
30
|
-
|
|
31
|
-
private
|
|
32
|
-
|
|
33
|
-
def internal_find_path(absolute_pathname)
|
|
34
|
-
r = find_in_path(absolute_pathname)
|
|
35
|
-
return r if r.present?
|
|
36
|
-
|
|
37
|
-
internal_find_path(absolute_pathname.dirname) unless absolute_pathname.root?
|
|
38
|
-
end
|
|
39
|
-
end
|
|
40
|
-
|
|
41
|
-
def initialize(path)
|
|
42
|
-
super(nil, storage_path: path)
|
|
43
|
-
end
|
|
44
|
-
|
|
45
|
-
# Utility to read a configuration as a [EacRubyUtils::Envs::Command].
|
|
46
|
-
# @return [EacRubyUtils::Envs::Command]
|
|
47
|
-
def read_command(key)
|
|
48
|
-
read_entry(key).if_present do |v|
|
|
49
|
-
args = v.is_a?(::Enumerable) ? v.map(&:to_s) : ::Shellwords.split(v)
|
|
50
|
-
::EacRubyUtils::Envs.local.command(args).chdir(::File.dirname(storage_path))
|
|
51
|
-
end
|
|
52
|
-
end
|
|
53
|
-
end
|
|
54
|
-
end
|
|
55
|
-
end
|
|
@@ -1,16 +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 Instances
|
|
8
|
-
class Configuration < ::EacRubyUtils::Configs
|
|
9
|
-
LOCALE_KEY = :locale
|
|
10
|
-
|
|
11
|
-
def locale
|
|
12
|
-
read_entry(LOCALE_KEY) || ::I18n.default_locale
|
|
13
|
-
end
|
|
14
|
-
end
|
|
15
|
-
end
|
|
16
|
-
end
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
# frozen_string_literal: true
|
|
2
|
-
|
|
3
|
-
module Avm
|
|
4
|
-
module Instances
|
|
5
|
-
class Configuration < ::EacRubyUtils::Configs
|
|
6
|
-
RUBOCOP_COMMAND_KEY = 'ruby.rubocop.command'
|
|
7
|
-
RUBOCOP_GEMFILE_KEY = 'ruby.rubocop.gemfile'
|
|
8
|
-
|
|
9
|
-
def rubocop_command
|
|
10
|
-
read_command(RUBOCOP_COMMAND_KEY)
|
|
11
|
-
end
|
|
12
|
-
|
|
13
|
-
def rubocop_gemfile
|
|
14
|
-
gemfile_path = read_entry(RUBOCOP_GEMFILE_KEY)
|
|
15
|
-
return nil if gemfile_path.blank?
|
|
16
|
-
|
|
17
|
-
gemfile_path = gemfile_path.to_pathname.expand_path(storage_path.parent)
|
|
18
|
-
return gemfile_path if gemfile_path.file?
|
|
19
|
-
|
|
20
|
-
raise "Gemfile path \"#{gemfile_path}\" does not exist or is not a file"
|
|
21
|
-
end
|
|
22
|
-
end
|
|
23
|
-
end
|
|
24
|
-
end
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
# frozen_string_literal: true
|
|
2
|
-
|
|
3
|
-
require 'avm/patches/eac_ruby_gems_utils/gem'
|
|
4
|
-
|
|
5
|
-
module Avm
|
|
6
|
-
module Instances
|
|
7
|
-
class Configuration < ::EacRubyUtils::Configs
|
|
8
|
-
BUNDLE_TEST_COMMAND_KEY = 'test.bundle_command'
|
|
9
|
-
TEST_COMMAND_KEY = 'test.command'
|
|
10
|
-
|
|
11
|
-
def any_test_command
|
|
12
|
-
bundle_test_command || test_command
|
|
13
|
-
end
|
|
14
|
-
|
|
15
|
-
def test_command
|
|
16
|
-
read_command(TEST_COMMAND_KEY)
|
|
17
|
-
end
|
|
18
|
-
|
|
19
|
-
def bundle_test_command
|
|
20
|
-
read_entry(BUNDLE_TEST_COMMAND_KEY).if_present do |v|
|
|
21
|
-
args = v.is_a?(::Enumerable) ? v.map(&:to_s) : ::Shellwords.split(v)
|
|
22
|
-
::EacRubyGemsUtils::Gem.new(::File.dirname(storage_path)).bundle(*args).chdir_root
|
|
23
|
-
end
|
|
24
|
-
end
|
|
25
|
-
end
|
|
26
|
-
end
|
|
27
|
-
end
|