fog-brightbox 0.0.1 → 0.0.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: 6e8e0a4337ce1090b15746deb6601ce046ab5a16
4
- data.tar.gz: 6f1ed505b468ae1651713ef96e1d269583669501
3
+ metadata.gz: 545235da7a29e463f8d587e93877768734a9fbdf
4
+ data.tar.gz: a65459d49a1aaa80806fe7eef11d036ef013c4a7
5
5
  SHA512:
6
- metadata.gz: f834becf04d20fae09bb5492978320d47f5d67512ea8a8a6554c90943ba2bd7a7f102998cd473175da2ad310d3ca97ce28302e4be559fe7ad310ea502a8e6352
7
- data.tar.gz: 35c867371334ce552d61429b20075cac591e87dcbb5a2b2819a6b8c87b51e10bae4d87dc37441dd5cb05084fc6eab562ae26546f4c151dd5571895888b8adfdf
6
+ metadata.gz: 5cd98aa3b09e85451374d02388be19442feb6ad3c4d6c1ea1f4f023c250ddccd4ac872f6b42be64ff8f04cf2287869c29c0a6581216273b0939e500f455f7ec0
7
+ data.tar.gz: 2675b489187ed02e5226634c5189c98934e5e541c5430a0be61b6e550834b4a8c8ac115b974250abd9aa10468598e545a8ce26c24861c6b39f12b11d2ccecc49
data/.gitignore ADDED
@@ -0,0 +1 @@
1
+ Gemfile.lock
data/CHANGELOG.md ADDED
@@ -0,0 +1,18 @@
1
+ ### 0.0.2 / 2014-04-10
2
+
3
+ Bug fixes:
4
+
5
+ * Add CHANGELOG.md to `fog-brightbox` module.
6
+ * Add MiniTest::Specs to project. Use `rake test` to check the code.
7
+ * Add Gemfile, Rakefile, README and LICENCE to start documenting project.
8
+ * Remove redundant calls to `Fog.credentials`. The code flow was such that the
9
+ credentials were being passed in to `Fog::Compute::Brightbox` anyway.
10
+ * Isolate testing from contents of `~.fog` file which is leaking in throug the
11
+ `Fog.credentials` global.
12
+
13
+ ### 0.0.1 / 2014-02-19
14
+
15
+ Enhancements:
16
+
17
+ * Initial release of extracted `fog-brightbox` module. This is pretty much the
18
+ pilot for fog modules so bear with us as we iron out the bugs.
data/Gemfile ADDED
@@ -0,0 +1,3 @@
1
+ source "https://rubygems.org"
2
+
3
+ gemspec
data/LICENSE.txt ADDED
@@ -0,0 +1,22 @@
1
+ Copyright (c) 2014 Brightbox Systems Ltd.
2
+
3
+ MIT License
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining
6
+ a copy of this software and associated documentation files (the
7
+ "Software"), to deal in the Software without restriction, including
8
+ without limitation the rights to use, copy, modify, merge, publish,
9
+ distribute, sublicense, and/or sell copies of the Software, and to
10
+ permit persons to whom the Software is furnished to do so, subject to
11
+ the following conditions:
12
+
13
+ The above copyright notice and this permission notice shall be
14
+ included in all copies or substantial portions of the Software.
15
+
16
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
17
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
18
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
19
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
20
+ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
21
+ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
22
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
data/README.md ADDED
@@ -0,0 +1,50 @@
1
+ # Brightbox Cloud module for fog (The Ruby cloud services library)
2
+
3
+ This gem is a modular for the `fog` gem that allows you to manage resources in
4
+ the Brightbox Cloud.
5
+
6
+ It is included by the main `fog` metagem but can used as an independent library
7
+ in other applications.
8
+
9
+ This includes support for the following services:
10
+
11
+ * Compute
12
+ * Images
13
+ * Load Balancers
14
+ * SQL Cloud instances
15
+
16
+ Currently all services are grouped within `compute` but will be moved to their
17
+ own sections when standardisation of fog progresses.
18
+
19
+ ## Installation
20
+
21
+ Add this line to your application's Gemfile:
22
+
23
+ gem "fog-brightbox"
24
+
25
+ And then execute:
26
+
27
+ $ bundle
28
+
29
+ Or install it yourself as:
30
+
31
+ $ gem install fog-brightbox
32
+
33
+ ## Usage
34
+
35
+ Please see the following references for instructions using the main `fog` gem
36
+ and its modules:
37
+
38
+ * https://github.com/fog/fog
39
+ * http://fog.io/
40
+ * http://rubydoc.info/gems/fog/
41
+
42
+ ## Contributing
43
+
44
+ `fog` modules are kept within the main repo.
45
+
46
+ 1. Fork it ( http://github.com/fog/fog/fork )
47
+ 2. Create your feature branch (`git checkout -b my-new-feature`)
48
+ 3. Commit your changes (`git commit -am 'Add some feature'`)
49
+ 4. Push to the branch (`git push origin my-new-feature`)
50
+ 5. Create new Pull Request
data/Rakefile ADDED
@@ -0,0 +1,8 @@
1
+ require "bundler/gem_tasks"
2
+ require "rake/testtask"
3
+
4
+ task :default => :test
5
+
6
+ Rake::TestTask.new do |t|
7
+ t.pattern = File.join("spec", "**", "*_spec.rb")
8
+ end
@@ -24,5 +24,5 @@ Gem::Specification.new do |spec|
24
24
 
25
25
  spec.add_development_dependency "bundler", "~> 1.3"
26
26
  spec.add_development_dependency "rake"
27
- spec.add_development_dependency "shindo"
27
+ spec.add_development_dependency "minitest"
28
28
  end
@@ -45,21 +45,21 @@ module Fog
45
45
  #
46
46
  def initialize(options)
47
47
  # Currently authentication and api endpoints are the same but may change
48
- @auth_url = options[:brightbox_auth_url] || Fog.credentials[:brightbox_auth_url] || API_URL
48
+ @auth_url = options[:brightbox_auth_url] || API_URL
49
49
  @auth_connection = Fog::Core::Connection.new(@auth_url)
50
50
 
51
- @api_url = options[:brightbox_api_url] || Fog.credentials[:brightbox_api_url] || API_URL
51
+ @api_url = options[:brightbox_api_url] || API_URL
52
52
  @connection_options = options[:connection_options] || {}
53
53
  @persistent = options[:persistent] || false
54
54
  @connection = Fog::Core::Connection.new(@api_url, @persistent, @connection_options)
55
55
 
56
56
  # Authentication options
57
- client_id = options[:brightbox_client_id] || Fog.credentials[:brightbox_client_id]
58
- client_secret = options[:brightbox_secret] || Fog.credentials[:brightbox_secret]
57
+ client_id = options[:brightbox_client_id]
58
+ client_secret = options[:brightbox_secret]
59
59
 
60
- username = options[:brightbox_username] || Fog.credentials[:brightbox_username]
61
- password = options[:brightbox_password] || Fog.credentials[:brightbox_password]
62
- @configured_account = options[:brightbox_account] || Fog.credentials[:brightbox_account]
60
+ username = options[:brightbox_username]
61
+ password = options[:brightbox_password]
62
+ @configured_account = options[:brightbox_account]
63
63
  # Request account can be changed at anytime and changes behaviour of future requests
64
64
  @scoped_account = @configured_account
65
65
 
@@ -1,5 +1,5 @@
1
1
  module Fog
2
2
  module Brightbox
3
- VERSION = "0.0.1"
3
+ VERSION = "0.0.2"
4
4
  end
5
5
  end
@@ -0,0 +1,49 @@
1
+ require "minitest/autorun"
2
+ require "fog/brightbox"
3
+
4
+ describe Fog::Compute::Brightbox do
5
+ describe "when global config is available" do
6
+ before do
7
+ @arguments = {
8
+ :brightbox_auth_url => "http://localhost",
9
+ :brightbox_api_url => "http://localhost",
10
+ :brightbox_client_id => "",
11
+ :brightbox_secret => "",
12
+ :brightbox_username => "",
13
+ :brightbox_password => "",
14
+ :brightbox_account => ""
15
+ }
16
+
17
+ @credential_guard = Minitest::Mock.new
18
+ def @credential_guard.reject
19
+ {}
20
+ end
21
+
22
+ Fog.stub :credentials, @credential_guard do
23
+ @service = Fog::Compute::Brightbox.new(@arguments)
24
+ end
25
+ end
26
+
27
+ it "responds to #request" do
28
+ assert_respond_to @service, :request
29
+ end
30
+
31
+ it "responds to #request_access_token" do
32
+ assert_respond_to @service, :request_access_token
33
+ end
34
+
35
+ it "responds to #wrapped_request" do
36
+ assert_respond_to @service, :wrapped_request
37
+ end
38
+ end
39
+
40
+ describe "when created without required arguments" do
41
+ it "raises an error" do
42
+ Fog.stub :credentials, {} do
43
+ assert_raises ArgumentError do
44
+ Fog::Compute::Brightbox.new({})
45
+ end
46
+ end
47
+ end
48
+ end
49
+ end
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.0.1
4
+ version: 0.0.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-02-19 00:00:00.000000000 Z
11
+ date: 2014-04-10 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: fog-core
@@ -67,7 +67,7 @@ dependencies:
67
67
  - !ruby/object:Gem::Version
68
68
  version: '0'
69
69
  - !ruby/object:Gem::Dependency
70
- name: shindo
70
+ name: minitest
71
71
  requirement: !ruby/object:Gem::Requirement
72
72
  requirements:
73
73
  - - ">="
@@ -87,6 +87,12 @@ executables: []
87
87
  extensions: []
88
88
  extra_rdoc_files: []
89
89
  files:
90
+ - ".gitignore"
91
+ - CHANGELOG.md
92
+ - Gemfile
93
+ - LICENSE.txt
94
+ - README.md
95
+ - Rakefile
90
96
  - fog-brightbox.gemspec
91
97
  - lib/fog/brightbox.rb
92
98
  - lib/fog/brightbox/compute.rb
@@ -232,6 +238,7 @@ files:
232
238
  - lib/fog/brightbox/requests/compute/update_server_group.rb
233
239
  - lib/fog/brightbox/requests/compute/update_user.rb
234
240
  - lib/fog/brightbox/version.rb
241
+ - spec/fog/compute/brightbox_spec.rb
235
242
  homepage: ''
236
243
  licenses:
237
244
  - MIT
@@ -252,10 +259,10 @@ required_rubygems_version: !ruby/object:Gem::Requirement
252
259
  version: '0'
253
260
  requirements: []
254
261
  rubyforge_project:
255
- rubygems_version: 2.2.1
262
+ rubygems_version: 2.2.2
256
263
  signing_key:
257
264
  specification_version: 4
258
265
  summary: This library can be used as a module for `fog` or as standalone provider
259
266
  to use the Brightbox Cloud in applications
260
- test_files: []
261
- has_rdoc:
267
+ test_files:
268
+ - spec/fog/compute/brightbox_spec.rb