s2p 0.0.1 → 0.0.3

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: d80c07291bbd7f13749d4aa067ea27b9c75bfe03409f580e74f96d986c7ca0eb
4
- data.tar.gz: 3ae7cc86f20a15b99cd34afa498c23b48917efa7832213651bbc103f46ab0b46
3
+ metadata.gz: b73d542564f034b0306408ed0990c44b3e69e3a6579b5b3e7dcff27f87dd7794
4
+ data.tar.gz: 96b2d912b2a9ef96d3da9493f59fffe45cf6a4c20f0cf5e05a4feb6a75382fc1
5
5
  SHA512:
6
- metadata.gz: 33b24855f255d5ef60a5c0e75529f0684d19b4ca69205aa241d1b2d700bac41cdea6f627b58eb9a49c90d97721d1921839bbfaf26b515dfc820e4e77086866ed
7
- data.tar.gz: 6d1a585cd952aca44c726c111b51f1dd690808dbae60d565f87b46c7abae944c8703c820df7f98f05368c8fb4f49f5d22b8f5ac59249e401eac8340e2f26e7ab
6
+ metadata.gz: da5df6baf58e444e4493105ee9f6331c256f7c0806514047d8d21c8fc38d97825bf41974a08e6694697e0267d6bb867444ade10bfb47b5659581a29bd13ee331
7
+ data.tar.gz: af12cb3b1dd4ca1359b82b703532440e00191a26e2f80206a937b08c7a223eebad2e85f312f742e5d08a316bda5a87034366f3f20fa1036823a004a9073c8eb9
data/lib/s2p/component.rb CHANGED
@@ -12,50 +12,48 @@ module S2P
12
12
  def to_s = @string
13
13
  end
14
14
 
15
- module Component
16
- module ClassMethods
17
- def [](*a, **o, &b) = new(*a, **o, &b)
18
- end
15
+ module ClassMethods
16
+ def [](*a, **o, &b) = new(*a, **o, &b)
17
+ end
19
18
 
20
- def self.included(base) = base.extend(ClassMethods)
19
+ def self.included(base) = base.extend(ClassMethods)
21
20
 
22
- def t(template, **locals) = renderer.render(inline: template, locals:)
21
+ def t(template, **locals) = renderer.render(inline: template, locals:)
23
22
 
24
- def t!(template, **locals) = renderer.render(template, locals:, layout: nil)
23
+ def t!(template, **locals) = renderer.render(template, locals:, layout: nil)
25
24
 
26
- def x = helpers.tag
25
+ def x = helpers.tag
27
26
 
28
- def o(&block) = block.binding.receiver.capture(&block)
27
+ def o(&block) = block.binding.receiver.capture(&block)
29
28
 
30
- def +(other) = Buffer.new(to_s + other.to_s)
29
+ def +(other) = Buffer.new(to_s + other.to_s)
31
30
 
32
- def accepts_slot(block) = @_slot = block
31
+ def accepts_slot(block) = @_slot = block
33
32
 
34
- def capture(&block) = block.call.to_s.html_safe
33
+ def capture(&block) = block.call.to_s.html_safe
35
34
 
36
- def default_template_name = "shared/#{self.class.name.underscore}"
35
+ def default_template_name = "shared/#{self.class.name.underscore}"
37
36
 
38
- def helpers = LittleWheels.helpers
37
+ def helpers = S2P::Component.helpers
39
38
 
40
- def renderer = LittleWheels.renderer
39
+ def renderer = S2P::Component.renderer
41
40
 
42
- def render_in(context) = context.render(:inline => to_html)
41
+ def render_in(context) = context.render(:inline => to_html)
43
42
 
44
- def to_s = to_html
43
+ def to_s = to_html
45
44
 
46
- def slot
47
- context = @_slot.binding.receiver
45
+ def slot
46
+ context = @_slot.binding.receiver
48
47
 
49
- context.capture { @_slot.call.to_s }
50
- end
48
+ context.capture { @_slot.call.to_s }
49
+ end
51
50
 
52
- def to_html
53
- helpers.capture do
54
- if self.class.const_defined?(:TEMPLATE)
55
- t(self.class.const_get(:TEMPLATE), c: self, x: self.x )
56
- else
57
- t!(default_template_name, c: self, x: self.x )
58
- end
51
+ def to_html
52
+ helpers.capture do
53
+ if self.class.const_defined?(:TEMPLATE)
54
+ t(self.class.const_get(:TEMPLATE), c: self, x: self.x )
55
+ else
56
+ t!(default_template_name, c: self, x: self.x )
59
57
  end
60
58
  end
61
59
  end
data/lib/s2p/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module S2P
2
- VERSION = "0.0.1"
2
+ VERSION = "0.0.3"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: s2p
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Gregory Brown