eac_tools 0.60.2 → 0.60.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (77) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile.lock +29 -24
  3. data/lib/eac_tools/version.rb +1 -1
  4. data/sub/avm/avm.gemspec +1 -1
  5. data/sub/avm/lib/avm/version.rb +1 -1
  6. data/sub/avm-eac_ruby_base1/avm-eac_ruby_base1.gemspec +2 -2
  7. data/sub/avm-eac_ruby_base1/lib/avm/eac_ruby_base1/source_generators/base.rb +2 -2
  8. data/sub/avm-eac_ruby_base1/lib/avm/eac_ruby_base1/version.rb +1 -1
  9. data/sub/avm-eac_ubuntu_base0/Gemfile +3 -0
  10. data/sub/avm-eac_ubuntu_base0/avm-eac_ubuntu_base0.gemspec +1 -1
  11. data/sub/avm-eac_ubuntu_base0/lib/avm/eac_ubuntu_base0/docker_image.rb +1 -1
  12. data/sub/avm-eac_ubuntu_base0/lib/avm/eac_ubuntu_base0/version.rb +1 -1
  13. data/sub/avm-files/avm-files.gemspec +5 -5
  14. data/sub/avm-files/lib/avm/files/appendable/templatized_directory.rb +2 -2
  15. data/sub/avm-files/lib/avm/files/version.rb +1 -1
  16. data/sub/eac_templates/Gemfile +8 -0
  17. data/sub/eac_templates/eac_templates.gemspec +19 -0
  18. data/sub/eac_templates/lib/eac_templates/core_ext.rb +4 -0
  19. data/sub/eac_templates/lib/eac_templates/interface_methods.rb +12 -0
  20. data/sub/eac_templates/lib/eac_templates/modules/ancestor/directory.rb +15 -0
  21. data/sub/eac_templates/lib/eac_templates/modules/ancestor/file.rb +15 -0
  22. data/sub/eac_templates/lib/eac_templates/modules/ancestor/fs_object.rb +32 -0
  23. data/sub/eac_templates/lib/eac_templates/modules/ancestor.rb +48 -0
  24. data/sub/eac_templates/lib/eac_templates/modules/base.rb +35 -0
  25. data/sub/eac_templates/lib/eac_templates/modules.rb +9 -0
  26. data/sub/eac_templates/lib/eac_templates/patches/module/erb_template.rb +9 -0
  27. data/sub/eac_templates/lib/eac_templates/patches/module/template.rb +9 -0
  28. data/sub/eac_templates/lib/eac_templates/patches/module.rb +4 -0
  29. data/sub/eac_templates/lib/eac_templates/patches/object/erb_template.rb +9 -0
  30. data/sub/eac_templates/lib/eac_templates/patches/object/template.rb +9 -0
  31. data/sub/eac_templates/lib/eac_templates/patches/object.rb +4 -0
  32. data/sub/eac_templates/lib/eac_templates/patches.rb +4 -0
  33. data/sub/eac_templates/lib/eac_templates/sources/directory.rb +24 -0
  34. data/sub/eac_templates/lib/eac_templates/sources/file.rb +24 -0
  35. data/sub/eac_templates/lib/eac_templates/sources/from_all_gems.rb +4 -0
  36. data/sub/eac_templates/lib/eac_templates/sources/from_gem.rb +37 -0
  37. data/sub/eac_templates/lib/eac_templates/sources/fs_object.rb +53 -0
  38. data/sub/eac_templates/lib/eac_templates/sources/internal_set.rb +22 -0
  39. data/sub/eac_templates/lib/eac_templates/sources/set.rb +54 -0
  40. data/sub/eac_templates/lib/eac_templates/sources/single.rb +29 -0
  41. data/sub/eac_templates/lib/eac_templates/sources.rb +9 -0
  42. data/sub/eac_templates/lib/eac_templates/variables/directory.rb +47 -0
  43. data/sub/eac_templates/lib/eac_templates/variables/file.rb +50 -0
  44. data/sub/eac_templates/lib/eac_templates/variables/fs_object.rb +65 -0
  45. data/sub/eac_templates/lib/eac_templates/variables/not_found_error.rb +7 -0
  46. data/sub/eac_templates/lib/eac_templates/variables/providers/base.rb +23 -0
  47. data/sub/eac_templates/lib/eac_templates/variables/providers/config_reader.rb +29 -0
  48. data/sub/eac_templates/lib/eac_templates/variables/providers/entries_reader.rb +25 -0
  49. data/sub/eac_templates/lib/eac_templates/variables/providers/generic.rb +25 -0
  50. data/sub/eac_templates/lib/eac_templates/variables/providers/hash.rb +29 -0
  51. data/sub/eac_templates/lib/eac_templates/variables/providers.rb +25 -0
  52. data/sub/eac_templates/lib/eac_templates/variables.rb +9 -0
  53. data/sub/eac_templates/lib/eac_templates/version.rb +5 -0
  54. data/sub/eac_templates/lib/eac_templates.rb +7 -0
  55. data/sub/eac_templates/spec/lib/eac_templates/patches/module/template_spec.rb +120 -0
  56. data/sub/eac_templates/spec/lib/eac_templates/patches/module/template_spec_files/path1/a_module/a/a_a +1 -0
  57. data/sub/eac_templates/spec/lib/eac_templates/patches/module/template_spec_files/path1/a_module/b +1 -0
  58. data/sub/eac_templates/spec/lib/eac_templates/patches/module/template_spec_files/path1/super_class/a/a_b +1 -0
  59. data/sub/eac_templates/spec/lib/eac_templates/patches/module/template_spec_files/path1/super_class/b +1 -0
  60. data/sub/eac_templates/spec/lib/eac_templates/patches/module/template_spec_files/path2/a_module/a/a_b +1 -0
  61. data/sub/eac_templates/spec/lib/eac_templates/patches/module/template_spec_files/path2/a_module/b +1 -0
  62. data/sub/eac_templates/spec/lib/eac_templates/patches/module/template_spec_files/path2/a_module/c +1 -0
  63. data/sub/eac_templates/spec/lib/eac_templates/patches/module/template_spec_files/path2/sub_class/b +1 -0
  64. data/sub/eac_templates/spec/lib/eac_templates/patches/module/template_spec_files/path2/super_class/a/a_b +1 -0
  65. data/sub/eac_templates/spec/lib/eac_templates/patches/module/template_spec_files/path2/super_class/b +1 -0
  66. data/sub/eac_templates/spec/lib/eac_templates/patches/object/template_spec.rb +26 -0
  67. data/sub/eac_templates/spec/lib/eac_templates/patches/object/template_spec_files/path/my_stub_with_template +1 -0
  68. data/sub/eac_templates/spec/lib/eac_templates/sources/set_spec.rb +42 -0
  69. data/sub/eac_templates/spec/lib/eac_templates/sources/set_spec_files/path1/subdir1/file1.template +1 -0
  70. data/sub/eac_templates/spec/lib/eac_templates/sources/set_spec_files/path1/subdir1/file2 +1 -0
  71. data/sub/eac_templates/spec/lib/eac_templates/sources/set_spec_files/path2/subdir1/file3.template +1 -0
  72. data/sub/eac_templates/spec/lib/eac_templates/variables/file_spec.rb +35 -0
  73. data/sub/eac_templates/spec/lib/eac_templates/variables/file_spec_files/expected_content +2 -0
  74. data/sub/eac_templates/spec/lib/eac_templates/variables/file_spec_files/source.template +2 -0
  75. data/sub/eac_templates/spec/rubocop_spec.rb +3 -0
  76. data/sub/eac_templates/spec/spec_helper.rb +4 -0
  77. metadata +71 -4
@@ -0,0 +1,26 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'eac_templates/interface_methods'
4
+ require 'eac_templates/patches/object/template'
5
+
6
+ RSpec.describe ::Object do
7
+ class MyStubWithTemplate # rubocop:disable RSpec/LeakyConstantDeclaration
8
+ end
9
+
10
+ let(:instance) { ::MyStubWithTemplate.new }
11
+ let(:templates_path) { ::File.join(__dir__, 'template_spec_files', 'path') }
12
+
13
+ before do
14
+ ::EacTemplates::Sources::Set.default.included_paths.add(templates_path)
15
+ end
16
+
17
+ after do
18
+ ::EacTemplates::Sources::Set.default.included_paths.delete(templates_path)
19
+ end
20
+
21
+ describe '#template' do
22
+ ::EacTemplates::InterfaceMethods::FILE.each do |method_name|
23
+ it { expect(instance.template).to respond_to(method_name) }
24
+ end
25
+ end
26
+ end
@@ -0,0 +1,42 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'eac_templates/interface_methods'
4
+ require 'eac_templates/sources/set'
5
+
6
+ RSpec.describe ::EacTemplates::Sources::Set do
7
+ let(:files_dir) { ::File.join(__dir__, 'set_spec_files') }
8
+ let(:instance) do
9
+ r = described_class.new
10
+ r.included_paths << ::File.join(files_dir, 'path1')
11
+ r.included_paths << ::File.join(files_dir, 'path2')
12
+ r
13
+ end
14
+
15
+ describe '#template' do
16
+ {
17
+ 'subdir1' => :directory,
18
+ 'subdir1/file1.template' => :file,
19
+ 'subdir1/file2' => :file,
20
+ 'subdir1/file3.template' => :file,
21
+ 'does_not_exist' => :nil
22
+ }.each do |subpath, type|
23
+ context "when subpath is \"#{subpath}\"" do
24
+ let(:result) { instance.template(subpath, false) }
25
+
26
+ case type
27
+ when :nil
28
+ it { expect(result).to be_nil }
29
+ when :directory
30
+ ::EacTemplates::InterfaceMethods::DIRECTORY.each do |method_name|
31
+ it { expect(result).to respond_to(method_name) } # rubocop:disable RSpec/RepeatedExample
32
+ end
33
+ when :file
34
+ ::EacTemplates::InterfaceMethods::FILE.each do |method_name|
35
+ it { expect(result).to respond_to(method_name) } # rubocop:disable RSpec/RepeatedExample
36
+ end
37
+ else ibr
38
+ end
39
+ end
40
+ end
41
+ end
42
+ end
@@ -0,0 +1,35 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'eac_config/old_configs'
4
+ require 'eac_templates/variables/file'
5
+
6
+ RSpec.describe ::EacTemplates::Variables::File do
7
+ let(:files_dir) { ::File.join(__dir__, 'file_spec_files') }
8
+ let(:source_path) { ::File.join(files_dir, 'source.template') }
9
+ let(:instance) { described_class.new(source_path) }
10
+ let(:expected_content) { ::File.read(::File.join(files_dir, 'expected_content')) }
11
+
12
+ describe '#apply' do
13
+ context 'when config is a hash' do
14
+ let(:config) { { name: 'Fulano de Tal', age: 33 } }
15
+
16
+ it { expect(instance.apply(config)).to eq(expected_content) }
17
+ end
18
+
19
+ context 'when config responds to read_entry' do
20
+ let(:config) { ::EacConfig::OldConfigs.new('rspec_describe_eac_ruby_utils_templates_file') }
21
+
22
+ before do
23
+ config.clear
24
+ config['name'] = 'Fulano de Tal'
25
+ config['age'] = '33'
26
+ end
27
+
28
+ it { expect(instance.apply(config)).to eq(expected_content) }
29
+ end
30
+ end
31
+
32
+ describe '#variables' do
33
+ it { expect(instance.variables).to eq(::Set.new(%w[name age])) }
34
+ end
35
+ end
@@ -0,0 +1,3 @@
1
+ # frozen_string_literal: true
2
+
3
+ ::EacRubyUtils::Rspec.default_setup.describe_rubocop
@@ -0,0 +1,4 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'eac_ruby_utils/rspec/default_setup'
4
+ ::EacRubyUtils::Rspec.default_setup_create(::File.expand_path('..', __dir__))
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: eac_tools
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.60.2
4
+ version: 0.60.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Put here the authors
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-04-26 00:00:00.000000000 Z
11
+ date: 2023-04-30 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: avm
@@ -17,6 +17,9 @@ dependencies:
17
17
  - - "~>"
18
18
  - !ruby/object:Gem::Version
19
19
  version: '0.67'
20
+ - - ">="
21
+ - !ruby/object:Gem::Version
22
+ version: 0.67.1
20
23
  type: :runtime
21
24
  prerelease: false
22
25
  version_requirements: !ruby/object:Gem::Requirement
@@ -24,6 +27,9 @@ dependencies:
24
27
  - - "~>"
25
28
  - !ruby/object:Gem::Version
26
29
  version: '0.67'
30
+ - - ">="
31
+ - !ruby/object:Gem::Version
32
+ version: 0.67.1
27
33
  - !ruby/object:Gem::Dependency
28
34
  name: avm-eac_asciidoctor_base0
29
35
  requirement: !ruby/object:Gem::Requirement
@@ -221,7 +227,7 @@ dependencies:
221
227
  version: '0.30'
222
228
  - - ">="
223
229
  - !ruby/object:Gem::Version
224
- version: 0.30.1
230
+ version: 0.30.2
225
231
  type: :runtime
226
232
  prerelease: false
227
233
  version_requirements: !ruby/object:Gem::Requirement
@@ -231,7 +237,7 @@ dependencies:
231
237
  version: '0.30'
232
238
  - - ">="
233
239
  - !ruby/object:Gem::Version
234
- version: 0.30.1
240
+ version: 0.30.2
235
241
  - !ruby/object:Gem::Dependency
236
242
  name: avm-eac_webapp_base0
237
243
  requirement: !ruby/object:Gem::Requirement
@@ -1962,6 +1968,67 @@ files:
1962
1968
  - sub/eac_ruby_utils/spec/locales/pt-BR.yml
1963
1969
  - sub/eac_ruby_utils/spec/rubocop_check_spec.rb
1964
1970
  - sub/eac_ruby_utils/spec/spec_helper.rb
1971
+ - sub/eac_templates/Gemfile
1972
+ - sub/eac_templates/eac_templates.gemspec
1973
+ - sub/eac_templates/lib/eac_templates.rb
1974
+ - sub/eac_templates/lib/eac_templates/core_ext.rb
1975
+ - sub/eac_templates/lib/eac_templates/interface_methods.rb
1976
+ - sub/eac_templates/lib/eac_templates/modules.rb
1977
+ - sub/eac_templates/lib/eac_templates/modules/ancestor.rb
1978
+ - sub/eac_templates/lib/eac_templates/modules/ancestor/directory.rb
1979
+ - sub/eac_templates/lib/eac_templates/modules/ancestor/file.rb
1980
+ - sub/eac_templates/lib/eac_templates/modules/ancestor/fs_object.rb
1981
+ - sub/eac_templates/lib/eac_templates/modules/base.rb
1982
+ - sub/eac_templates/lib/eac_templates/patches.rb
1983
+ - sub/eac_templates/lib/eac_templates/patches/module.rb
1984
+ - sub/eac_templates/lib/eac_templates/patches/module/erb_template.rb
1985
+ - sub/eac_templates/lib/eac_templates/patches/module/template.rb
1986
+ - sub/eac_templates/lib/eac_templates/patches/object.rb
1987
+ - sub/eac_templates/lib/eac_templates/patches/object/erb_template.rb
1988
+ - sub/eac_templates/lib/eac_templates/patches/object/template.rb
1989
+ - sub/eac_templates/lib/eac_templates/sources.rb
1990
+ - sub/eac_templates/lib/eac_templates/sources/directory.rb
1991
+ - sub/eac_templates/lib/eac_templates/sources/file.rb
1992
+ - sub/eac_templates/lib/eac_templates/sources/from_all_gems.rb
1993
+ - sub/eac_templates/lib/eac_templates/sources/from_gem.rb
1994
+ - sub/eac_templates/lib/eac_templates/sources/fs_object.rb
1995
+ - sub/eac_templates/lib/eac_templates/sources/internal_set.rb
1996
+ - sub/eac_templates/lib/eac_templates/sources/set.rb
1997
+ - sub/eac_templates/lib/eac_templates/sources/single.rb
1998
+ - sub/eac_templates/lib/eac_templates/variables.rb
1999
+ - sub/eac_templates/lib/eac_templates/variables/directory.rb
2000
+ - sub/eac_templates/lib/eac_templates/variables/file.rb
2001
+ - sub/eac_templates/lib/eac_templates/variables/fs_object.rb
2002
+ - sub/eac_templates/lib/eac_templates/variables/not_found_error.rb
2003
+ - sub/eac_templates/lib/eac_templates/variables/providers.rb
2004
+ - sub/eac_templates/lib/eac_templates/variables/providers/base.rb
2005
+ - sub/eac_templates/lib/eac_templates/variables/providers/config_reader.rb
2006
+ - sub/eac_templates/lib/eac_templates/variables/providers/entries_reader.rb
2007
+ - sub/eac_templates/lib/eac_templates/variables/providers/generic.rb
2008
+ - sub/eac_templates/lib/eac_templates/variables/providers/hash.rb
2009
+ - sub/eac_templates/lib/eac_templates/version.rb
2010
+ - sub/eac_templates/spec/lib/eac_templates/patches/module/template_spec.rb
2011
+ - sub/eac_templates/spec/lib/eac_templates/patches/module/template_spec_files/path1/a_module/a/a_a
2012
+ - sub/eac_templates/spec/lib/eac_templates/patches/module/template_spec_files/path1/a_module/b
2013
+ - sub/eac_templates/spec/lib/eac_templates/patches/module/template_spec_files/path1/super_class/a/a_b
2014
+ - sub/eac_templates/spec/lib/eac_templates/patches/module/template_spec_files/path1/super_class/b
2015
+ - sub/eac_templates/spec/lib/eac_templates/patches/module/template_spec_files/path2/a_module/a/a_b
2016
+ - sub/eac_templates/spec/lib/eac_templates/patches/module/template_spec_files/path2/a_module/b
2017
+ - sub/eac_templates/spec/lib/eac_templates/patches/module/template_spec_files/path2/a_module/c
2018
+ - sub/eac_templates/spec/lib/eac_templates/patches/module/template_spec_files/path2/sub_class/b
2019
+ - sub/eac_templates/spec/lib/eac_templates/patches/module/template_spec_files/path2/super_class/a/a_b
2020
+ - sub/eac_templates/spec/lib/eac_templates/patches/module/template_spec_files/path2/super_class/b
2021
+ - sub/eac_templates/spec/lib/eac_templates/patches/object/template_spec.rb
2022
+ - sub/eac_templates/spec/lib/eac_templates/patches/object/template_spec_files/path/my_stub_with_template
2023
+ - sub/eac_templates/spec/lib/eac_templates/sources/set_spec.rb
2024
+ - sub/eac_templates/spec/lib/eac_templates/sources/set_spec_files/path1/subdir1/file1.template
2025
+ - sub/eac_templates/spec/lib/eac_templates/sources/set_spec_files/path1/subdir1/file2
2026
+ - sub/eac_templates/spec/lib/eac_templates/sources/set_spec_files/path2/subdir1/file3.template
2027
+ - sub/eac_templates/spec/lib/eac_templates/variables/file_spec.rb
2028
+ - sub/eac_templates/spec/lib/eac_templates/variables/file_spec_files/expected_content
2029
+ - sub/eac_templates/spec/lib/eac_templates/variables/file_spec_files/source.template
2030
+ - sub/eac_templates/spec/rubocop_spec.rb
2031
+ - sub/eac_templates/spec/spec_helper.rb
1965
2032
  homepage:
1966
2033
  licenses: []
1967
2034
  metadata: {}