rest_connection 1.0.3 → 1.0.4

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.
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- rest_connection (1.0.3)
4
+ rest_connection (1.0.4)
5
5
  activesupport (= 2.3.10)
6
6
  highline
7
7
  json
@@ -27,9 +27,16 @@ module RightScale
27
27
  def connection(*opts)
28
28
  @@little_brother_connection ||= RestConnection::Connection.new(*opts)
29
29
  settings = @@little_brother_connection.settings
30
- settings[:common_headers]["X_API_VERSION"] = "0.1"
30
+ settings[:common_headers]["X_API_VERSION"] = "1.0"
31
31
  settings[:api_href] = settings[:api_url]
32
32
  settings[:extension] = ".js"
33
+
34
+ unless @@little_brother_connection.respond_to?(:refresh_cookie)
35
+ @@little_brother_connection.instance_exec(&(RightScale::Api::BASE_COOKIE_REFRESH))
36
+ end
37
+
38
+ @@little_brother_connection.refresh_cookie unless @@little_brother_connection.cookie
39
+ settings[:common_headers]["X_API_VERSION"] = "0.1"
33
40
  @@little_brother_connection
34
41
  end
35
42
  end
@@ -27,23 +27,15 @@
27
27
  class RsInternal
28
28
  include RightScale::Api::Base
29
29
  extend RightScale::Api::BaseExtend
30
+ extend ::RightScale::Api::InternalConnection
30
31
 
31
32
  def connection
32
- @@little_brother_connection ||= RestConnection::Connection.new
33
- settings = @@little_brother_connection.settings
34
- settings[:common_headers]["X_API_VERSION"] = "0.1"
35
- settings[:api_href] = settings[:api_url]
36
- settings[:extension] = ".js"
37
- @@little_brother_connection
33
+ self.connection
38
34
  end
39
35
 
40
36
  def self.connection
41
- @@little_brother_connection ||= RestConnection::Connection.new
42
- settings = @@little_brother_connection.settings
43
- settings[:common_headers]["X_API_VERSION"] = "0.1"
44
- settings[:api_href] = settings[:api_url]
45
- settings[:extension] = ".js"
46
- @@little_brother_connection
37
+ # call connection defined in InternalConnection module
38
+ super
47
39
  end
48
40
 
49
41
  def self.get_server_template_multi_cloud_images(server_template_href)
@@ -1,4 +1,4 @@
1
1
  # This gem is versioned with the usual X.Y.Z notation
2
2
  module RestConnection
3
- VERSION = '1.0.3'
3
+ VERSION = '1.0.4'
4
4
  end
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rest_connection
3
3
  version: !ruby/object:Gem::Version
4
- hash: 17
4
+ hash: 31
5
5
  prerelease:
6
6
  segments:
7
7
  - 1
8
8
  - 0
9
- - 3
10
- version: 1.0.3
9
+ - 4
10
+ version: 1.0.4
11
11
  platform: ruby
12
12
  authors:
13
13
  - RightScale, Inc.
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2012-12-13 00:00:00 Z
18
+ date: 2012-12-21 00:00:00 Z
19
19
  dependencies:
20
20
  - !ruby/object:Gem::Dependency
21
21
  name: activesupport