lowload 0.4.0 → 0.5.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.
Files changed (4) hide show
  1. checksums.yaml +4 -4
  2. data/lib/lowload.rb +7 -7
  3. data/lib/version.rb +1 -1
  4. metadata +5 -5
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 7315b8d32b8990ee21d2678f1c01636ec97ece08a11b65cbe06f79c2994f7a20
4
- data.tar.gz: 182c287de93df1b0dc4da5fd1bfb31c13dd0410d2030d6babf0f977b37ae1bb2
3
+ metadata.gz: ff485e94bc43e900c70c84618b8291a7f329f65f5c77f800e4f63441abea255a
4
+ data.tar.gz: a0791c307b326183ad64da9a094e2591e368edd1871b075eff8432cef79a8467
5
5
  SHA512:
6
- metadata.gz: 687c06c911126c216366dd22e7449de109b4ef3dfb65e9a30b593c44dd4152a25ddd644209c6da818af87e14e5597e9f5096705c6ec50673061541b7590429d8
7
- data.tar.gz: 11d2cb73f9da57fb05b80f18757fae12f56cead641e5cd6d7d580b2f0c8120e967cf21482d0bc6989c9cef6c363ab7a22abf79d3d8438f3d36858986e958005a
6
+ metadata.gz: 3a91ef3b898d28435381872dfe19589699ab7fe396969780001d4c5d27e144518cd3cb5eb9165ebb3e46c5149a28fd2d511b698f3beb760e95d58fe45a0b0ef9
7
+ data.tar.gz: fee30da0af61c8160415a6017a9baac910fb529ecb66239b4198c1a068d58054372e8fb00df64823cd6b4a335c4754919fda61a3316b9a471ea26b6ac301ea4c
data/lib/lowload.rb CHANGED
@@ -10,6 +10,8 @@ def top_level_binding
10
10
  end
11
11
 
12
12
  module LowLoad
13
+ class UnsupportedTemplate < StandardError; end
14
+
13
15
  class << self
14
16
  # Files are mapped, autoloaded, then loaded into Ruby in 3 separate stages.
15
17
  def dirload(path, pwd = Dir.pwd)
@@ -58,18 +60,18 @@ module LowLoad
58
60
  templates.each do |namespace, method_template|
59
61
  klass = const_get(namespace)
60
62
  method, template = method_template
61
- # TODO: If params contain "**props" or similar then send that so that lownode can replicate it.
63
+ # TODO: If params contain "**props" or similar then send that, so that LowNode can replicate it.
62
64
  params = method.params.map(&:name)
63
65
 
64
- next unless supports_templates?(klass)
66
+ next unless supports_templates?(klass) || raise(UnsupportedTemplate, "Template for '#{namespace}' identified but not implemented")
65
67
 
66
68
  # TODO: Make template engine configurable.
67
- klass.load_template(template:, params:, engine: Antlers, namespace:)
69
+ klass.build_template(template:, params:, engine: Antlers, namespace:)
68
70
  end
69
71
  end
70
72
 
71
73
  def supports_templates?(klass)
72
- klass.respond_to?(:render) && klass.respond_to?(:template) && klass.respond_to?(:load_template)
74
+ klass.respond_to?(:render) && klass.respond_to?(:template) && klass.respond_to?(:build_template)
73
75
  end
74
76
 
75
77
  def wrap_render_methods(file_proxy:)
@@ -88,9 +90,7 @@ module LowLoad
88
90
  end
89
91
 
90
92
  # Intended to target HTML or Antlers tags. Use HEREDOC "<<~" in a plain Ruby (".rb") file, not RBX.
91
- if render_method_body.strip.start_with?('<')
92
- render_method.body.wrap(prefix: '%q{', suffix: '}')
93
- end
93
+ render_method.body.wrap(prefix: '%q{', suffix: '}') if render_method_body.strip.start_with?('<')
94
94
  end
95
95
 
96
96
  templates
data/lib/version.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module LowLoad
4
- VERSION = '0.4.0'
4
+ VERSION = '0.5.0'
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: lowload
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.0
4
+ version: 0.5.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - maedi
@@ -23,8 +23,8 @@ dependencies:
23
23
  - - ">="
24
24
  - !ruby/object:Gem::Version
25
25
  version: '0'
26
- description: An autoloader that lets you use any module namespace convention with
27
- any folder structure and mix in manual require statements.
26
+ description: An autoloader that lets you use any module namespace with any folder
27
+ structure and mix in manual requires.
28
28
  email:
29
29
  - maediprichard@gmail.com
30
30
  executables: []
@@ -53,7 +53,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
53
53
  - !ruby/object:Gem::Version
54
54
  version: '0'
55
55
  requirements: []
56
- rubygems_version: 3.7.2
56
+ rubygems_version: 4.0.10
57
57
  specification_version: 4
58
- summary: An autoloader that is dumb but lets you do you
58
+ summary: An autoloader without namespace and folder structure conventions
59
59
  test_files: []