ig3client 0.2.0 → 0.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. data/lib/ig3client.rb +12 -1
  2. metadata +4 -4
data/lib/ig3client.rb CHANGED
@@ -128,7 +128,7 @@ module Ig3tool
128
128
  Timeout::timeout(@timeout) do
129
129
  n.request(req) do |res|
130
130
  rez = YAML::load(res.read_body)
131
- raise rez["type"].to_sym.to_const, rez["message"].to_s if (res.code.to_i > 200)
131
+ _reraise(rez["type"].to_sym, rez["message"]) if res.code.to_i > 200
132
132
  if block_given?
133
133
  yield rez
134
134
  else
@@ -167,6 +167,17 @@ module Ig3tool
167
167
  define_method sym, body
168
168
  end
169
169
  end
170
+
171
+ private
172
+
173
+ def _reraise(sym, msg)
174
+ if Kernel.respond_to? :constant # facets sucks
175
+ raise constant(sym), msg
176
+ else
177
+ raise "#{sym}: #{msg}"
178
+ end
179
+ end
180
+
170
181
  end
171
182
 
172
183
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ig3client
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Kevin Pinte
@@ -9,7 +9,7 @@ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
 
12
- date: 2008-03-23 00:00:00 +01:00
12
+ date: 2008-03-28 00:00:00 +01:00
13
13
  default_executable:
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
@@ -19,7 +19,7 @@ dependencies:
19
19
  requirements:
20
20
  - - ">="
21
21
  - !ruby/object:Gem::Version
22
- version: 2.2.1
22
+ version: 2.4.0
23
23
  version:
24
24
  description:
25
25
  email: igtool@infogroep.be
@@ -57,7 +57,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
57
57
  version:
58
58
  requirements: []
59
59
 
60
- rubyforge_project:
60
+ rubyforge_project: ig3tool
61
61
  rubygems_version: 1.0.1
62
62
  signing_key:
63
63
  specification_version: 2