viu 0.0.4 → 0.0.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +5 -0
- data/Gemfile.lock +1 -1
- data/lib/viu/html.rb +9 -1
- data/lib/viu/layout.rb +8 -5
- data/lib/viu/version.rb +1 -1
- 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: 17de95e5852c60464030292d611b3baa74bc9e5b72de1dab5cc6f820241b35cb
|
4
|
+
data.tar.gz: 1c04d6ee4f5ecb39bd846a7673bb542a2f1c34aacafa1acdf84cabeb799ffedb
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c4a88a1afc091b1a1840bdc07bbc69d3c12b0ed2725875cc7d457bd12928188dd514c0aa27e538cee12d092eedff4346c15f76ee7ee47f00cc0880645165b48f
|
7
|
+
data.tar.gz: '099c2aa54ac9281b47a0cc777927b4076265bedbd873c39cc03b1c23a8adcfa1d714036976ee961b3a707d69565cdd3ba75e3b440c5faa46061228996d8ab802'
|
data/CHANGELOG.md
CHANGED
data/Gemfile.lock
CHANGED
data/lib/viu/html.rb
CHANGED
@@ -7,6 +7,12 @@ module Viu
|
|
7
7
|
|
8
8
|
def initialize(*); end
|
9
9
|
|
10
|
+
module CompiledMethodContainer; end
|
11
|
+
|
12
|
+
def compiled_method_container
|
13
|
+
Viu::Html::CompiledMethodContainer
|
14
|
+
end
|
15
|
+
|
10
16
|
def render_in(view_context, options = EMPTY_HASH)
|
11
17
|
__setup!(view_context)
|
12
18
|
|
@@ -69,8 +75,10 @@ module Viu
|
|
69
75
|
class << self
|
70
76
|
|
71
77
|
def inherited(child)
|
78
|
+
child.include(Viu::Html::CompiledMethodContainer)
|
79
|
+
|
72
80
|
if defined?(Rails) && child != Viu::Layout
|
73
|
-
child.include
|
81
|
+
child.include(Rails.application.routes.url_helpers) unless child < Rails.application.routes.url_helpers
|
74
82
|
end
|
75
83
|
end
|
76
84
|
|
data/lib/viu/layout.rb
CHANGED
@@ -16,17 +16,20 @@ module Viu
|
|
16
16
|
end
|
17
17
|
|
18
18
|
RAILS_6_0 = Gem::Version.new('6.0.0')
|
19
|
-
|
19
|
+
RAILS_6_1_WITH_PRERELEASES = Gem::Version.new('6.1.0.a')
|
20
|
+
private_constant :RAILS_6_0, :RAILS_6_1_WITH_PRERELEASES
|
20
21
|
|
21
22
|
def render_in(view_context, &block)
|
22
23
|
__setup!(view_context)
|
23
24
|
|
24
|
-
|
25
|
+
rails_version = ::Rails.gem_version
|
25
26
|
|
26
|
-
if
|
27
|
-
|
27
|
+
if rails_version >= RAILS_6_1_WITH_PRERELEASES
|
28
|
+
Renderer.new(@lookup_context, layout: nil).render(__fetch_template!, self, block).body
|
29
|
+
elsif rails_version >= RAILS_6_0
|
30
|
+
Renderer.new(@lookup_context).render(self, { partial: __fetch_template!, layout: nil }, block).body
|
28
31
|
else
|
29
|
-
|
32
|
+
Renderer.new(@lookup_context).render(self, { partial: __fetch_template!, layout: nil }, block)
|
30
33
|
end
|
31
34
|
end
|
32
35
|
end
|
data/lib/viu/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: viu
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ralf Schmitz Bongiolo
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-
|
11
|
+
date: 2020-12-01 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|