avm-tools 0.125.0 → 0.128.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (24) hide show
  1. checksums.yaml +4 -4
  2. data/lib/avm/tools/runner/source_generate.rb +45 -0
  3. data/lib/avm/tools/version.rb +1 -1
  4. metadata +5 -58
  5. data/lib/avm/tools/runner/app_src/eac_asciidoctor_base0/build.rb +0 -56
  6. data/lib/avm/tools/runner/app_src/eac_asciidoctor_base0.rb +0 -14
  7. data/lib/avm/tools/runner/eac_asciidoctor_base0.rb +0 -14
  8. data/sub/avm-eac_asciidoctor_base0/Gemfile +0 -5
  9. data/sub/avm-eac_asciidoctor_base0/avm-eac_asciidoctor_base0.gemspec +0 -22
  10. data/sub/avm-eac_asciidoctor_base0/lib/avm/eac_asciidoctor_base0/apache_host.rb +0 -17
  11. data/sub/avm-eac_asciidoctor_base0/lib/avm/eac_asciidoctor_base0/apache_path.rb +0 -10
  12. data/sub/avm-eac_asciidoctor_base0/lib/avm/eac_asciidoctor_base0/deploy.rb +0 -26
  13. data/sub/avm-eac_asciidoctor_base0/lib/avm/eac_asciidoctor_base0/instance.rb +0 -11
  14. data/sub/avm-eac_asciidoctor_base0/lib/avm/eac_asciidoctor_base0/sources/base.rb +0 -16
  15. data/sub/avm-eac_asciidoctor_base0/lib/avm/eac_asciidoctor_base0/sources/build/file.rb +0 -30
  16. data/sub/avm-eac_asciidoctor_base0/lib/avm/eac_asciidoctor_base0/sources/build.rb +0 -49
  17. data/sub/avm-eac_asciidoctor_base0/lib/avm/eac_asciidoctor_base0/sources/runner/build.rb +0 -54
  18. data/sub/avm-eac_asciidoctor_base0/lib/avm/eac_asciidoctor_base0/sources/runner.rb +0 -30
  19. data/sub/avm-eac_asciidoctor_base0/lib/avm/eac_asciidoctor_base0/sources.rb +0 -11
  20. data/sub/avm-eac_asciidoctor_base0/lib/avm/eac_asciidoctor_base0/version.rb +0 -7
  21. data/sub/avm-eac_asciidoctor_base0/lib/avm/eac_asciidoctor_base0.rb +0 -9
  22. data/sub/avm-eac_asciidoctor_base0/spec/lib/avm/eac_asciidoctor_base0/sources/base_spec.rb +0 -7
  23. data/sub/avm-eac_asciidoctor_base0/spec/rubocop_spec.rb +0 -3
  24. data/sub/avm-eac_asciidoctor_base0/spec/spec_helper.rb +0 -4
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: ec6a01dc5543c0357fec16954454c2cf11f58f0cb3050a65708f0cac8654bf2d
4
- data.tar.gz: f3018fcfb1a77e24d702c6a0b243a29c720ef50231a4701d637ff56860f21899
3
+ metadata.gz: 6ff543c81075b05fc36026ebf846a18cd02bdb676d5e0804b5f8ca04407061e6
4
+ data.tar.gz: 5d062152d295650cd50350af794e1b8f68a46a4bc8b99e57d07f5ecd4cf3c9ea
5
5
  SHA512:
6
- metadata.gz: aca9d07857cc1895551ba4b5cc7d76b8b5011faac5db8299279ffbf2557b87d57d2b610dbfe6cd922bdad87103b88fd8fa17e339ab533a469bb204c095452981
7
- data.tar.gz: 59a08cf9fc751507296d351d0eb45c972ec399df96c7bb327b65b0968880afbf8ea3292d067d14b6dcf35e38938e61419a1a25b66cacdf30b0833aad7a37fb7d
6
+ metadata.gz: 6cf307e0f5aacee2bb4baa733624e6b5a863c6c0ab9f39c876945a71a565680b97d19988a0c5069eead74cd8c7b1d56170911b06f784cb83637cfce1ff514ee2
7
+ data.tar.gz: 72d3cc6311ca19cb93b59c67afedb62556cf6976f0dd7c148ba204d769ec4e0393370eb6788c20b776e1626572a7a1df3dbb80869e0307cb5084e61db3ab94b1
@@ -0,0 +1,45 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'avm/runners/base'
4
+ require 'eac_cli/core_ext'
5
+
6
+ module Avm
7
+ module Tools
8
+ class Runner
9
+ class SourceGenerate
10
+ runner_with :help do
11
+ pos_arg :stereotype_name
12
+ pos_arg :target_path
13
+ end
14
+
15
+ def run
16
+ start_banner
17
+ generate
18
+ end
19
+
20
+ def generate
21
+ infom 'Generating...'
22
+ generator.perform
23
+ success "Source generated in \"#{generator.target_path}\""
24
+ end
25
+
26
+ def start_banner
27
+ infov 'Stereotype', stereotype_name
28
+ infov 'Target path', target_path
29
+ infov 'Generator', generator.class
30
+ end
31
+
32
+ def generator_uncached
33
+ ::Avm::Registry.source_generators.detect_optional(stereotype_name, target_path) ||
34
+ fatal_error("No generator found for stereotype \"#{stereotype_name}\"")
35
+ end
36
+
37
+ delegate :stereotype_name, to: :parsed
38
+
39
+ def target_path
40
+ parsed.target_path.to_pathname
41
+ end
42
+ end
43
+ end
44
+ end
45
+ end
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Avm
4
4
  module Tools
5
- VERSION = '0.125.0'
5
+ VERSION = '0.128.0'
6
6
  end
7
7
  end
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.125.0
4
+ version: 0.128.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: 2022-07-26 00:00:00.000000000 Z
11
+ date: 2022-08-04 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: aranha-parsers
@@ -30,48 +30,14 @@ dependencies:
30
30
  requirements:
31
31
  - - "~>"
32
32
  - !ruby/object:Gem::Version
33
- version: '0.27'
33
+ version: '0.30'
34
34
  type: :runtime
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
38
  - - "~>"
39
39
  - !ruby/object:Gem::Version
40
- version: '0.27'
41
- - !ruby/object:Gem::Dependency
42
- name: avm-eac_asciidoctor_base0
43
- requirement: !ruby/object:Gem::Requirement
44
- requirements:
45
- - - "~>"
46
- - !ruby/object:Gem::Version
47
- version: '0.3'
48
- - - ">="
49
- - !ruby/object:Gem::Version
50
- version: 0.3.4
51
- type: :runtime
52
- prerelease: false
53
- version_requirements: !ruby/object:Gem::Requirement
54
- requirements:
55
- - - "~>"
56
- - !ruby/object:Gem::Version
57
- version: '0.3'
58
- - - ">="
59
- - !ruby/object:Gem::Version
60
- version: 0.3.4
61
- - !ruby/object:Gem::Dependency
62
- name: avm-eac_rails_base0
63
- requirement: !ruby/object:Gem::Requirement
64
- requirements:
65
- - - "~>"
66
- - !ruby/object:Gem::Version
67
- version: '0.3'
68
- type: :runtime
69
- prerelease: false
70
- version_requirements: !ruby/object:Gem::Requirement
71
- requirements:
72
- - - "~>"
73
- - !ruby/object:Gem::Version
74
- version: '0.3'
40
+ version: '0.30'
75
41
  - !ruby/object:Gem::Dependency
76
42
  name: avm-eac_ruby_base1
77
43
  requirement: !ruby/object:Gem::Requirement
@@ -333,8 +299,6 @@ files:
333
299
  - lib/avm/tools/core_ext.rb
334
300
  - lib/avm/tools/runner.rb
335
301
  - lib/avm/tools/runner/app_src.rb
336
- - lib/avm/tools/runner/app_src/eac_asciidoctor_base0.rb
337
- - lib/avm/tools/runner/app_src/eac_asciidoctor_base0/build.rb
338
302
  - lib/avm/tools/runner/app_src/eac_writings_base0.rb
339
303
  - lib/avm/tools/runner/app_src/eac_writings_base0/build_chapters.rb
340
304
  - lib/avm/tools/runner/app_src/eac_writings_base0/build_single.rb
@@ -355,7 +319,6 @@ files:
355
319
  - lib/avm/tools/runner/application_stereotypes/list.rb
356
320
  - lib/avm/tools/runner/config.rb
357
321
  - lib/avm/tools/runner/config/load_path.rb
358
- - lib/avm/tools/runner/eac_asciidoctor_base0.rb
359
322
  - lib/avm/tools/runner/eac_webapp_base0.rb
360
323
  - lib/avm/tools/runner/eac_wordpress_base0.rb
361
324
  - lib/avm/tools/runner/eac_writings_base0.rb
@@ -386,27 +349,11 @@ files:
386
349
  - lib/avm/tools/runner/self.rb
387
350
  - lib/avm/tools/runner/self/docker.rb
388
351
  - lib/avm/tools/runner/self/registry.rb
352
+ - lib/avm/tools/runner/source_generate.rb
389
353
  - lib/avm/tools/self.rb
390
354
  - lib/avm/tools/version.rb
391
355
  - locale/en.yml
392
356
  - locale/pt-BR.yml
393
- - sub/avm-eac_asciidoctor_base0/Gemfile
394
- - sub/avm-eac_asciidoctor_base0/avm-eac_asciidoctor_base0.gemspec
395
- - sub/avm-eac_asciidoctor_base0/lib/avm/eac_asciidoctor_base0.rb
396
- - sub/avm-eac_asciidoctor_base0/lib/avm/eac_asciidoctor_base0/apache_host.rb
397
- - sub/avm-eac_asciidoctor_base0/lib/avm/eac_asciidoctor_base0/apache_path.rb
398
- - sub/avm-eac_asciidoctor_base0/lib/avm/eac_asciidoctor_base0/deploy.rb
399
- - sub/avm-eac_asciidoctor_base0/lib/avm/eac_asciidoctor_base0/instance.rb
400
- - sub/avm-eac_asciidoctor_base0/lib/avm/eac_asciidoctor_base0/sources.rb
401
- - sub/avm-eac_asciidoctor_base0/lib/avm/eac_asciidoctor_base0/sources/base.rb
402
- - sub/avm-eac_asciidoctor_base0/lib/avm/eac_asciidoctor_base0/sources/build.rb
403
- - sub/avm-eac_asciidoctor_base0/lib/avm/eac_asciidoctor_base0/sources/build/file.rb
404
- - sub/avm-eac_asciidoctor_base0/lib/avm/eac_asciidoctor_base0/sources/runner.rb
405
- - sub/avm-eac_asciidoctor_base0/lib/avm/eac_asciidoctor_base0/sources/runner/build.rb
406
- - sub/avm-eac_asciidoctor_base0/lib/avm/eac_asciidoctor_base0/version.rb
407
- - sub/avm-eac_asciidoctor_base0/spec/lib/avm/eac_asciidoctor_base0/sources/base_spec.rb
408
- - sub/avm-eac_asciidoctor_base0/spec/rubocop_spec.rb
409
- - sub/avm-eac_asciidoctor_base0/spec/spec_helper.rb
410
357
  - sub/avm-eac_postgresql_base0/Gemfile
411
358
  - sub/avm-eac_postgresql_base0/avm-eac_postgresql_base0.gemspec
412
359
  - sub/avm-eac_postgresql_base0/lib/avm/eac_postgresql_base0.rb
@@ -1,56 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- require 'avm/tools/core_ext'
4
- require 'avm/eac_asciidoctor_base0/sources/build'
5
- require 'os'
6
-
7
- module Avm
8
- module Tools
9
- class Runner
10
- class AppSrc
11
- class EacAsciidoctorBase0
12
- class Build
13
- runner_with :help do
14
- desc 'Build the project'
15
- arg_opt '-d', '--target-dir', 'Directory to build'
16
- bool_opt '--open', 'Show the result.'
17
- end
18
-
19
- def run
20
- start_banner
21
- build.run
22
- open
23
- end
24
-
25
- private
26
-
27
- def build_uncached
28
- ::Avm::EacAsciidoctorBase0::Sources::Build.new(runner_context.call(:project),
29
- target_directory: parsed.target_dir)
30
- end
31
-
32
- def default_target_directory
33
- runner_context.call(:project).root.join('build')
34
- end
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
-
47
- def start_banner
48
- runner_context.call(:project_banner)
49
- infov 'Target directory', build.target_directory
50
- end
51
- end
52
- end
53
- end
54
- end
55
- end
56
- end
@@ -1,14 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- require 'avm/eac_asciidoctor_base0/sources/runner'
4
-
5
- module Avm
6
- module Tools
7
- class Runner
8
- class AppSrc
9
- class EacAsciidoctorBase0 < ::Avm::EacAsciidoctorBase0::Sources::Runner
10
- end
11
- end
12
- end
13
- end
14
- end
@@ -1,14 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- require 'avm/eac_webapp_base0/runner'
4
- require 'avm/eac_asciidoctor_base0'
5
-
6
- module Avm
7
- module Tools
8
- class Runner
9
- class EacAsciidoctorBase0 < ::Avm::EacWebappBase0::Runner
10
- require_sub __FILE__
11
- end
12
- end
13
- end
14
- end
@@ -1,5 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- source 'https://rubygems.org'
4
-
5
- gemspec
@@ -1,22 +0,0 @@
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,template}/**/*']
14
-
15
- s.add_dependency 'asciidoctor', '~> 2.0', '>= 2.0.12'
16
- s.add_dependency 'avm-eac_webapp_base0', '~> 0.2'
17
- s.add_dependency 'eac_ruby_utils', '~> 0.63'
18
- s.add_dependency 'os'
19
- s.add_dependency 'rouge', '~> 3.26'
20
-
21
- s.add_development_dependency 'eac_ruby_gem_support', '~> 0.2'
22
- end
@@ -1,17 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- require 'avm/eac_webapp_base0/apache_host'
4
-
5
- module Avm
6
- module EacAsciidoctorBase0
7
- class ApacheHost < ::Avm::EacWebappBase0::ApacheHost
8
- def document_root
9
- instance.read_entry(::Avm::Instances::EntryKeys::FS_PATH)
10
- end
11
-
12
- def extra_content
13
- ''
14
- end
15
- end
16
- end
17
- end
@@ -1,10 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- require 'avm/eac_webapp_base0/apache_path'
4
-
5
- module Avm
6
- module EacAsciidoctorBase0
7
- class ApachePath < ::Avm::EacWebappBase0::ApachePath
8
- end
9
- end
10
- end
@@ -1,26 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- require 'avm/eac_webapp_base0/deploy'
4
- require 'avm/eac_asciidoctor_base0/sources/base'
5
- require 'avm/eac_asciidoctor_base0/sources/build'
6
-
7
- module Avm
8
- module EacAsciidoctorBase0
9
- class Deploy < ::Avm::EacWebappBase0::Deploy
10
- def build_content
11
- ::Avm::EacAsciidoctorBase0::Sources::Build.new(
12
- project,
13
- ::Avm::EacAsciidoctorBase0::Sources::Build::OPTION_TARGET_DIRECTORY => build_dir
14
- ).run
15
- end
16
-
17
- private
18
-
19
- def project_uncached
20
- ::Avm::EacAsciidoctorBase0::Sources::Base.new(
21
- instance.source_instance.read_entry(::Avm::Instances::EntryKeys::FS_PATH)
22
- )
23
- end
24
- end
25
- end
26
- end
@@ -1,11 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- require 'avm/eac_webapp_base0/instance'
4
-
5
- module Avm
6
- module EacAsciidoctorBase0
7
- class Instance < ::Avm::EacWebappBase0::Instance
8
- FILES_UNITS = {}.freeze
9
- end
10
- end
11
- end
@@ -1,16 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- require 'avm/eac_webapp_base0/sources/base'
4
- require 'eac_ruby_utils/core_ext'
5
-
6
- module Avm
7
- module EacAsciidoctorBase0
8
- module Sources
9
- class Base < ::Avm::EacWebappBase0::Sources::Base
10
- def valid?
11
- false
12
- end
13
- end
14
- end
15
- end
16
- end
@@ -1,30 +0,0 @@
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_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.path.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
@@ -1,49 +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
- module Sources
9
- class Build
10
- require_sub __FILE__
11
- enable_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.path.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.path.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
@@ -1,54 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- require 'avm/eac_asciidoctor_base0/sources/build'
4
- require 'eac_ruby_base0/core_ext'
5
- require 'os'
6
-
7
- module Avm
8
- module EacAsciidoctorBase0
9
- module Sources
10
- class Runner
11
- class Build
12
- runner_with :help do
13
- desc 'Build the project'
14
- arg_opt '-d', '--target-dir', 'Directory to build'
15
- bool_opt '--open', 'Show the result.'
16
- end
17
-
18
- def run
19
- start_banner
20
- build.run
21
- open
22
- end
23
-
24
- private
25
-
26
- def build_uncached
27
- ::Avm::EacAsciidoctorBase0::Sources::Build.new(runner_context.call(:project),
28
- target_directory: parsed.target_dir)
29
- end
30
-
31
- def default_target_directory
32
- runner_context.call(:project).path.join('build')
33
- end
34
-
35
- def open
36
- return unless parsed.open?
37
-
38
- infom "Opening \"#{open_path}\"..."
39
- ::EacRubyUtils::Envs.local.command(OS.open_file_command, open_path).system!
40
- end
41
-
42
- def open_path
43
- build.source_files.first.target_path
44
- end
45
-
46
- def start_banner
47
- runner_context.call(:project_banner)
48
- infov 'Target directory', build.target_directory
49
- end
50
- end
51
- end
52
- end
53
- end
54
- end
@@ -1,30 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- require 'avm/eac_asciidoctor_base0/sources/base'
4
- require 'eac_ruby_base0/core_ext'
5
-
6
- module Avm
7
- module EacAsciidoctorBase0
8
- module Sources
9
- class Runner
10
- require_sub __FILE__
11
-
12
- runner_with :help, :subcommands do
13
- desc 'EacAsciidoctorBase0 utitilies for local projects.'
14
- subcommands
15
- end
16
-
17
- def project_banner
18
- infov 'Project', project.application.name
19
- infov 'Path', project.path
20
- end
21
-
22
- private
23
-
24
- def project_uncached
25
- ::Avm::EacAsciidoctorBase0::Sources::Base.new(runner_context.call(:instance_path))
26
- end
27
- end
28
- end
29
- end
30
- end
@@ -1,11 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- require 'eac_ruby_utils/core_ext'
4
-
5
- module Avm
6
- module EacAsciidoctorBase0
7
- module Sources
8
- require_sub __FILE__
9
- end
10
- end
11
- end
@@ -1,7 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- module Avm
4
- module EacAsciidoctorBase0
5
- VERSION = '0.3.4'
6
- end
7
- end
@@ -1,9 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- require 'eac_ruby_utils/core_ext'
4
-
5
- module Avm
6
- module EacAsciidoctorBase0
7
- require_sub __FILE__
8
- end
9
- end
@@ -1,7 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- require 'avm/eac_asciidoctor_base0/sources/base'
4
-
5
- ::RSpec.describe ::Avm::EacAsciidoctorBase0::Sources::Base do
6
- include_examples 'in_avm_registry', 'sources'
7
- end
@@ -1,3 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- ::EacRubyUtils::Rspec.default_setup.describe_rubocop
@@ -1,4 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- require 'eac_ruby_utils/rspec/default_setup'
4
- ::EacRubyUtils::Rspec.default_setup_create(::File.expand_path('..', __dir__))