nested 0.0.9 → 0.0.10

Sign up to get free protection for your applications and to get access to all the features.
Files changed (4) hide show
  1. checksums.yaml +4 -4
  2. data/lib/nested.rb +6 -4
  3. data/nested.gemspec +1 -1
  4. metadata +2 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 27598f96705c4a9b647048ef032121d310fd3646
4
- data.tar.gz: cd15467a29499cb6bd1c648a00f0c6455c567372
3
+ metadata.gz: 0848b622722b803a47292fbb298a97c0ca097154
4
+ data.tar.gz: 5698f92ae5a96473cb82eac89aeeb07b79c92de3
5
5
  SHA512:
6
- metadata.gz: 30ec9775adca2477d587ddead84a29416d7c71f7782a1a5ae66953f4be1ebb58ecab7d5762f34c150b69c7cd598f0fa3257b099bcae821d17a623d79d2bcf46b
7
- data.tar.gz: e751dbad8babce5e2fc565293eb6b9351d36d9a7a9745b9c81a3e7a861f2b2c6c2935de72c05822263ea16df5eba85a25f85be643fdbe539f1fc470239715263
6
+ metadata.gz: 4f0b1548126982be321fe5b0ef13861fff316516ee430eefe98785862df2b48cf3673ac23cfb67595208eb600f91a3dd6d518e79ac0c30f4ea884e646577285c
7
+ data.tar.gz: b5280a354b1be353fa9c1014580a62b8612ec3a3625372c51eef614ee8dc859d404823cb77045f8d77b6c73d905409b6f1fc46beb208b82c1502c59b4b1d61cb
data/lib/nested.rb CHANGED
@@ -180,18 +180,20 @@ module Nested
180
180
 
181
181
  def sinatra_init_data(sinatra, &block)
182
182
  sinatra.request.body.rewind
183
- @__raw_data = HashWithIndifferentAccess.new(JSON.parse(sinatra.request.body.read))
184
- @__data = @__raw_data.values_at(*block.parameters.map(&:last))
183
+ raw_data = HashWithIndifferentAccess.new(JSON.parse(sinatra.request.body.read))
184
+
185
+ sinatra.instance_variable_set("@__raw_data", raw_data)
186
+ sinatra.instance_variable_set("@__data", raw_data.values_at(*block.parameters.map(&:last)))
185
187
  end
186
188
 
187
189
  def sinatra_exec_put_block(sinatra, &block)
188
190
  sinatra_init_data(sinatra, &block)
189
- sinatra.instance_exec(*@__data, &block)
191
+ sinatra.instance_exec(*sinatra.instance_variable_get("@__data"), &block)
190
192
  end
191
193
 
192
194
  def sinatra_exec_post_block(sinatra, &block)
193
195
  sinatra_init_data(sinatra, &block)
194
- res = sinatra.instance_exec(*@__data, &block)
196
+ res = sinatra.instance_exec(*sinatra.instance_variable_get("@__data"), &block)
195
197
  sinatra.instance_variable_set("@#{self.instance_variable_name}", res)
196
198
  end
197
199
 
data/nested.gemspec CHANGED
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |s|
2
2
  s.name = "nested"
3
- s.version = "0.0.9"
3
+ s.version = "0.0.10"
4
4
 
5
5
  s.authors = ["Jan Zimmek"]
6
6
  s.email = %q{jan.zimmek@web.de}
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: nested
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.9
4
+ version: 0.0.10
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jan Zimmek
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2013-11-05 00:00:00.000000000 Z
11
+ date: 2013-11-07 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport