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.
- checksums.yaml +4 -4
- data/lib/little_wheels.rb +22 -2
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 616606ae8e7023b6c4ac0c6f0eae31f82efde79174e898d4d5734123395626cb
|
4
|
+
data.tar.gz: 7bf2324aa9e21130169d81c300045320ceb0c822179c637a8ba0063afa960ef6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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.
|
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
|
-
|
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
|
+
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-
|
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.
|