studio_api 3.1.1 → 3.1.2

Sign up to get free protection for your applications and to get access to all the features.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 3.1.1
1
+ 3.1.2
@@ -63,7 +63,7 @@ module StudioApi
63
63
  @password = password
64
64
  self.uri = uri
65
65
  self.proxy = options[:proxy] #nil as default is OK
66
- @timeout = options[:timeout].to_i || 45
66
+ @timeout = (options[:timeout] || 45).to_i
67
67
  @ssl = options[:ssl] || { :verify_mode => OpenSSL::SSL::VERIFY_NONE } # don't verify as default
68
68
  end
69
69
 
@@ -22,19 +22,6 @@ module StudioApi
22
22
 
23
23
  alias_method :cancel, :destroy
24
24
 
25
- def save
26
- response = super
27
- rescue ActiveResource::BadRequest => e
28
- tree = XmlSimple.xml_in(e.response.body)
29
- code = tree["code"][0]
30
- if code == "image_already_exists"
31
- message = tree["message"][0]
32
- raise ImageAlreadyExists.new message
33
- else
34
- raise e
35
- end
36
- end
37
-
38
25
  private
39
26
  #overwrite create as studio doesn't interact well with enclosed parameters
40
27
  def create
@@ -46,6 +33,15 @@ private
46
33
  connection.post(request_str,"",self.class.headers).tap do |response|
47
34
  load_attributes_from_response response
48
35
  end
36
+ rescue ActiveResource::BadRequest => e
37
+ tree = XmlSimple.xml_in(e.response.body)
38
+ code = tree["code"][0]
39
+ if code == "image_already_exists"
40
+ message = tree["message"][0]
41
+ raise ImageAlreadyExists.new message
42
+ else
43
+ raise e
44
+ end
49
45
  end
50
46
  end
51
47
 
@@ -1,3 +1,9 @@
1
+ Mon Jul 18 11:33:38 CEST 2011 Flavio Castelli <flavio@castelli.name>
2
+
3
+ - ensure the timeout value is properly set.
4
+ See https://github.com/jreidinger/studio_api/issues/3
5
+ for more details.
6
+
1
7
  Fri May 14:30:55 CEST 2011 Flavio Castelli <flavio@castelli.name>
2
8
 
3
9
  - code refactorying of the unit tests
@@ -18,4 +18,8 @@ class ConnectionTest < Test::Unit::TestCase
18
18
  @connection.api_version #test caching, if it again call, then mocha raise exception
19
19
  end
20
20
 
21
+ def test_default_timeout
22
+ assert_equal 45, @connection.timeout
23
+ end
24
+
21
25
  end
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: studio_api
3
3
  version: !ruby/object:Gem::Version
4
- hash: 1
4
+ hash: 7
5
5
  prerelease:
6
6
  segments:
7
7
  - 3
8
8
  - 1
9
- - 1
10
- version: 3.1.1
9
+ - 2
10
+ version: 3.1.2
11
11
  platform: ruby
12
12
  authors:
13
13
  - Josef Reidinger
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2011-05-06 00:00:00 +02:00
18
+ date: 2011-07-18 00:00:00 +02:00
19
19
  default_executable:
20
20
  dependencies:
21
21
  - !ruby/object:Gem::Dependency
@@ -184,7 +184,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
184
184
  requirements: []
185
185
 
186
186
  rubyforge_project: studio_api
187
- rubygems_version: 1.6.2
187
+ rubygems_version: 1.5.2
188
188
  signing_key:
189
189
  specification_version: 3
190
190
  summary: Intuitive ruby bindings to Studio Api Interface.