fog-core 1.25.0 → 1.27.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.
- checksums.yaml +4 -4
- data/.travis.yml +3 -1
- data/CONTRIBUTORS.md +9 -0
- data/changelog.md +17 -0
- data/lib/fog/core/collection.rb +2 -2
- data/lib/fog/core/service.rb +38 -17
- data/lib/fog/core/version.rb +1 -1
- data/lib/fog/test_helpers/mock_helper.rb +0 -8
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c63e18b70536c9da2257bd579c2d7aaf834f1081
|
4
|
+
data.tar.gz: c6bcac1c3a20c3b6a325d488e701fd2bf8d891ff
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 20a699bee434d0c5c8423a50f2130352b4ef5c81588ddc3c9caeedfecb1c32847ba6d7fc8c2cbfd9aef6a69805eeee9718f3b5bfc81bcd6df1537ccd45675965
|
7
|
+
data.tar.gz: a6179a545d2f40071227baba705e327ce24ee767bae4d94dbba501f2903eed00f7e46352c1468c5faa2e204ff9879d9f4fbe9d92abaef42000d661ca6fc779b0
|
data/.travis.yml
CHANGED
@@ -13,6 +13,8 @@ rvm:
|
|
13
13
|
- jruby-19mode
|
14
14
|
- jruby-head
|
15
15
|
|
16
|
+
sudo: false
|
17
|
+
|
16
18
|
script: bundle exec rake travis
|
17
19
|
|
18
20
|
matrix:
|
@@ -52,4 +54,4 @@ notifications:
|
|
52
54
|
- "[#%{build_number}] %{compare_url}"
|
53
55
|
on_success: always
|
54
56
|
on_failure: always
|
55
|
-
use_notice: false
|
57
|
+
use_notice: false
|
data/CONTRIBUTORS.md
CHANGED
@@ -1,12 +1,21 @@
|
|
1
1
|
* Anatol <anatol.pomozov@gmail.com>
|
2
|
+
* Bryan Paxton <starbelly@pobox.com>
|
2
3
|
* Chris Johnson <wchrisjohnson@gmail.com>
|
4
|
+
* Chris Sinjakli <chris@sinjakli.co.uk>
|
3
5
|
* Dominic Cleal <dcleal@redhat.com>
|
4
6
|
* Evan Light <evan@tripledogdare.net>
|
7
|
+
* Jake Bell <jake@theunraveler.com>
|
8
|
+
* Josh Kalderimis <josh.kalderimis@gmail.com>
|
9
|
+
* Kevin Menard <kevin@nirvdrum.com>
|
10
|
+
* Matt Bostock <matt@mattbostock.com>
|
11
|
+
* Matt Darby <darby@mittdarko.com>
|
12
|
+
* Matt Darby <matt.darby@rackspace.com>
|
5
13
|
* Mike Hagedorn <mike@silverchairsolutions.com>
|
6
14
|
* Naoto TAKAHASHI <tnaoto@gmail.com>
|
7
15
|
* Paul Thornthwaite <paul@brightbox.co.uk>
|
8
16
|
* Paul Thornthwaite <tokengeek@gmail.com>
|
9
17
|
* Paulo Henrique Lopes Ribeiro <plribeiro3000@gmail.com>
|
10
18
|
* Wesley Beary <geemus+github@gmail.com>
|
19
|
+
* Wesley Beary <geemus@gmail.com>
|
11
20
|
* geemus <geemus@gmail.com>
|
12
21
|
* mountkin <moutkin@gmail.com>
|
data/changelog.md
CHANGED
@@ -1,3 +1,20 @@
|
|
1
|
+
1.27.0 12/12/2014
|
2
|
+
==========================================================
|
3
|
+
|
4
|
+
return fog/bin stuff to fog/fog
|
5
|
+
add support for multiple request/model load paths
|
6
|
+
|
7
|
+
|
8
|
+
1.26.0 12/02/2014
|
9
|
+
==========================================================
|
10
|
+
|
11
|
+
remove rackspace logic
|
12
|
+
use new travis builds
|
13
|
+
fix error handling around credential fetch
|
14
|
+
move fog/bin stuff to fog-core
|
15
|
+
fix circular reference in collection.rb
|
16
|
+
|
17
|
+
|
1
18
|
1.25.0 11/18/2014
|
2
19
|
==========================================================
|
3
20
|
|
data/lib/fog/core/collection.rb
CHANGED
@@ -141,10 +141,10 @@ module Fog
|
|
141
141
|
# Base class for collection classes whose 'all' method returns only a single page of results and passes the
|
142
142
|
# 'Marker' option along as self.filters[:marker]
|
143
143
|
class PagedCollection < Collection
|
144
|
-
def each(
|
144
|
+
def each(collection_filters = filters)
|
145
145
|
if block_given?
|
146
146
|
begin
|
147
|
-
page = all(
|
147
|
+
page = all(collection_filters)
|
148
148
|
# We need to explicitly use the base 'each' method here on the page, otherwise we get infinite recursion
|
149
149
|
base_each = Fog::Collection.instance_method(:each)
|
150
150
|
base_each.bind(page).call { |item| yield item }
|
data/lib/fog/core/service.rb
CHANGED
@@ -120,7 +120,7 @@ module Fog
|
|
120
120
|
def fetch_credentials(_options)
|
121
121
|
# attempt to load credentials from config file
|
122
122
|
Fog.credentials.reject { |key, _value| !(recognized | requirements).include?(key) }
|
123
|
-
rescue LoadError
|
123
|
+
rescue ::Fog::Errors::LoadError
|
124
124
|
# if there are no configured credentials, do nothing
|
125
125
|
{}
|
126
126
|
end
|
@@ -145,10 +145,15 @@ module Fog
|
|
145
145
|
@model_path = new_path
|
146
146
|
end
|
147
147
|
|
148
|
-
def collection(new_collection)
|
148
|
+
def collection(new_collection, path = nil)
|
149
|
+
collection_files << [path, new_collection]
|
149
150
|
collections << new_collection
|
150
151
|
end
|
151
152
|
|
153
|
+
def collection_files
|
154
|
+
@collection_files ||= []
|
155
|
+
end
|
156
|
+
|
152
157
|
def collections
|
153
158
|
@collections ||= []
|
154
159
|
end
|
@@ -177,8 +182,13 @@ module Fog
|
|
177
182
|
@mocked_requests ||= []
|
178
183
|
end
|
179
184
|
|
180
|
-
def model(new_model)
|
181
|
-
|
185
|
+
def model(new_model, path = nil)
|
186
|
+
models_files << [path, new_model]
|
187
|
+
models << [new_model]
|
188
|
+
end
|
189
|
+
|
190
|
+
def model_files
|
191
|
+
@model_files ||= []
|
182
192
|
end
|
183
193
|
|
184
194
|
def models
|
@@ -189,8 +199,8 @@ module Fog
|
|
189
199
|
@request_path = new_path
|
190
200
|
end
|
191
201
|
|
192
|
-
def request(new_request)
|
193
|
-
requests << new_request
|
202
|
+
def request(new_request, path = nil)
|
203
|
+
requests << [path, new_request]
|
194
204
|
end
|
195
205
|
|
196
206
|
def requests
|
@@ -261,17 +271,15 @@ module Fog
|
|
261
271
|
|
262
272
|
# This will attempt to require all model files declared by the service using fog"s DSL
|
263
273
|
def require_models
|
264
|
-
|
265
|
-
require File.join(@model_path, model.to_s)
|
266
|
-
end
|
274
|
+
model_files.each { |model| require_item(model, @model_path) }
|
267
275
|
end
|
268
276
|
|
269
277
|
def require_collections_and_define
|
270
|
-
|
271
|
-
|
272
|
-
constant = camel_case_collection_name(collection)
|
278
|
+
collection_files.each do |collection|
|
279
|
+
require_item(collection, @model_path)
|
280
|
+
constant = camel_case_collection_name(collection.last)
|
273
281
|
service::Collections.module_eval <<-EOS, __FILE__, __LINE__
|
274
|
-
def #{collection}(attributes = {})
|
282
|
+
def #{collection.last}(attributes = {})
|
275
283
|
#{service}::#{constant}.new({ :service => self }.merge(attributes))
|
276
284
|
end
|
277
285
|
EOS
|
@@ -290,18 +298,31 @@ module Fog
|
|
290
298
|
# This will attempt to require all request files declared in the service using fog"s DSL
|
291
299
|
def require_requests_and_mock
|
292
300
|
requests.each do |request|
|
293
|
-
|
294
|
-
if service::Mock.method_defined?(request)
|
295
|
-
mocked_requests << request
|
301
|
+
require_item(request, @request_path)
|
302
|
+
if service::Mock.method_defined?(request.last)
|
303
|
+
mocked_requests << request.last
|
296
304
|
else
|
297
305
|
service::Mock.module_eval <<-EOS, __FILE__, __LINE__
|
298
|
-
def #{request}(*args)
|
306
|
+
def #{request.last}(*args)
|
299
307
|
Fog::Mock.not_implemented
|
300
308
|
end
|
301
309
|
EOS
|
302
310
|
end
|
303
311
|
end
|
304
312
|
end
|
313
|
+
|
314
|
+
# Requires the correct file for an item (collection, model, or request).
|
315
|
+
#
|
316
|
+
# @param [Array] item
|
317
|
+
# An item to require. Should be an array in the form of [path, file].
|
318
|
+
# @param [String] fallback_dir
|
319
|
+
# The directory to look for the file in if the first element of `item`
|
320
|
+
# is nil.
|
321
|
+
# @return [Boolean] Returns the same as `Kernel#require`.
|
322
|
+
def require_item(item, fallback_dir)
|
323
|
+
path, file = item
|
324
|
+
require File.join(path || fallback_dir, file.to_s)
|
325
|
+
end
|
305
326
|
end
|
306
327
|
end
|
307
328
|
end
|
data/lib/fog/core/version.rb
CHANGED
@@ -13,9 +13,6 @@ if Fog.mock?
|
|
13
13
|
:aws_secret_access_key => "aws_secret_access_key",
|
14
14
|
:ia_access_key_id => "aws_access_key_id",
|
15
15
|
:ia_secret_access_key => "aws_secret_access_key",
|
16
|
-
:atmos_storage_token => "atmos_token",
|
17
|
-
:atmos_storage_secret => "atmos_secret",
|
18
|
-
:atmos_storage_endpoint => "http://atmos.is.cool:1000/test1.0",
|
19
16
|
:bluebox_api_key => "bluebox_api_key",
|
20
17
|
:bluebox_customer_id => "bluebox_customer_id",
|
21
18
|
:brightbox_client_id => "brightbox_client_id",
|
@@ -34,9 +31,6 @@ if Fog.mock?
|
|
34
31
|
:dnsimple_password => "dnsimple_password",
|
35
32
|
:dnsmadeeasy_api_key => "dnsmadeeasy_api_key",
|
36
33
|
:dnsmadeeasy_secret_key => "dnsmadeeasy_secret_key",
|
37
|
-
:ecloud_username => "ecloud_username",
|
38
|
-
:ecloud_password => "ecloud_password",
|
39
|
-
:ecloud_versions_uri => "http://ecloud.versions.uri",
|
40
34
|
:glesys_username => "glesys_username",
|
41
35
|
:glesys_api_key => "glesys_api_key",
|
42
36
|
:go_grid_api_key => "go_grid_api_key",
|
@@ -77,8 +71,6 @@ if Fog.mock?
|
|
77
71
|
:rackspace_username => "rackspace_username",
|
78
72
|
:riakcs_access_key_id => "riakcs_access_key_id",
|
79
73
|
:riakcs_secret_access_key => "riakcs_secret_access_key",
|
80
|
-
:storm_on_demand_username => "storm_on_demand_username",
|
81
|
-
:storm_on_demand_password => "storm_on_demand_password",
|
82
74
|
:vcloud_host => "vcloud_host",
|
83
75
|
:vcloud_password => "vcloud_password",
|
84
76
|
:vcloud_username => "vcloud_username",
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: fog-core
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.27.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Evan Light
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2014-
|
12
|
+
date: 2014-12-12 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: builder
|