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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 5fad2db40122a0f7ee7925e084c50d772f6d695f242398de001de2b62cbdc5fc
4
- data.tar.gz: 7565743dd49bdad3af8df1a86acec2421d0a30d9ab9acf7f7016cadc52b63b70
3
+ metadata.gz: 17de95e5852c60464030292d611b3baa74bc9e5b72de1dab5cc6f820241b35cb
4
+ data.tar.gz: 1c04d6ee4f5ecb39bd846a7673bb542a2f1c34aacafa1acdf84cabeb799ffedb
5
5
  SHA512:
6
- metadata.gz: 12ce43a27739e1db0d4fcc7e98c064c71d8f26616cbf932af6157e5219c7a10e07c6996151a9dc9d8f11dbb6c9f37a0e443092cbb5efe2c153328ae9a7a27bff
7
- data.tar.gz: 9458f8e9e98eb0c229fde6c2ff607071d805e2f28cc8904b2d8d9d2e2946bcf891d11adabf505d955b08c61ea31073468097bf7bfdabf75043003d873769b24c
6
+ metadata.gz: c4a88a1afc091b1a1840bdc07bbc69d3c12b0ed2725875cc7d457bd12928188dd514c0aa27e538cee12d092eedff4346c15f76ee7ee47f00cc0880645165b48f
7
+ data.tar.gz: '099c2aa54ac9281b47a0cc777927b4076265bedbd873c39cc03b1c23a8adcfa1d714036976ee961b3a707d69565cdd3ba75e3b440c5faa46061228996d8ab802'
@@ -1,3 +1,8 @@
1
+ ## 0.0.5 2020-12-01
2
+
3
+ - Added support for Rails 6.1.0.rc1
4
+ - Fixed bug with views not having access to compiled template methods (using #compiled_method_container)
5
+
1
6
  ## 0.0.4 2020-11-29
2
7
 
3
8
  - Added support for Rails ~> 6.0.0
@@ -86,7 +86,7 @@ GIT
86
86
  PATH
87
87
  remote: .
88
88
  specs:
89
- viu (0.0.4)
89
+ viu (0.0.5)
90
90
 
91
91
  GEM
92
92
  remote: https://rubygems.org/
@@ -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 Rails.application.routes.url_helpers unless child < Rails.application.routes.url_helpers
81
+ child.include(Rails.application.routes.url_helpers) unless child < Rails.application.routes.url_helpers
74
82
  end
75
83
  end
76
84
 
@@ -16,17 +16,20 @@ module Viu
16
16
  end
17
17
 
18
18
  RAILS_6_0 = Gem::Version.new('6.0.0')
19
- private_constant :RAILS_6_0
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
- rendered = Renderer.new(@lookup_context).render(self, { partial: __fetch_template!, layout: nil }, block)
25
+ rails_version = ::Rails.gem_version
25
26
 
26
- if ::Rails.gem_version >= RAILS_6_0
27
- rendered.body
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
- rendered
32
+ Renderer.new(@lookup_context).render(self, { partial: __fetch_template!, layout: nil }, block)
30
33
  end
31
34
  end
32
35
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Viu
4
- VERSION = "0.0.4"
4
+ VERSION = "0.0.5"
5
5
  end
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
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-29 00:00:00.000000000 Z
11
+ date: 2020-12-01 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler