jb 0.8.1 → 0.8.2

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: 59c07bc2a0d9dd1b6e304a1f6c3037ccd2234cda1a5273ff8f0d12bb1e814270
4
- data.tar.gz: 545f3b027f587ab30de9d2e93fad5b3ea399ad8a6695b9090d3e7b55085ab505
3
+ metadata.gz: b8532f278227b3fc1282898874bf192c8ccf72d8fd3c1d40f1fb4d2751c1894f
4
+ data.tar.gz: 395b638d4565433fa519951b12a906f32448d7c4a35a531f099679e0ed643366
5
5
  SHA512:
6
- metadata.gz: b9ef88b516a5bee2132af07f394a00f03bfda2928764b538189aa061d9af1c60c4942cb874d416e5d36265839bac1df8463cb5c8e795536000a903bbbecadc25
7
- data.tar.gz: e0b272e833109cd995104fa033208eca904922a3ef66148dcbe583665917393efd99120800605ae9c35c3527f2530ee96762ee5bb991f650538f7dd0c896fab7
6
+ metadata.gz: 7a1e9e60aee2347cc897ec6ec10061faf4b008b840dc6c95de373ca3d3ec1544853487c0be54b2a2777713dbff5b15a4fc35af04d25d106f6ba908db896af09c
7
+ data.tar.gz: c696aacf1ed03636f984980ab60a5a5b53eab6d4c54ad0562392daae1e32dc82464a59073e57c6061414634e6c49a8250787cda15c90be90dce7395e91a699f4
@@ -11,7 +11,7 @@ jobs:
11
11
  strategy:
12
12
  matrix:
13
13
  ruby_version: [ruby-head, '3.2', '3.1', '3.0', '2.7']
14
- rails_version: [edge, '7.0', '6.1']
14
+ rails_version: [edge, '7.1', '7.0', '6.1']
15
15
 
16
16
  include:
17
17
  - ruby_version: '3.0'
data/.gitignore CHANGED
@@ -9,3 +9,4 @@ gemfiles/*.lock
9
9
  /spec/reports/
10
10
  /tmp/
11
11
  /test/dummy_app/log/*
12
+ /test/dummy_app/tmp/
@@ -13,15 +13,18 @@ module Jb
13
13
  end
14
14
  end
15
15
 
16
+ # A wrapper class for template result that makes `to_s` method do nothing
17
+ class TemplateResult < SimpleDelegator
18
+ def to_s
19
+ __getobj__
20
+ end
21
+ end
22
+
16
23
  # Rails 7.1+: A monkey-patch not to stringify rendered object from JB templates
17
- module BaseToSCanceller
24
+ module TemlateResultCaster
18
25
  def _run(method, template, *, **)
19
26
  val = super
20
- if template.respond_to?(:handler) && (template.handler == Jb::Handler)
21
- def val.to_s
22
- self
23
- end
24
- end
27
+ val = Jb::TemplateResult.new val if template.respond_to?(:handler) && (template.handler == Jb::Handler)
25
28
  val
26
29
  end
27
30
  end
@@ -58,7 +61,7 @@ module Jb
58
61
  end
59
62
 
60
63
  ::ActionView::TemplateRenderer.prepend ::Jb::TemplateRenderer::JSONizer
61
- ::ActionView::Base.prepend ::Jb::BaseToSCanceller if (ActionView::VERSION::MAJOR >= 7) && (ActionView::VERSION::MINOR >= 1)
64
+ ::ActionView::Base.prepend ::Jb::TemlateResultCaster if (ActionView::VERSION::MAJOR >= 7) && (ActionView::VERSION::MINOR >= 1)
62
65
  begin
63
66
  # ActionView::CollectionRenderer is a newly added class since 6.1
64
67
  ::ActionView::CollectionRenderer.prepend ::Jb::CollectionRendererExtension
data/lib/jb/version.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Jb
4
- VERSION = '0.8.1'
4
+ VERSION = '0.8.2'
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: jb
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.8.1
4
+ version: 0.8.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Akira Matsuda
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2023-09-16 00:00:00.000000000 Z
11
+ date: 2023-11-04 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler