avm-eac_ruby_base0 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA256:
3
+ metadata.gz: 3f306c79d4c65729100591ea6d902d2fa3909bc37b72f54fecd52edc0ba6f463
4
+ data.tar.gz: c0a692788d4802e1c4d9a09de9e535bae9a6a746fb658472dafca4f954438d32
5
+ SHA512:
6
+ metadata.gz: 0b988a4c72594bd77547c052b1de4a7b4090179e10c0791c05a953725f2705d9d1b3d3fd7f5780ad229ff84aa514fb2112323f00ca11243ecd718e91a20c0e2a
7
+ data.tar.gz: 981113520e9d4c58603aa52febe6231def2d6cf8b46a4ba2bd040d5818564b8cf6cd4cf57f5feaef63ae1c6fbdcdd9965b8db1a97e309471ba0dd3fb7748a029
@@ -0,0 +1,16 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'avm/eac_ruby_base0/rspec/source_generator'
4
+ require 'eac_ruby_utils/core_ext'
5
+
6
+ module Avm
7
+ module EacRubyBase0
8
+ module Rspec
9
+ module Setup
10
+ def self.extended(obj)
11
+ obj.rspec_config.include(::Avm::EacRubyBase0::Rspec::SourceGenerator)
12
+ end
13
+ end
14
+ end
15
+ end
16
+ end
@@ -0,0 +1,33 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'eac_ruby_utils/core_ext'
4
+
5
+ module Avm
6
+ module EacRubyBase0
7
+ module Rspec
8
+ module SourceGenerator
9
+ APPLICATION_STEREOTYPE = 'EacRubyBase0'
10
+ DEFAULT_VERSIONS = {
11
+ 'eac_ruby_base0' => '0.9.0',
12
+ 'eac_ruby_gem_support' => '0.10.0',
13
+ 'eac_ruby_utils' => '0.122.0'
14
+ }.freeze
15
+
16
+ # @return [Avm::EacRubyBase0::Sources::Base]
17
+ def avm_eac_ruby_base0_source(options = {})
18
+ avm_source(
19
+ APPLICATION_STEREOTYPE,
20
+ avm_eac_ruby_base0_source_default_options.merge(options)
21
+ )
22
+ end
23
+
24
+ # @return [Hash]
25
+ def avm_eac_ruby_base0_source_default_options
26
+ DEFAULT_VERSIONS.transform_keys do |gem_name|
27
+ "#{gem_name}_version".dasherize
28
+ end
29
+ end
30
+ end
31
+ end
32
+ end
33
+ end
@@ -0,0 +1,11 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'eac_ruby_utils/core_ext'
4
+
5
+ module Avm
6
+ module EacRubyBase0
7
+ module Rspec
8
+ require_sub __FILE__
9
+ end
10
+ end
11
+ end
@@ -0,0 +1,36 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'avm/eac_ruby_base1/source_generators/base'
4
+ require 'eac_ruby_utils/core_ext'
5
+
6
+ module Avm
7
+ module EacRubyBase0
8
+ module SourceGenerators
9
+ class Base < ::Avm::EacRubyBase1::SourceGenerators::Base
10
+ module Application
11
+ # @return [Pathname]
12
+ def application_to_root_relative_path
13
+ target_path.relative_path_from(application_target_path.dirname)
14
+ end
15
+
16
+ # @return [Pathname]
17
+ def application_require_path
18
+ lib_path.to_pathname.join('application')
19
+ end
20
+
21
+ # @return [Pathname]
22
+ def application_target_path
23
+ target_path.join('lib', "#{application_require_path}.rb")
24
+ end
25
+
26
+ protected
27
+
28
+ # @return [void]
29
+ def generate_application
30
+ template.child('application').apply_to_file(self, application_target_path.assert_parent)
31
+ end
32
+ end
33
+ end
34
+ end
35
+ end
36
+ end
@@ -0,0 +1,31 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'avm/eac_ruby_base1/source_generators/base'
4
+ require 'eac_ruby_utils/core_ext'
5
+
6
+ module Avm
7
+ module EacRubyBase0
8
+ module SourceGenerators
9
+ class Base < ::Avm::EacRubyBase1::SourceGenerators::Base
10
+ module Executable
11
+ # @return [String]
12
+ def executable_name
13
+ options[OPTION_EXECUTABLE_NAME].if_present(name)
14
+ end
15
+
16
+ # @return [Pathname]
17
+ def executable_target_path
18
+ target_path.join(EXECUTABLES_DIRECTORY, executable_name)
19
+ end
20
+
21
+ protected
22
+
23
+ # @return [void]
24
+ def generate_executable
25
+ template.child('executable').apply_to_file(self, executable_target_path.assert_parent)
26
+ end
27
+ end
28
+ end
29
+ end
30
+ end
31
+ end
@@ -0,0 +1,36 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'avm/eac_ruby_base1/source_generators/base'
4
+ require 'eac_ruby_utils/core_ext'
5
+
6
+ module Avm
7
+ module EacRubyBase0
8
+ module SourceGenerators
9
+ class Base < ::Avm::EacRubyBase1::SourceGenerators::Base
10
+ module Runner
11
+ # @return [String]
12
+ def runner_class
13
+ runner_require_path.to_path.camelize
14
+ end
15
+
16
+ # @return [Pathname]
17
+ def runner_require_path
18
+ lib_path.to_pathname.join('runner')
19
+ end
20
+
21
+ # @return [Pathname]
22
+ def runner_target_path
23
+ target_path.join('lib', "#{runner_require_path}.rb")
24
+ end
25
+
26
+ protected
27
+
28
+ # @return [void]
29
+ def generate_runner
30
+ template.child('runner').apply_to_file(self, runner_target_path.assert_parent)
31
+ end
32
+ end
33
+ end
34
+ end
35
+ end
36
+ end
@@ -0,0 +1,47 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'avm/eac_ruby_base1/source_generators/base'
4
+ require 'eac_ruby_utils/core_ext'
5
+
6
+ module Avm
7
+ module EacRubyBase0
8
+ module SourceGenerators
9
+ class Base < ::Avm::EacRubyBase1::SourceGenerators::Base
10
+ require_sub __FILE__, include_modules: true
11
+
12
+ COMMON_DEPENDENCIES = %w[eac_ruby_base0].freeze
13
+ EXECUTABLES_DIRECTORY = 'exe'
14
+ GEMSPEC_EXTRA_LINES = [
15
+ "s.bindir = '#{EXECUTABLES_DIRECTORY}'",
16
+ "s.executables = s.files.grep(%r{^#{EXECUTABLES_DIRECTORY}/}) { |f| File.basename(f) }"
17
+ ].freeze
18
+ GEMSPEC_FILES_DIRECTORY_PATHS = [EXECUTABLES_DIRECTORY].freeze
19
+ GEMSPEC_FILES_FILE_PATHS = %w[Gemfile Gemfile.lock].freeze
20
+ JOBS = ::Avm::EacRubyBase1::SourceGenerators::Base::JOBS + %w[application executable runner]
21
+ OPTION_EXECUTABLE_NAME = 'executable-name'
22
+
23
+ class << self
24
+ # @return [Array<String>]
25
+ def common_dependency_gems
26
+ super + COMMON_DEPENDENCIES
27
+ end
28
+ end
29
+
30
+ # @return [Array<String>]
31
+ def gemspec_extra_lines
32
+ super + GEMSPEC_EXTRA_LINES
33
+ end
34
+
35
+ # @return [Array<String>]
36
+ def gemspec_files_directory_paths
37
+ super + GEMSPEC_FILES_DIRECTORY_PATHS
38
+ end
39
+
40
+ # @return [Array<String>]
41
+ def gemspec_files_file_paths
42
+ super + GEMSPEC_FILES_FILE_PATHS
43
+ end
44
+ end
45
+ end
46
+ end
47
+ end
@@ -0,0 +1,11 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'eac_ruby_utils/core_ext'
4
+
5
+ module Avm
6
+ module EacRubyBase0
7
+ module SourceGenerators
8
+ require_sub __FILE__
9
+ end
10
+ end
11
+ end
@@ -0,0 +1,62 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'avm/eac_ruby_base1/sources/base'
4
+ require 'eac_ruby_utils/core_ext'
5
+
6
+ module Avm
7
+ module EacRubyBase0
8
+ module Sources
9
+ class Base < ::Avm::EacRubyBase1::Sources::Base
10
+ module Executable
11
+ EXECUTABLE_NAME_KEY = 'executable.name'
12
+ EXECUTABLE_DIRECTORY_KEY = 'executable.directory'
13
+ DEFAULT_EXECUTABLE_DIRECTORY = 'exe'
14
+
15
+ # @return [String]
16
+ def default_executable_name
17
+ application.id
18
+ end
19
+
20
+ # @return [String]
21
+ def default_executable_directory
22
+ DEFAULT_EXECUTABLE_DIRECTORY
23
+ end
24
+
25
+ # @return [String]
26
+ def executable_directory
27
+ executable_directory_by_configuration || default_executable_directory
28
+ end
29
+
30
+ # @return [String, nil]
31
+ def executable_directory_by_configuration
32
+ configuration.entry(EXECUTABLE_DIRECTORY_KEY).value
33
+ end
34
+
35
+ # @return [String]
36
+ def executable_name
37
+ executable_name_by_configuration || default_executable_name
38
+ end
39
+
40
+ # @return [String, nil]
41
+ def executable_name_by_configuration
42
+ configuration.entry(EXECUTABLE_NAME_KEY).value
43
+ end
44
+
45
+ # Executable's absolute path.
46
+ #
47
+ # @return [Pathname]
48
+ def executable_path
49
+ path.join(executable_subpath)
50
+ end
51
+
52
+ # Executable's relative path from source's root.
53
+ #
54
+ # @return [Pathname]
55
+ def executable_subpath
56
+ executable_directory.to_pathname.join(executable_name)
57
+ end
58
+ end
59
+ end
60
+ end
61
+ end
62
+ end
@@ -0,0 +1,19 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'avm/eac_ruby_base1/sources/base'
4
+ require 'eac_ruby_utils/core_ext'
5
+
6
+ module Avm
7
+ module EacRubyBase0
8
+ module Sources
9
+ class Base < ::Avm::EacRubyBase1::Sources::Base
10
+ # @return [Boolean]
11
+ def valid?
12
+ super && executable_path.file?
13
+ end
14
+
15
+ require_sub __FILE__, include_modules: true
16
+ end
17
+ end
18
+ end
19
+ end
@@ -0,0 +1,11 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'eac_ruby_utils/core_ext'
4
+
5
+ module Avm
6
+ module EacRubyBase0
7
+ module Sources
8
+ require_sub __FILE__
9
+ end
10
+ end
11
+ end
@@ -0,0 +1,7 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Avm
4
+ module EacRubyBase0
5
+ VERSION = '0.1.0'
6
+ end
7
+ end
@@ -0,0 +1,9 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'eac_ruby_utils/core_ext'
4
+
5
+ module Avm
6
+ module EacRubyBase0
7
+ require_sub __FILE__
8
+ end
9
+ end
@@ -0,0 +1,11 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'eac_ruby_base0/application'
4
+
5
+ %%ROOT_MODULE_OPEN%%
6
+ %%ROOT_MODULE_INNER_IDENTATION%%class << self
7
+ %%ROOT_MODULE_INNER_IDENTATION%% def application
8
+ %%ROOT_MODULE_INNER_IDENTATION%% @application ||= ::EacRubyBase0::Application.new(::File.expand_path('%%APPLICATION_TO_ROOT_RELATIVE_PATH%%', __dir__))
9
+ %%ROOT_MODULE_INNER_IDENTATION%% end
10
+ %%ROOT_MODULE_INNER_IDENTATION%%end
11
+ %%ROOT_MODULE_CLOSE%%
@@ -0,0 +1,6 @@
1
+ #!/usr/bin/env ruby
2
+ # frozen_string_literal: true
3
+
4
+ $LOAD_PATH.unshift("#{__dir__}/../lib")
5
+ require '%%runner_require_path%%'
6
+ %%runner_class%%.run(program_name: File.basename(__FILE__))
@@ -0,0 +1,21 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'eac_ruby_base0/runner'
4
+ require '%%application_require_path%%'
5
+
6
+ %%ROOT_MODULE_OPEN%%
7
+ %%ROOT_MODULE_INNER_IDENTATION%%class Runner
8
+ %%ROOT_MODULE_INNER_IDENTATION%% include ::EacRubyBase0::Runner
9
+
10
+ %%ROOT_MODULE_INNER_IDENTATION%% runner_definition do
11
+ %%ROOT_MODULE_INNER_IDENTATION%% desc 'Tools for %%NAME%%.'
12
+ %%ROOT_MODULE_INNER_IDENTATION%% end
13
+
14
+ %%ROOT_MODULE_INNER_IDENTATION%% # @return [EacRubyBase0::Application]
15
+ %%ROOT_MODULE_INNER_IDENTATION%% def application
16
+ %%ROOT_MODULE_INNER_IDENTATION%% ::%%ROOT_MODULE%%.application
17
+ %%ROOT_MODULE_INNER_IDENTATION%% end
18
+
19
+ %%ROOT_MODULE_INNER_IDENTATION%% require_sub __FILE__
20
+ %%ROOT_MODULE_INNER_IDENTATION%%end
21
+ %%ROOT_MODULE_CLOSE%%
metadata ADDED
@@ -0,0 +1,99 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: avm-eac_ruby_base0
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.1.0
5
+ platform: ruby
6
+ authors:
7
+ - Put here the authors
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2024-05-29 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: avm-eac_ruby_base1
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - "~>"
18
+ - !ruby/object:Gem::Version
19
+ version: '0.34'
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - "~>"
25
+ - !ruby/object:Gem::Version
26
+ version: '0.34'
27
+ - !ruby/object:Gem::Dependency
28
+ name: eac_ruby_utils
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - "~>"
32
+ - !ruby/object:Gem::Version
33
+ version: '0.122'
34
+ type: :runtime
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - "~>"
39
+ - !ruby/object:Gem::Version
40
+ version: '0.122'
41
+ - !ruby/object:Gem::Dependency
42
+ name: eac_ruby_gem_support
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - "~>"
46
+ - !ruby/object:Gem::Version
47
+ version: '0.10'
48
+ type: :development
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - "~>"
53
+ - !ruby/object:Gem::Version
54
+ version: '0.10'
55
+ description:
56
+ email:
57
+ executables: []
58
+ extensions: []
59
+ extra_rdoc_files: []
60
+ files:
61
+ - lib/avm/eac_ruby_base0.rb
62
+ - lib/avm/eac_ruby_base0/rspec.rb
63
+ - lib/avm/eac_ruby_base0/rspec/setup.rb
64
+ - lib/avm/eac_ruby_base0/rspec/source_generator.rb
65
+ - lib/avm/eac_ruby_base0/source_generators.rb
66
+ - lib/avm/eac_ruby_base0/source_generators/base.rb
67
+ - lib/avm/eac_ruby_base0/source_generators/base/application.rb
68
+ - lib/avm/eac_ruby_base0/source_generators/base/executable.rb
69
+ - lib/avm/eac_ruby_base0/source_generators/base/runner.rb
70
+ - lib/avm/eac_ruby_base0/sources.rb
71
+ - lib/avm/eac_ruby_base0/sources/base.rb
72
+ - lib/avm/eac_ruby_base0/sources/base/executable.rb
73
+ - lib/avm/eac_ruby_base0/version.rb
74
+ - template/avm/eac_ruby_base0/source_generators/base/application.template
75
+ - template/avm/eac_ruby_base0/source_generators/base/executable.template
76
+ - template/avm/eac_ruby_base0/source_generators/base/runner.template
77
+ homepage:
78
+ licenses: []
79
+ metadata: {}
80
+ post_install_message:
81
+ rdoc_options: []
82
+ require_paths:
83
+ - lib
84
+ required_ruby_version: !ruby/object:Gem::Requirement
85
+ requirements:
86
+ - - ">="
87
+ - !ruby/object:Gem::Version
88
+ version: '2.7'
89
+ required_rubygems_version: !ruby/object:Gem::Requirement
90
+ requirements:
91
+ - - ">="
92
+ - !ruby/object:Gem::Version
93
+ version: '0'
94
+ requirements: []
95
+ rubygems_version: 3.1.6
96
+ signing_key:
97
+ specification_version: 4
98
+ summary: Put here de description.
99
+ test_files: []