apidiesel 0.14 → 0.15
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/apidiesel/dsl.rb +8 -4
- data/lib/apidiesel/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 873c04eb2ac82ceffd0fa1099db4cc8d07e7f559
|
4
|
+
data.tar.gz: 6a7e3d77c247a66851bcced4798c0944b30b62fb
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a3e118d6ddf01b77bdad130f9218f0344a3e277f96269471057981d2aa772a5bfcf1b8d2ee154982eed84a0b3b07be8e0f430b75a072dd57556f1eb9c9655971
|
7
|
+
data.tar.gz: 3f8026f56c5e6e6d64434a3ca61f3284a4f79b6a6cb00970314aa3fdcb100336e88961b3fe4bd5b254e2d7fd3311a4ad79720b7f812cbd1998af27a7e21ef696
|
data/lib/apidiesel/dsl.rb
CHANGED
@@ -587,13 +587,17 @@ module Apidiesel
|
|
587
587
|
response_formatters << lambda do |data, processed_data|
|
588
588
|
return processed_data unless callable.call(data)
|
589
589
|
|
590
|
-
|
591
|
-
|
592
|
-
raise ResponseError.new(message)
|
590
|
+
raise ResponseError.new(error_message(message, data))
|
593
591
|
end
|
594
592
|
end
|
595
593
|
|
596
|
-
|
594
|
+
protected
|
595
|
+
|
596
|
+
def error_message(message, data)
|
597
|
+
return message if message.is_a?(String)
|
598
|
+
return message.call(data) if message.respond_to?(:call)
|
599
|
+
'unknown error'
|
600
|
+
end
|
597
601
|
|
598
602
|
def create_primitive_formatter(cast_method_symbol, *args, **kargs)
|
599
603
|
args = normalize_arguments(args, kargs)
|
data/lib/apidiesel/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: apidiesel
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: '0.
|
4
|
+
version: '0.15'
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jan-Christian Foeh
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-05-
|
11
|
+
date: 2016-05-31 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|