little_wheels 0.0.4 → 0.0.6

Sign up to get free protection for your applications and to get access to all the features.
Files changed (3) hide show
  1. checksums.yaml +4 -4
  2. data/lib/little_wheels.rb +22 -2
  3. metadata +2 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: eb9d56c36a553f3c3c454289bbfa95bd7557b49f95de3e855b5ad2e2a78c327a
4
- data.tar.gz: 134d7707df3ecc1e151a667edd62bbe32103a1ac75901f816469fbd3cd9d7280
3
+ metadata.gz: 616606ae8e7023b6c4ac0c6f0eae31f82efde79174e898d4d5734123395626cb
4
+ data.tar.gz: 7bf2324aa9e21130169d81c300045320ceb0c822179c637a8ba0063afa960ef6
5
5
  SHA512:
6
- metadata.gz: 440b32f12ee158c2e2ad5a782039f72596adc827b715a0e6fad6f860568288c4a2ad717fad33740986640fb165c17aa59d6dd3367c16c5df0ff54319cb966d7e
7
- data.tar.gz: 753b4ae3b70ec82f93ae3c3e51c1192015e487f88887695d16306db6eac3a701ef48c2062ee0d769a5fb604c8b902d53501f8530bb3eab23974f6e3d1c18bc31
6
+ metadata.gz: 54507f465e5acdb3455952167a6258ba649584b69a08f40b27d1d63acc1fb81436e65e434a2687647c0daaeb4b0e6d2287ed11255d52cefa626e3d9ed275de04
7
+ data.tar.gz: 6cbc031dd4984a21b50a24664725fa4d1bbe6ca72fec9f15c21d1f7c9fab4ea2012dd2935c5ce3b27eccd56ebc4a7a0306d9984eb96c82b06ef04c0e3109fa14
data/lib/little_wheels.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  module LittleWheels
2
- VERSION = "0.0.3"
2
+ VERSION = "0.0.6"
3
3
 
4
4
  class Component
5
5
  def t(template, **locals)
@@ -9,9 +9,29 @@ module LittleWheels
9
9
  def t!(template, **locals)
10
10
  renderer.render(template, locals:, layout: nil)
11
11
  end
12
+
13
+ def x
14
+ renderer.helpers.tag
15
+ end
12
16
 
13
17
  def to_s
14
- t!("shared/#{default_template_name}", c: self)
18
+ renderer.helpers.capture do
19
+ if self.class.const_defined?(:TEMPLATE)
20
+ t(self.class.const_get(:TEMPLATE), c: self, x: self.x )
21
+ else
22
+ t!("shared/#{default_template_name}", c: self, x: self.x )
23
+ end
24
+ end
25
+ end
26
+
27
+ def accepts_slot(block)
28
+ @_slot = block
29
+ end
30
+
31
+ def slot
32
+ context = @_slot.binding.receiver
33
+
34
+ context.capture(&@_slot)
15
35
  end
16
36
 
17
37
  def renderer
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: little_wheels
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.4
4
+ version: 0.0.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Gregory Brown
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2024-11-27 00:00:00.000000000 Z
11
+ date: 2024-11-30 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: Potential future implementation of the smallest Rails component library
14
14
  that can possibly work.