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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 3ad87035852538a80f4fa99e9eef0b5bf75023ddba90b23fb5547e751bb7dc44
4
- data.tar.gz: 050337e1fd66397e645bc5b4c5e9e08e97e58a518e4d4a212d32127e4ab46988
3
+ metadata.gz: 7a2ece3d41ebe4b298b5d317287bedb4e494b76b109fd953a90860c9aa989c2d
4
+ data.tar.gz: 87f678bdcf181af044e44778e73c9e25772c7aa22f6af027e7764fbf0098bb22
5
5
  SHA512:
6
- metadata.gz: e15a88017ad0820bf671a71d6f81b2acacf0c012caf8e597af36da4c1bd457af41cdfa833932193a746f38a1b00e86c3aab26360a9637c8c4db4fe66de10c156
7
- data.tar.gz: 981a56f68a7d8faff5777f6c124fc17c3c60bf9211d7d197abf2fe3ebb224d0ff03148f3e9a4fa0527d868921a3d6cfa909a0bbc3e6c651652ebde7f53631163
6
+ metadata.gz: decfd210daf96a6d5dc424ce2a808261bac54aff337696c13fb479ca4ea5162936adcd91dd6e6c0d88318e5bdbb8acd5501cdd86838a4431c2a04397853ce6a1
7
+ data.tar.gz: d5503ad9f4106bcf6ba8e964978c5ebf1b838153a1c849ab0f3254899868e80abb7e26b926d7a9670bc2e7cda13894b3972f27a01871b3484a4f21ce3105c843
@@ -1,5 +1,9 @@
1
1
  # CHANGELOG
2
2
 
3
+ ## 0.14.3 (April 22nd, 2020)
4
+
5
+ * Fix regression on Rails 4.2 (@tagliala)
6
+
3
7
  ## 0.14.2 (September 10th, 2019)
4
8
 
5
9
  * Made Rails 6 compatible (@jpawlyn)
@@ -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.is_a?(Enumerable) &&
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
@@ -1,3 +1,3 @@
1
1
  module Rabl
2
- VERSION = "0.14.2"
2
+ VERSION = "0.14.3"
3
3
  end
@@ -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.2
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: 2019-09-11 00:00:00.000000000 Z
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.3
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