fog-brightbox 0.7.1 → 0.7.2

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 1ceab58130b1687c75932bd53be5455950a3f7f8
4
- data.tar.gz: 851bb3bed538588fbbdc0ee9827afcf8ac02e2eb
3
+ metadata.gz: 19f50dbd6fab54d437c1b83755cbebeba0ae2086
4
+ data.tar.gz: a4005908605f1d2fc9a754eb9250644ddc59fa08
5
5
  SHA512:
6
- metadata.gz: 374a94033bb49c034ba1db1f8f62ed899243e3e28d6b79975806b403e573d4b9757278e96d2354e11ae476dcd43ed51f7f38d26feabc5e367af10296ac11a544
7
- data.tar.gz: 4a80fc6844ce04cd65d4f5e3d9274d4f0f7b6d4add941560ce3451f01ddcfa9ccd5c7d7f4436b07328ea73b5a0b0fcd5397345b9fb2f288f490b9d770e3b2d13
6
+ metadata.gz: cafa999266123be2945077625739f96c9f63c207788ad6f4f4ff1ec6026dec89edea3c94d399dbec6066fd18a18ce2b514ee83b4e199082781e2279373b839d5
7
+ data.tar.gz: 1a0f45971ad2c886ad0eb6c532431e604e1303bddbc88781ed024009ddb6df82990e15e4300f26cc2d1e7974d31f30c47f43e653d89117f130642661f032325f
data/.travis.yml CHANGED
@@ -1,6 +1,7 @@
1
1
  language: ruby
2
2
  rvm:
3
- - 2.1.1
3
+ - 2.2.0
4
+ - 2.1.5
4
5
  - 2.0.0
5
6
  - 1.9.3
6
7
  matrix:
data/CHANGELOG.md CHANGED
@@ -1,3 +1,15 @@
1
+ ### 0.7.2 / 2015-06-25
2
+
3
+ Bug fixes:
4
+
5
+ * Error if management URL is not `URI` to prevent errors when a `String` given.
6
+ * `Server#bits` returns "64" as a placeholder rather than "0".
7
+ * Fixed requires in specs so can they can all run independently.
8
+
9
+ Changes:
10
+
11
+ * Fixed some indentation problems.
12
+
1
13
  ### 0.7.1 / 2014-12-05
2
14
 
3
15
  Bug fixes:
data/lib/fog/brightbox.rb CHANGED
@@ -1,2 +1,11 @@
1
+ # See the main fog gem for more details about the top level class {Fog}
2
+ #
3
+ # @see https://github.com/fog/fog
4
+ # @see http://fog.io/
5
+ # @see http://rubydoc.info/gems/fog
6
+ #
7
+ module Fog
8
+ end
9
+
1
10
  require "fog/brightbox/compute"
2
11
  require "fog/brightbox/storage"
@@ -9,8 +9,6 @@ module Fog
9
9
  # is told a token has expired then another will not retry it.
10
10
  #
11
11
  class Config
12
- attr_writer :storage_management_url
13
-
14
12
  # Creates a new set of configuration settings based on the options provided.
15
13
  #
16
14
  # @param [Hash] options The configuration settings
@@ -94,6 +92,12 @@ module Fog
94
92
  URI.parse(@options[:brightbox_storage_url] || "https://orbit.brightbox.com")
95
93
  end
96
94
 
95
+ # The {#storage_management_url} is based on the {#storage_url} and the account details used when
96
+ # autheticating. This is normally automatically discovered within the servive but can be
97
+ # overridden in the {Config}
98
+ #
99
+ # @return [URI] if the URL is configured
100
+ # @return [nil] if the URL is not configured
97
101
  def storage_management_url
98
102
  @storage_management_url ||= if @options.key?(:brightbox_storage_management_url)
99
103
  URI.parse(@options[:brightbox_storage_management_url])
@@ -102,6 +106,13 @@ module Fog
102
106
  end
103
107
  end
104
108
 
109
+ # @param [URI] management_url The +URI+ to use for management requests.
110
+ # @raise [ArgumentError] if non +URI+ object passed
111
+ def storage_management_url=(management_url)
112
+ raise ArgumentError unless management_url.kind_of?(URI)
113
+ @storage_management_url = management_url
114
+ end
115
+
105
116
  # @return [String] The configured identifier of the API client or user application.
106
117
  def client_id
107
118
  @options[:brightbox_client_id]
@@ -20,7 +20,7 @@ module Fog
20
20
  attribute :ram
21
21
 
22
22
  def bits
23
- 0 # This is actually based on the Image type used. 32bit or 64bit Images are supported
23
+ 64 # This is actually based on the Image type used. 32bit or 64bit Images are supported
24
24
  end
25
25
  end
26
26
  end
@@ -1,5 +1,6 @@
1
1
  require "fog/compute/models/server"
2
2
  require "fog/brightbox/compute/resource_locking"
3
+ require "fog/brightbox/model_helper"
3
4
 
4
5
  module Fog
5
6
  module Compute
@@ -1,10 +1,10 @@
1
- # This module covers Brightbox's partial implementation of OAuth 2.0
2
- # and enables fog clients to implement several authentictication strategies
3
- #
4
- # @see http://tools.ietf.org/html/draft-ietf-oauth-v2-10
5
- #
6
1
  module Fog
7
2
  module Brightbox
3
+ # This module covers Brightbox's partial implementation of OAuth 2.0
4
+ # and enables fog clients to implement several authentictication strategies
5
+ #
6
+ # @see http://tools.ietf.org/html/draft-ietf-oauth-v2-10
7
+ #
8
8
  module OAuth2
9
9
  # This builds the simplest form of requesting an access token
10
10
  # based on the arguments passed in
@@ -19,9 +19,9 @@ module Fog
19
19
  begin
20
20
  raise ArgumentError if params.nil?
21
21
  request_params = params.merge(
22
- :headers => request_headers(params),
23
- :path => path_in_params(params)
24
- )
22
+ :headers => request_headers(params),
23
+ :path => path_in_params(params)
24
+ )
25
25
  response = @connection.request(request_params)
26
26
  rescue Excon::Errors::Unauthorized => error
27
27
  raise AuthenticationRequired.slurp(error)
@@ -59,8 +59,8 @@ module Fog
59
59
 
60
60
  def authenticated_headers
61
61
  default_headers.merge(
62
- "X-Auth-Token" => @config.latest_access_token
63
- )
62
+ "X-Auth-Token" => @config.latest_access_token
63
+ )
64
64
  end
65
65
 
66
66
  def default_headers
@@ -1,5 +1,5 @@
1
1
  module Fog
2
2
  module Brightbox
3
- VERSION = "0.7.1"
3
+ VERSION = "0.7.2"
4
4
  end
5
5
  end
@@ -238,4 +238,20 @@ describe Fog::Brightbox::Config do
238
238
  refute @config.user_credentials?
239
239
  end
240
240
  end
241
+
242
+ describe "when setting management_url with URI" do
243
+ it "sets it correctly" do
244
+ uri = URI.parse("https://example.com")
245
+ @config = Fog::Brightbox::Config.new
246
+ @config.storage_management_url = uri
247
+ assert_equal @config.storage_management_url, uri
248
+ end
249
+ end
250
+
251
+ describe "when setting management_url with String" do
252
+ it "raises ArgumentError" do
253
+ uri = "http://example.com/wrong"
254
+ assert_raises(ArgumentError) { Fog::Brightbox::Config.new.storage_management_url = uri }
255
+ end
256
+ end
241
257
  end
@@ -1,6 +1,4 @@
1
- require "minitest/autorun"
2
- require "webmock/minitest"
3
- require "fog/brightbox"
1
+ require "spec_helper"
4
2
 
5
3
  describe Fog::Brightbox::Storage::AuthenticationRequest do
6
4
  include StockStorageResponses
@@ -1,6 +1,4 @@
1
- require "minitest/autorun"
2
- require "webmock/minitest"
3
- require "fog/brightbox"
1
+ require "spec_helper"
4
2
 
5
3
  describe Fog::Storage::Brightbox do
6
4
  include StockStorageResponses
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fog-brightbox
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.7.1
4
+ version: 0.7.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Paul Thornthwaite
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-12-05 00:00:00.000000000 Z
11
+ date: 2015-06-25 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: fog-core
@@ -398,7 +398,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
398
398
  version: '0'
399
399
  requirements: []
400
400
  rubyforge_project:
401
- rubygems_version: 2.2.2
401
+ rubygems_version: 2.4.5
402
402
  signing_key:
403
403
  specification_version: 4
404
404
  summary: This library can be used as a module for `fog` or as standalone provider