rabl 0.9.1 → 0.9.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- ZjAzMDNhYTIyNjk1OTg1YjE5N2NiNzNhYThmMGIyMTQzY2Y2MTk1NA==
4
+ MmMxOGI3M2JkYjU2OWVjNjRlNTI2NjlkYTY0Y2Q4ZWI0ZjgxODI4MA==
5
5
  data.tar.gz: !binary |-
6
- NzI2ZGQ3MDQ0ZjY0NDk5NTFjZmRhZmJkYjEzMjNiYjMzMWM1N2MzNw==
6
+ MjE2YmIxNjQxMTllODk5NTcxNzgzNTUxOGUyZWFmNmIxM2VlOGYwZg==
7
7
  !binary "U0hBNTEy":
8
8
  metadata.gz: !binary |-
9
- OWViYTRkNWFjZTQ1MWU2NWRlMTUwNTlkNzQ5NzBkNjQyZGJlZjQ3OGU5Yjcy
10
- NzhkNWE5YTM0MmYzMTEzZDE0OWIxN2E0YzYzOTUwNzg4OTQ5MDNmYjhmMDI3
11
- YWUxMjNmZTIyZjE2NGRmMzE4N2VhYmYxYmI0YmJiMWM1MGMzYmQ=
9
+ OTU1YTdmZjc4MjBiMGYxMmJhODQxNTNlNDM4YmEzMTkzYjdmNzY1NTgzZWY1
10
+ N2Y3Zjk4NTAyNTcyOTM5ZGQzZmFhZTcwM2VmNTIzYTEwM2Q1ZGYzNzViNTE2
11
+ YTE1MjZhMTcxYjg0ZjYxZTlkYzA5ZWY3NGI3ODM0ZmQ1NjQxOTg=
12
12
  data.tar.gz: !binary |-
13
- OTRiYTVjMTkxZTVkOWNmMGI4MjgyYTA2MTcwNzcxOGZlMzdkYjAwZGNjZGI3
14
- NDEyYjRlMTM0MGI0YWI0ZjhhMWM4ZDhjYjI0ZGIxNjlhZmQxNDlkZDljYjgz
15
- NzcwOGM0OThiZDI4ODFjZTc5ZDkwM2FjZWVjNTU2MDU4NDdjNmQ=
13
+ MGFmZmVhYThiOTY0NWM5OWViY2E3YTk5YjQ1YzRlZDZjNTEyNzUxNTIxZGFi
14
+ MGE2Zjk5NzFmYzQ4M2E5MWYwZTFmYmVkNzJiNDNlNWNmZGQ1NTAxMTM1MjUx
15
+ MzEzYjlmNzc2Y2MyMjg1MDM0ZTUzNzYyNmQ5ZWMzNmIxMTM2MTk=
data/CHANGELOG.md CHANGED
@@ -1,5 +1,9 @@
1
1
  # CHANGELOG
2
2
 
3
+ ## 0.9.2 (November 21 2013)
4
+
5
+ * FIX #508 by avoiding new proc syntax breaking 1.8.7
6
+
3
7
  ## 0.9.1 (November 17 2013)
4
8
 
5
9
  * NEW #507 Resolve conditionals for extends (Thanks @micahcraig)
data/lib/rabl/builder.rb CHANGED
@@ -126,11 +126,14 @@ module Rabl
126
126
  @_result.merge!(result) if result.is_a?(Hash)
127
127
  end
128
128
 
129
+ # Evaluate conditions given a symbol to evaluate
129
130
  def call_condition_proc(condition, object, &blk)
130
131
  blk = lambda { |v| v } unless block_given?
131
132
  if condition.respond_to?(:call)
133
+ # condition is a block to pass to the block
132
134
  blk.call(condition.call(object))
133
135
  elsif condition.is_a?(Symbol) && object.respond_to?(condition)
136
+ # condition is a property of the object
134
137
  blk.call(object.send(condition))
135
138
  else
136
139
  false
@@ -147,7 +150,8 @@ module Rabl
147
150
  result = options[:if] == true || call_condition_proc(options[:if], @_object)
148
151
  end
149
152
  if options.has_key?(:unless)
150
- result = options[:unless] == false || call_condition_proc(options[:unless], @_object, &:!)
153
+ inverse_proc = lambda { |r| !r }
154
+ result = options[:unless] == false || call_condition_proc(options[:unless], @_object, &inverse_proc)
151
155
  end
152
156
  result
153
157
  end
data/lib/rabl/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Rabl
2
- VERSION = "0.9.1"
2
+ VERSION = "0.9.2"
3
3
  end
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.9.1
4
+ version: 0.9.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Nathan Esquenazi
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2013-11-18 00:00:00.000000000 Z
11
+ date: 2013-11-22 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport