rabl 0.14.2 → 0.14.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +4 -0
- data/lib/rabl/helpers.rb +1 -1
- data/lib/rabl/version.rb +1 -1
- data/test/helpers_test.rb +10 -0
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7a2ece3d41ebe4b298b5d317287bedb4e494b76b109fd953a90860c9aa989c2d
|
4
|
+
data.tar.gz: 87f678bdcf181af044e44778e73c9e25772c7aa22f6af027e7764fbf0098bb22
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: decfd210daf96a6d5dc424ce2a808261bac54aff337696c13fb479ca4ea5162936adcd91dd6e6c0d88318e5bdbb8acd5501cdd86838a4431c2a04397853ce6a1
|
7
|
+
data.tar.gz: d5503ad9f4106bcf6ba8e964978c5ebf1b838153a1c849ab0f3254899868e80abb7e26b926d7a9670bc2e7cda13894b3972f27a01871b3484a4f21ce3105c843
|
data/CHANGELOG.md
CHANGED
data/lib/rabl/helpers.rb
CHANGED
@@ -84,7 +84,7 @@ module Rabl
|
|
84
84
|
def is_collection?(obj, follow_symbols = true)
|
85
85
|
data_obj = follow_symbols ? data_object(obj) : obj
|
86
86
|
data_obj &&
|
87
|
-
data_obj.
|
87
|
+
data_obj.respond_to?(:map) && data_obj.respond_to?(:each) &&
|
88
88
|
!(data_obj.is_a?(Struct) ||
|
89
89
|
defined?(Hashie::Mash) && data_obj.is_a?(Hashie::Mash))
|
90
90
|
end
|
data/lib/rabl/version.rb
CHANGED
data/test/helpers_test.rb
CHANGED
@@ -114,6 +114,16 @@ context "Rabl::Helpers" do
|
|
114
114
|
@helper_class.is_collection?(obj.new)
|
115
115
|
end.equals(false)
|
116
116
|
|
117
|
+
asserts "returns false for an object with map" do
|
118
|
+
obj = Class.new { def map; end }
|
119
|
+
@helper_class.is_collection?(obj.new)
|
120
|
+
end.equals(false)
|
121
|
+
|
122
|
+
asserts "returns true for an object with each and map" do
|
123
|
+
obj = Class.new { def each; end; def map; end }
|
124
|
+
@helper_class.is_collection?(obj.new)
|
125
|
+
end.equals(true)
|
126
|
+
|
117
127
|
asserts "returns false for a hash alias" do
|
118
128
|
@helper_class.is_collection?(@user => :user)
|
119
129
|
end.equals(false)
|
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.14.
|
4
|
+
version: 0.14.3
|
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: 2020-04-22 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|
@@ -740,7 +740,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
740
740
|
- !ruby/object:Gem::Version
|
741
741
|
version: '0'
|
742
742
|
requirements: []
|
743
|
-
rubygems_version: 3.0.
|
743
|
+
rubygems_version: 3.0.6
|
744
744
|
signing_key:
|
745
745
|
specification_version: 4
|
746
746
|
summary: General ruby templating with json, bson, xml and msgpack support
|