rabl 0.16.0 → 0.17.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +9 -1
- data/README.md +1 -0
- data/lib/rabl/engine.rb +9 -3
- data/lib/rabl/railtie.rb +1 -1
- data/lib/rabl/renderer.rb +1 -1
- data/lib/rabl/template.rb +2 -2
- data/lib/rabl/version.rb +1 -1
- data/lib/rabl.rb +3 -3
- metadata +3 -115
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5516efe91fd9188c57c63465ae6a6fda3e06d7f3970f95cced74f43fd8ca753d
|
4
|
+
data.tar.gz: 972b6c08549be3090a41e26dd7161637bb8a1cbb970e074fae3917afb0bfbe40
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d1b99e44ff691ad2b25e1a9ad5a2347c4cde07292d898ec23e6fb0a1c4691b00bd1e488d9b3bdf71014ba9561cd5cd8ea1745c3f359fba68d33fa702b1d2e969
|
7
|
+
data.tar.gz: 723b8b9909c4454f5114bdbe4e81ec4cbe7b7bb80f9cbc1665d0a949e800ea207e82d2196eaf1a0346e52d2366e984768aed04eda2cbd6e4e315faf07f567b7b
|
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,13 @@
|
|
1
1
|
# CHANGELOG
|
2
2
|
|
3
|
+
## 0.17.0 (Nov 26, 2024)
|
4
|
+
|
5
|
+
* Support for Rails 8 (@basex)
|
6
|
+
|
7
|
+
## 0.16.1 (Oct 10, 2022)
|
8
|
+
|
9
|
+
* Fix ArgumentError when there are no keyword arguments for Ruby < 2.7 (Thanks @sylvain-8422)
|
10
|
+
|
3
11
|
## 0.16.0 (August 21, 2022)
|
4
12
|
|
5
13
|
* Add "except" option to `extends` (Thanks @perryqh)
|
@@ -11,7 +19,7 @@
|
|
11
19
|
|
12
20
|
* Support for Rails 7 (@tagliala)
|
13
21
|
* Improvements to unit testing
|
14
|
-
*
|
22
|
+
* Miscellaneous other bug fixes
|
15
23
|
|
16
24
|
## 0.14.5 (May 29th, 2021)
|
17
25
|
|
data/README.md
CHANGED
@@ -1,5 +1,6 @@
|
|
1
1
|
# RABL #
|
2
2
|
|
3
|
+
[![Gem Version](https://badge.fury.io/rb/rabl.svg)](https://badge.fury.io/rb/rabl)
|
3
4
|
[![Continuous Integration status](https://github.com/nesquena/rabl/actions/workflows/ci.yml/badge.svg)](https://github.com/nesquena/rabl/actions)
|
4
5
|
[![Code Climate](https://codeclimate.com/github/nesquena/rabl.svg)](https://codeclimate.com/github/nesquena/rabl)
|
5
6
|
|
data/lib/rabl/engine.rb
CHANGED
@@ -62,7 +62,7 @@ module Rabl
|
|
62
62
|
template = @_options[:template] || @virtual_path
|
63
63
|
|
64
64
|
digest =
|
65
|
-
if Rails.version.to_s =~ /^[
|
65
|
+
if Rails.version.to_s =~ /^[678]/
|
66
66
|
Digestor.digest(name: template, finder: lookup_context, format: :rabl)
|
67
67
|
elsif Gem::Version.new(Rails.version) >= Gem::Version.new('4.1')
|
68
68
|
Digestor.digest(:name => template, :finder => lookup_context)
|
@@ -357,7 +357,13 @@ module Rabl
|
|
357
357
|
|
358
358
|
# Supports calling helpers defined for the template context_scope using method_missing hook
|
359
359
|
def method_missing(name, *args, **kwargs, &block)
|
360
|
-
context_scope.respond_to?(name, true)
|
360
|
+
return super unless context_scope.respond_to?(name, true)
|
361
|
+
|
362
|
+
if kwargs.empty?
|
363
|
+
context_scope.__send__(name, *args, &block)
|
364
|
+
else
|
365
|
+
context_scope.__send__(name, *args, **kwargs, &block)
|
366
|
+
end
|
361
367
|
end
|
362
368
|
|
363
369
|
def copy_instance_variables_from(object, exclude = []) #:nodoc:
|
@@ -393,7 +399,7 @@ module Rabl
|
|
393
399
|
end
|
394
400
|
|
395
401
|
def digestor_available?
|
396
|
-
defined?(Rails) && Rails.version =~ /^[
|
402
|
+
defined?(Rails) && Rails.version =~ /^[45678]/
|
397
403
|
end
|
398
404
|
|
399
405
|
def valid_format?(format)
|
data/lib/rabl/railtie.rb
CHANGED
@@ -22,7 +22,7 @@ module Rabl
|
|
22
22
|
Rabl.register!
|
23
23
|
|
24
24
|
# Inject dependency tracker for :rabl
|
25
|
-
if Rails.version =~ /^[
|
25
|
+
if Rails.version =~ /^[45678]/
|
26
26
|
require 'action_view/dependency_tracker'
|
27
27
|
ActionView::DependencyTracker.register_tracker :rabl, Rabl::Tracker
|
28
28
|
end
|
data/lib/rabl/renderer.rb
CHANGED
@@ -42,7 +42,7 @@ module Rabl
|
|
42
42
|
# - context_scope:
|
43
43
|
# Override the render context_scope to the 'context_scope' object. Defaults to self.
|
44
44
|
#
|
45
|
-
# Returns: And object representing the
|
45
|
+
# Returns: And object representing the transformed object in the requested format.
|
46
46
|
# e.g. json, xml, bson, plist
|
47
47
|
def render(context_scope = nil)
|
48
48
|
context_scope ||= options[:scope] || self
|
data/lib/rabl/template.rb
CHANGED
@@ -62,8 +62,8 @@ if defined?(ActionView) && defined?(Rails) && Rails.respond_to?(:version) && Rai
|
|
62
62
|
ActionView::Template.register_template_handler :rabl, ActionView::Template::Handlers::Rabl
|
63
63
|
end
|
64
64
|
|
65
|
-
# Rails 6.X / 7.X Template
|
66
|
-
if defined?(ActionView) && defined?(Rails) && Rails.respond_to?(:version) && Rails.version.to_s =~ /^[
|
65
|
+
# Rails 6.X / 7.X / 8.X Template
|
66
|
+
if defined?(ActionView) && defined?(Rails) && Rails.respond_to?(:version) && Rails.version.to_s =~ /^[678]/
|
67
67
|
module ActionView
|
68
68
|
module Template::Handlers
|
69
69
|
class Rabl
|
data/lib/rabl/version.rb
CHANGED
data/lib/rabl.rb
CHANGED
@@ -17,9 +17,9 @@ require 'rabl/renderer'
|
|
17
17
|
require 'rabl/cache_engine'
|
18
18
|
|
19
19
|
if defined?(Rails) && Rails.respond_to?(:version)
|
20
|
-
require 'rabl/tracker' if Rails.version =~ /^[
|
21
|
-
require 'rabl/digestor' if Rails.version =~ /^[
|
22
|
-
require 'rabl/railtie' if Rails.version =~ /^[
|
20
|
+
require 'rabl/tracker' if Rails.version =~ /^[45678]/
|
21
|
+
require 'rabl/digestor' if Rails.version =~ /^[45678]/
|
22
|
+
require 'rabl/railtie' if Rails.version =~ /^[345678]/
|
23
23
|
end
|
24
24
|
|
25
25
|
# Rabl.register!
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rabl
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.17.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Nathan Esquenazi
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2024-11-26 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|
@@ -24,118 +24,6 @@ dependencies:
|
|
24
24
|
- - ">="
|
25
25
|
- !ruby/object:Gem::Version
|
26
26
|
version: 2.3.14
|
27
|
-
- !ruby/object:Gem::Dependency
|
28
|
-
name: riot
|
29
|
-
requirement: !ruby/object:Gem::Requirement
|
30
|
-
requirements:
|
31
|
-
- - "~>"
|
32
|
-
- !ruby/object:Gem::Version
|
33
|
-
version: 0.12.3
|
34
|
-
type: :development
|
35
|
-
prerelease: false
|
36
|
-
version_requirements: !ruby/object:Gem::Requirement
|
37
|
-
requirements:
|
38
|
-
- - "~>"
|
39
|
-
- !ruby/object:Gem::Version
|
40
|
-
version: 0.12.3
|
41
|
-
- !ruby/object:Gem::Dependency
|
42
|
-
name: rr
|
43
|
-
requirement: !ruby/object:Gem::Requirement
|
44
|
-
requirements:
|
45
|
-
- - ">="
|
46
|
-
- !ruby/object:Gem::Version
|
47
|
-
version: '0'
|
48
|
-
type: :development
|
49
|
-
prerelease: false
|
50
|
-
version_requirements: !ruby/object:Gem::Requirement
|
51
|
-
requirements:
|
52
|
-
- - ">="
|
53
|
-
- !ruby/object:Gem::Version
|
54
|
-
version: '0'
|
55
|
-
- !ruby/object:Gem::Dependency
|
56
|
-
name: rake
|
57
|
-
requirement: !ruby/object:Gem::Requirement
|
58
|
-
requirements:
|
59
|
-
- - ">="
|
60
|
-
- !ruby/object:Gem::Version
|
61
|
-
version: '0'
|
62
|
-
type: :development
|
63
|
-
prerelease: false
|
64
|
-
version_requirements: !ruby/object:Gem::Requirement
|
65
|
-
requirements:
|
66
|
-
- - ">="
|
67
|
-
- !ruby/object:Gem::Version
|
68
|
-
version: '0'
|
69
|
-
- !ruby/object:Gem::Dependency
|
70
|
-
name: tilt
|
71
|
-
requirement: !ruby/object:Gem::Requirement
|
72
|
-
requirements:
|
73
|
-
- - ">="
|
74
|
-
- !ruby/object:Gem::Version
|
75
|
-
version: '0'
|
76
|
-
type: :development
|
77
|
-
prerelease: false
|
78
|
-
version_requirements: !ruby/object:Gem::Requirement
|
79
|
-
requirements:
|
80
|
-
- - ">="
|
81
|
-
- !ruby/object:Gem::Version
|
82
|
-
version: '0'
|
83
|
-
- !ruby/object:Gem::Dependency
|
84
|
-
name: oj
|
85
|
-
requirement: !ruby/object:Gem::Requirement
|
86
|
-
requirements:
|
87
|
-
- - ">="
|
88
|
-
- !ruby/object:Gem::Version
|
89
|
-
version: '0'
|
90
|
-
type: :development
|
91
|
-
prerelease: false
|
92
|
-
version_requirements: !ruby/object:Gem::Requirement
|
93
|
-
requirements:
|
94
|
-
- - ">="
|
95
|
-
- !ruby/object:Gem::Version
|
96
|
-
version: '0'
|
97
|
-
- !ruby/object:Gem::Dependency
|
98
|
-
name: msgpack
|
99
|
-
requirement: !ruby/object:Gem::Requirement
|
100
|
-
requirements:
|
101
|
-
- - "~>"
|
102
|
-
- !ruby/object:Gem::Version
|
103
|
-
version: 1.0.0
|
104
|
-
type: :development
|
105
|
-
prerelease: false
|
106
|
-
version_requirements: !ruby/object:Gem::Requirement
|
107
|
-
requirements:
|
108
|
-
- - "~>"
|
109
|
-
- !ruby/object:Gem::Version
|
110
|
-
version: 1.0.0
|
111
|
-
- !ruby/object:Gem::Dependency
|
112
|
-
name: bson
|
113
|
-
requirement: !ruby/object:Gem::Requirement
|
114
|
-
requirements:
|
115
|
-
- - "~>"
|
116
|
-
- !ruby/object:Gem::Version
|
117
|
-
version: 1.7.0
|
118
|
-
type: :development
|
119
|
-
prerelease: false
|
120
|
-
version_requirements: !ruby/object:Gem::Requirement
|
121
|
-
requirements:
|
122
|
-
- - "~>"
|
123
|
-
- !ruby/object:Gem::Version
|
124
|
-
version: 1.7.0
|
125
|
-
- !ruby/object:Gem::Dependency
|
126
|
-
name: plist
|
127
|
-
requirement: !ruby/object:Gem::Requirement
|
128
|
-
requirements:
|
129
|
-
- - ">="
|
130
|
-
- !ruby/object:Gem::Version
|
131
|
-
version: '0'
|
132
|
-
type: :development
|
133
|
-
prerelease: false
|
134
|
-
version_requirements: !ruby/object:Gem::Requirement
|
135
|
-
requirements:
|
136
|
-
- - ">="
|
137
|
-
- !ruby/object:Gem::Version
|
138
|
-
version: '0'
|
139
27
|
description: General ruby templating with json, bson, xml and msgpack support
|
140
28
|
email:
|
141
29
|
- nesquena@gmail.com
|
@@ -184,7 +72,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
184
72
|
- !ruby/object:Gem::Version
|
185
73
|
version: '0'
|
186
74
|
requirements: []
|
187
|
-
rubygems_version: 3.
|
75
|
+
rubygems_version: 3.5.22
|
188
76
|
signing_key:
|
189
77
|
specification_version: 4
|
190
78
|
summary: General ruby templating with json, bson, xml and msgpack support
|