nested 0.0.20 → 0.0.21

Sign up to get free protection for your applications and to get access to all the features.
Files changed (5) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile.lock +7 -7
  3. data/lib/nested.rb +19 -7
  4. data/nested.gemspec +1 -1
  5. metadata +1 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 1a7ac105733a5c7bab517c0414c54f7483d1c0d8
4
- data.tar.gz: c4d0bb6b2bfb8d18eee1a2257b4fb960b4dc7833
3
+ metadata.gz: 99b658c995d93d8b0dda8b3c9d37ad960ed05479
4
+ data.tar.gz: 530220cfb3d7ea5009306e39c07ca8631abaf0fe
5
5
  SHA512:
6
- metadata.gz: cd3a6acb935adc5433038f07a72a5b50bb45ad9ca699ed2355762ab2dbba74c36ee78681bcfa5cb699c41c1af84e243b8f51860a9f52b6df8e4c2cbdee300676
7
- data.tar.gz: 7a95f0db8cfa7931a7a0b214e9f35ccf275fb781660be0fd0d6276f32cbf3a82958bac8f81c9949a18e6a7f3fcbf7a586309e0f0bae55afa47dbe07a714e45c4
6
+ metadata.gz: 1e34af8825ff7696e5d8f16bda06e5f5084c01bb2d0aad3f9a5ea9154477394f7449a4a4c2e7796da53aca8f94f55a93cb51899606eaeebf99a9f5d9b321f50f
7
+ data.tar.gz: d874154cb151c301db00cab8e6d895969068e2d1af7f772966005611602f396b50a7974d8d3a6e8d686a763d941aecfe9eae7bc15bbf01a796d25a143571dbf7
data/Gemfile.lock CHANGED
@@ -1,16 +1,16 @@
1
1
  GEM
2
2
  remote: https://rubygems.org/
3
3
  specs:
4
- activemodel (4.0.1)
5
- activesupport (= 4.0.1)
4
+ activemodel (4.0.2)
5
+ activesupport (= 4.0.2)
6
6
  builder (~> 3.1.0)
7
- activerecord (4.0.1)
8
- activemodel (= 4.0.1)
7
+ activerecord (4.0.2)
8
+ activemodel (= 4.0.2)
9
9
  activerecord-deprecated_finders (~> 1.0.2)
10
- activesupport (= 4.0.1)
10
+ activesupport (= 4.0.2)
11
11
  arel (~> 4.0.0)
12
12
  activerecord-deprecated_finders (1.0.3)
13
- activesupport (4.0.1)
13
+ activesupport (4.0.2)
14
14
  i18n (~> 0.6, >= 0.6.4)
15
15
  minitest (~> 4.2)
16
16
  multi_json (~> 1.3)
@@ -19,7 +19,7 @@ GEM
19
19
  arel (4.0.1)
20
20
  atomic (1.1.14)
21
21
  builder (3.1.4)
22
- i18n (0.6.5)
22
+ i18n (0.6.9)
23
23
  json (1.8.1)
24
24
  metaclass (0.0.1)
25
25
  minitest (4.7.5)
data/lib/nested.rb CHANGED
@@ -297,7 +297,6 @@ module Nested
297
297
  puts "sinatra router [#{method}] #{@sinatra.nested_config[:prefix]}#{route}"
298
298
 
299
299
  @sinatra.send(method, route) do
300
-
301
300
  def self.error(message)
302
301
  errors.add(:base, message)
303
302
  end
@@ -306,15 +305,28 @@ module Nested
306
305
  @__errors ||= ActiveModel::Errors.new({})
307
306
  end
308
307
 
309
- content_type :json
308
+ begin
309
+ content_type :json
310
310
 
311
- resource.self_and_parents.reverse.each do |res|
312
- res.sinatra_init(self)
313
- end
311
+ resource.self_and_parents.reverse.each do |res|
312
+ res.sinatra_init(self)
313
+ end
314
314
 
315
- resource.send(:"sinatra_exec_#{method}_block", self, &block)
315
+ resource.send(:"sinatra_exec_#{method}_block", self, &block)
316
316
 
317
- resource.sinatra_response(self, method)
317
+ resource.sinatra_response(self, method)
318
+ rescue Exception => e
319
+ context_arr = []
320
+ context_arr << "route: #{route}"
321
+ context_arr << "method: #{method}"
322
+ context_arr << "action: #{action}"
323
+ context_arr << "resource: #{resource.name} (#{resource.type})"
324
+
325
+ resource_object = instance_variable_get("@#{resource.instance_variable_name}")
326
+ context_arr << "@#{resource.instance_variable_name}: #{resource_object.inspect}"
327
+ puts context_arr.join("\n")
328
+ raise e
329
+ end
318
330
  end
319
331
  end
320
332
  end
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.20"
3
+ s.version = "0.0.21"
4
4
 
5
5
  s.authors = ["Jan Zimmek"]
6
6
  s.email = %q{jan.zimmek@web.de}
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: nested
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.20
4
+ version: 0.0.21
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jan Zimmek