rabl 0.11.3 → 0.11.4

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,15 +1,7 @@
1
1
  ---
2
- !binary "U0hBMQ==":
3
- metadata.gz: !binary |-
4
- MzdjNWZkZTE2ZWVkZTI2N2NkMzgxZjI3OWQxMDdiYTQ5NWY4NjQwNA==
5
- data.tar.gz: !binary |-
6
- NGYyZDRjY2NjMDdjYWExOGYyM2RlMDlkMzI5MTMzNjY3NmYyN2Y1Nw==
7
- !binary "U0hBNTEy":
8
- metadata.gz: !binary |-
9
- YWIzNmM2ZTY2OTVjNjgwYjZmMzc0OWZlZTIzZjZmZTcyZWExOTkyYjdiMjMw
10
- N2MwMWRkOTY0OGQ0MDUzMTIwYTQ4YTVkZmUzYzNhYzZiZmMzZDI3MDliN2Nj
11
- MTczMTA3MTRhNmQ3ZDZhNzg3YTY2MzU3M2UzZmNlOTM2Y2Q1NzI=
12
- data.tar.gz: !binary |-
13
- OWI5MzE3OTM5ZWQ4YTBkZTM3MGUwYWFmNmIyYmZhY2VmYmY2YjI1NTIyYzVm
14
- YWQwMjYxZmNlMzJhODM2YzRiY2Q3Y2U4MDI5NzVkNzc3MGEyOGRhN2VlM2Qy
15
- OWNiZmFmMjYxNGUyNzY1NDZiMWUwNzRiNmRhMjI2YWExZDJmMzY=
2
+ SHA1:
3
+ metadata.gz: 653e59826616815f5be896620c6e11bfde575596
4
+ data.tar.gz: e3cf65575ec7aa5698a24119e761c0959433aefb
5
+ SHA512:
6
+ metadata.gz: 6ff1aa2e4f4b7f7f91d70210d8faec3063dabe58a06d9d313e9c9ab195177296ee40ffbd0e8873ff65258fca4f4f32d9132d0ce74424a3f6c7a036ff411037e3
7
+ data.tar.gz: e3112ccd7ff15031956053833d59c49bacf908db0998352015fe975d500570b2f5395c9f972cca25b52864c3e1d5170ef97f0c6ce45c3bdafe56196bc4befc97
data/CHANGELOG.md CHANGED
@@ -1,5 +1,9 @@
1
1
  # CHANGELOG
2
2
 
3
+ ## 0.11.4 (November 7th)
4
+
5
+ * FIX Get MultiBuilder to behave properly around nil engines (@DouweM)
6
+
3
7
  ## 0.11.3 (November 3rd)
4
8
 
5
9
  * FIX error when attempting to cache empty child collections (@DouweM)
data/lib/rabl/builder.rb CHANGED
@@ -117,20 +117,13 @@ module Rabl
117
117
 
118
118
  def merge_engines_into_result
119
119
  engines.each do |engine|
120
- # engine was stored in the form { name => #<Engine> }
121
- if engine.is_a?(Hash)
120
+ case engine
121
+ when Hash
122
+ # engine was stored in the form { name => #<Engine> }
122
123
  engine.each do |key, value|
123
- if value.is_a?(Engine)
124
- value = value.render
125
-
126
- if value
127
- engine[key] = value
128
- else
129
- engine.delete(key)
130
- end
131
- end
124
+ engine[key] = value.render if value.is_a?(Engine)
132
125
  end
133
- elsif engine.is_a?(Engine)
126
+ when Engine
134
127
  engine = engine.render
135
128
  end
136
129
 
@@ -60,17 +60,19 @@ module Rabl
60
60
  end
61
61
 
62
62
  def disable_cache_read_on_render(engine)
63
- if engine.is_a?(Hash)
63
+ case engine
64
+ when Hash
64
65
  disable_cache_read_on_render(engine.values.first)
65
- else
66
+ when Engine
66
67
  engine.cache_read_on_render = false
67
68
  end
68
69
  end
69
70
 
70
71
  def cache_key_for(engine)
71
- if engine.is_a?(Hash)
72
+ case engine
73
+ when Hash
72
74
  cache_key_for(engine.values.first)
73
- else
75
+ when Engine
74
76
  engine.cache_key
75
77
  end
76
78
  end
data/lib/rabl/renderer.rb CHANGED
@@ -1,8 +1,8 @@
1
1
  module Rabl
2
2
  class Renderer
3
3
  # Defines class method rendering in supported formats
4
- # Rabl::Renderer.json('posts/show', @post)
5
- # Rabl::Renderer.xml('posts/show', @post)
4
+ # Rabl::Renderer.json(@post, 'posts/show')
5
+ # Rabl::Renderer.xml(@post, 'posts/show')
6
6
  Rabl::Engine::FORMATS.each do |fmt|
7
7
  instance_eval <<-CODE
8
8
  def #{fmt}(object, source, options = {})
data/lib/rabl/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Rabl
2
- VERSION = "0.11.3"
2
+ VERSION = "0.11.4"
3
3
  end
metadata CHANGED
@@ -1,27 +1,27 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rabl
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.11.3
4
+ version: 0.11.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Nathan Esquenazi
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-11-03 00:00:00.000000000 Z
11
+ date: 2014-11-08 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - ! '>='
17
+ - - '>='
18
18
  - !ruby/object:Gem::Version
19
19
  version: 2.3.14
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
- - - ! '>='
24
+ - - '>='
25
25
  - !ruby/object:Gem::Version
26
26
  version: 2.3.14
27
27
  - !ruby/object:Gem::Dependency
@@ -56,42 +56,42 @@ dependencies:
56
56
  name: rake
57
57
  requirement: !ruby/object:Gem::Requirement
58
58
  requirements:
59
- - - ! '>='
59
+ - - '>='
60
60
  - !ruby/object:Gem::Version
61
61
  version: '0'
62
62
  type: :development
63
63
  prerelease: false
64
64
  version_requirements: !ruby/object:Gem::Requirement
65
65
  requirements:
66
- - - ! '>='
66
+ - - '>='
67
67
  - !ruby/object:Gem::Version
68
68
  version: '0'
69
69
  - !ruby/object:Gem::Dependency
70
70
  name: tilt
71
71
  requirement: !ruby/object:Gem::Requirement
72
72
  requirements:
73
- - - ! '>='
73
+ - - '>='
74
74
  - !ruby/object:Gem::Version
75
75
  version: '0'
76
76
  type: :development
77
77
  prerelease: false
78
78
  version_requirements: !ruby/object:Gem::Requirement
79
79
  requirements:
80
- - - ! '>='
80
+ - - '>='
81
81
  - !ruby/object:Gem::Version
82
82
  version: '0'
83
83
  - !ruby/object:Gem::Dependency
84
84
  name: oj
85
85
  requirement: !ruby/object:Gem::Requirement
86
86
  requirements:
87
- - - ! '>='
87
+ - - '>='
88
88
  - !ruby/object:Gem::Version
89
89
  version: '0'
90
90
  type: :development
91
91
  prerelease: false
92
92
  version_requirements: !ruby/object:Gem::Requirement
93
93
  requirements:
94
- - - ! '>='
94
+ - - '>='
95
95
  - !ruby/object:Gem::Version
96
96
  version: '0'
97
97
  - !ruby/object:Gem::Dependency
@@ -126,14 +126,14 @@ dependencies:
126
126
  name: plist
127
127
  requirement: !ruby/object:Gem::Requirement
128
128
  requirements:
129
- - - ! '>='
129
+ - - '>='
130
130
  - !ruby/object:Gem::Version
131
131
  version: '0'
132
132
  type: :development
133
133
  prerelease: false
134
134
  version_requirements: !ruby/object:Gem::Requirement
135
135
  requirements:
136
- - - ! '>='
136
+ - - '>='
137
137
  - !ruby/object:Gem::Version
138
138
  version: '0'
139
139
  description: General ruby templating with json, bson, xml and msgpack support
@@ -458,17 +458,17 @@ require_paths:
458
458
  - lib
459
459
  required_ruby_version: !ruby/object:Gem::Requirement
460
460
  requirements:
461
- - - ! '>='
461
+ - - '>='
462
462
  - !ruby/object:Gem::Version
463
463
  version: '0'
464
464
  required_rubygems_version: !ruby/object:Gem::Requirement
465
465
  requirements:
466
- - - ! '>='
466
+ - - '>='
467
467
  - !ruby/object:Gem::Version
468
468
  version: '0'
469
469
  requirements: []
470
470
  rubyforge_project: rabl
471
- rubygems_version: 2.0.7
471
+ rubygems_version: 2.0.6
472
472
  signing_key:
473
473
  specification_version: 4
474
474
  summary: General ruby templating with json, bson, xml and msgpack support
@@ -496,3 +496,4 @@ test_files:
496
496
  - test/template_test.rb
497
497
  - test/teststrap.rb
498
498
  - test/xml_test.rb
499
+ has_rdoc: