fog-core 1.29.0 → 1.30.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +1 -1
- data/changelog.md +18 -0
- data/fog-core.gemspec +19 -19
- data/lib/fog/core/attributes/time.rb +2 -0
- data/lib/fog/core/service.rb +1 -1
- data/lib/fog/core/stringify_keys.rb +1 -6
- data/lib/fog/core/time.rb +1 -1
- data/lib/fog/core/version.rb +1 -1
- data/lib/fog/core/wait_for.rb +6 -6
- data/lib/fog/core/whitelist_keys.rb +1 -1
- data/lib/fog/formatador.rb +2 -4
- data/spec/core/stringify_keys_spec.rb +38 -0
- data/spec/core/whitelist_keys_spec.rb +36 -0
- data/spec/fog_attribute_spec.rb +10 -0
- data/spec/formatador_spec.rb +136 -54
- data/spec/spec_helper.rb +5 -6
- data/spec/wait_for_spec.rb +9 -1
- metadata +50 -48
- data/tests/core/stringify_keys_tests.rb +0 -29
- data/tests/core/whitelist_keys_tests.rb +0 -24
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: bb77e8ccc89ecb7205337d9c92666d4f8bc6d178
|
4
|
+
data.tar.gz: d4f44471fbd8b9cd657434892d7eed7ddec97ac7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 63da74409e5d99166cf7faeb919666e6431ee684df5b847a0a98ab1334cb90d96be532efaf202409415cddfcad83c0d580b74a8bc0a21b8a448003086a89aae4
|
7
|
+
data.tar.gz: 0ba76e5d693e6386f4fca2e259730553b97dafbff420102d1b0bd50d0c5b4332b0aacbe11022339c6493931937f3f0fc8f1398eb79efdb059102bb492016e79c
|
data/README.md
CHANGED
@@ -24,7 +24,7 @@ TODO: Write usage instructions here
|
|
24
24
|
|
25
25
|
## Contributing
|
26
26
|
|
27
|
-
1. Fork it ( http://github.com
|
27
|
+
1. Fork it ( http://github.com/fog/fog-core/fork )
|
28
28
|
2. Create your feature branch (`git checkout -b my-new-feature`)
|
29
29
|
3. Commit your changes (`git commit -am 'Add some feature'`)
|
30
30
|
4. Push to the branch (`git push origin my-new-feature`)
|
data/changelog.md
CHANGED
@@ -1,3 +1,21 @@
|
|
1
|
+
1.30.0 04/02/2015
|
2
|
+
==========================================================
|
3
|
+
|
4
|
+
bump excon dep
|
5
|
+
use float times, instead of integers for Fog::Time
|
6
|
+
don't raise if final wait_for yield true
|
7
|
+
fix bug around formatador and #map on models
|
8
|
+
fix around `to_time` to avoid conflicts with Rails monkey patches
|
9
|
+
update specs
|
10
|
+
update style
|
11
|
+
fix `WhitelistKeys` for 1.8.7
|
12
|
+
remove unreachable code
|
13
|
+
convert hash helpers to minispec
|
14
|
+
fix require order for coverage
|
15
|
+
fix ruby 2.2 warning
|
16
|
+
bump excon dependency
|
17
|
+
fix readme link
|
18
|
+
|
1
19
|
1.29.0 02/19/2015
|
2
20
|
==========================================================
|
3
21
|
|
data/fog-core.gemspec
CHANGED
@@ -1,36 +1,36 @@
|
|
1
1
|
# coding: utf-8
|
2
|
-
lib = File.expand_path(
|
2
|
+
lib = File.expand_path("../lib", __FILE__)
|
3
3
|
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
4
|
-
require
|
4
|
+
require "fog/core/version"
|
5
5
|
|
6
6
|
Gem::Specification.new do |spec|
|
7
7
|
spec.name = "fog-core"
|
8
8
|
spec.version = Fog::Core::VERSION
|
9
9
|
spec.authors = ["Evan Light", "Wesley Beary"]
|
10
10
|
spec.email = ["evan@tripledogdare.net", "geemus@gmail.com"]
|
11
|
-
spec.summary =
|
12
|
-
spec.description =
|
11
|
+
spec.summary = "Shared classes and tests for fog providers and services."
|
12
|
+
spec.description = "Shared classes and tests for fog providers and services."
|
13
13
|
spec.homepage = "https://github.com/fog/fog-core"
|
14
14
|
spec.license = "MIT"
|
15
15
|
|
16
|
-
spec.files = `git ls-files`.split(
|
16
|
+
spec.files = `git ls-files`.split($INPUT_RECORD_SEPARATOR)
|
17
17
|
spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
|
18
18
|
spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
|
19
19
|
spec.require_paths = ["lib"]
|
20
20
|
|
21
|
-
spec.add_dependency(
|
22
|
-
spec.add_dependency(
|
23
|
-
spec.add_dependency(
|
24
|
-
spec.add_dependency(
|
25
|
-
spec.add_dependency(
|
26
|
-
spec.add_dependency(
|
21
|
+
spec.add_dependency("builder")
|
22
|
+
spec.add_dependency("excon", "~> 0.45")
|
23
|
+
spec.add_dependency("formatador", "~> 0.2")
|
24
|
+
spec.add_dependency("mime-types")
|
25
|
+
spec.add_dependency("net-scp", "~> 1.1")
|
26
|
+
spec.add_dependency("net-ssh", ">= 2.1.3")
|
27
27
|
|
28
|
-
spec.add_development_dependency(
|
29
|
-
spec.add_development_dependency(
|
30
|
-
spec.add_development_dependency(
|
31
|
-
spec.add_development_dependency(
|
32
|
-
spec.add_development_dependency(
|
33
|
-
spec.add_development_dependency(
|
34
|
-
spec.add_development_dependency(
|
35
|
-
spec.add_development_dependency(
|
28
|
+
spec.add_development_dependency("coveralls")
|
29
|
+
spec.add_development_dependency("minitest")
|
30
|
+
spec.add_development_dependency("minitest-stub-const")
|
31
|
+
spec.add_development_dependency("pry")
|
32
|
+
spec.add_development_dependency("rake")
|
33
|
+
spec.add_development_dependency("rubocop") if RUBY_VERSION.to_s >= "1.9.3"
|
34
|
+
spec.add_development_dependency("thor")
|
35
|
+
spec.add_development_dependency("yard")
|
36
36
|
end
|
@@ -10,6 +10,8 @@ module Fog
|
|
10
10
|
def #{name}=(new_#{name})
|
11
11
|
attributes[:#{name}] = if new_#{name}.nil? || new_#{name} == "" || new_#{name}.is_a?(::Time)
|
12
12
|
new_#{name}
|
13
|
+
elsif ::String === new_#{name}
|
14
|
+
::Time.parse(new_#{name})
|
13
15
|
elsif new_#{name}.respond_to?(:to_time)
|
14
16
|
new_#{name}.to_time
|
15
17
|
else
|
data/lib/fog/core/service.rb
CHANGED
@@ -10,13 +10,8 @@ module Fog
|
|
10
10
|
private
|
11
11
|
|
12
12
|
# http://devblog.avdi.org/2009/11/20/hash-transforms-in-ruby/
|
13
|
-
def self.transform_hash(original,
|
13
|
+
def self.transform_hash(original, &block)
|
14
14
|
original.reduce({}) do |result, (key, value)|
|
15
|
-
value = if options[:deep] && Hash === value
|
16
|
-
transform_hash(value, options, &block)
|
17
|
-
else
|
18
|
-
value
|
19
|
-
end
|
20
15
|
block.call(result, key, value)
|
21
16
|
result
|
22
17
|
end
|
data/lib/fog/core/time.rb
CHANGED
data/lib/fog/core/version.rb
CHANGED
data/lib/fog/core/wait_for.rb
CHANGED
@@ -3,14 +3,14 @@ module Fog
|
|
3
3
|
duration = 0
|
4
4
|
start = Time.now
|
5
5
|
retries = 0
|
6
|
-
|
6
|
+
loop do
|
7
|
+
break if yield
|
8
|
+
if duration > timeout
|
9
|
+
raise Errors::TimeoutError, "The specified wait_for timeout (#{timeout} seconds) was exceeded"
|
10
|
+
end
|
7
11
|
sleep(interval.respond_to?(:call) ? interval.call(retries += 1).to_f : interval.to_f)
|
8
12
|
duration = Time.now - start
|
9
13
|
end
|
10
|
-
|
11
|
-
raise Errors::TimeoutError, "The specified wait_for timeout (#{timeout} seconds) was exceeded"
|
12
|
-
else
|
13
|
-
{ :duration => duration }
|
14
|
-
end
|
14
|
+
{ :duration => duration }
|
15
15
|
end
|
16
16
|
end
|
data/lib/fog/formatador.rb
CHANGED
@@ -15,8 +15,6 @@ module Fog
|
|
15
15
|
string << "#{indentation}>"
|
16
16
|
end
|
17
17
|
|
18
|
-
|
19
|
-
|
20
18
|
def self.display_line(data)
|
21
19
|
::Formatador.display_line(data)
|
22
20
|
end
|
@@ -69,7 +67,7 @@ module Fog
|
|
69
67
|
def self.nested_objects_string(object)
|
70
68
|
nested = ""
|
71
69
|
return nested if object.respond_to?(:empty) and object.empty?
|
72
|
-
return nested unless object.
|
70
|
+
return nested unless object.is_a?(Enumerable)
|
73
71
|
nested = "#{indentation}[\n"
|
74
72
|
indent { nested << indentation + inspect_object(object) }
|
75
73
|
nested << "#{indentation}\n#{indentation}]\n"
|
@@ -83,7 +81,7 @@ module Fog
|
|
83
81
|
end
|
84
82
|
|
85
83
|
def self.inspect_object(object)
|
86
|
-
return "" unless object.
|
84
|
+
return "" unless object.is_a?(Enumerable)
|
87
85
|
object.map { |o| indentation + o.inspect }.join(", \n#{indentation}")
|
88
86
|
end
|
89
87
|
end
|
@@ -0,0 +1,38 @@
|
|
1
|
+
require "spec_helper"
|
2
|
+
|
3
|
+
describe "Fog::StringifyKeys" do
|
4
|
+
describe ".stringify" do
|
5
|
+
describe "when key is a Symbol" do
|
6
|
+
it "replaces key with String" do
|
7
|
+
input = { :key => "value" }
|
8
|
+
output = Fog::StringifyKeys.stringify(input)
|
9
|
+
assert(output.key?("key"))
|
10
|
+
end
|
11
|
+
end
|
12
|
+
|
13
|
+
describe "when key is a String" do
|
14
|
+
it "keeps key as String" do
|
15
|
+
input = { "key" => "value" }
|
16
|
+
output = Fog::StringifyKeys.stringify(input)
|
17
|
+
assert(output.key?("key"))
|
18
|
+
end
|
19
|
+
end
|
20
|
+
|
21
|
+
describe "when Hash is empty" do
|
22
|
+
it "returns empty Hash" do
|
23
|
+
assert_equal({}, Fog::StringifyKeys.stringify({}))
|
24
|
+
end
|
25
|
+
end
|
26
|
+
|
27
|
+
describe "when keys are deeply nested" do
|
28
|
+
it "updates only top level key" do
|
29
|
+
input = { :key1 => { :key2 => { :key3 => nil }}}
|
30
|
+
|
31
|
+
output = Fog::StringifyKeys.stringify(input)
|
32
|
+
|
33
|
+
expected = { "key1" => { :key2 => { :key3 => nil }}}
|
34
|
+
assert_equal(expected, output)
|
35
|
+
end
|
36
|
+
end
|
37
|
+
end
|
38
|
+
end
|
@@ -0,0 +1,36 @@
|
|
1
|
+
require "spec_helper"
|
2
|
+
|
3
|
+
describe "Fog::WhitelistKeys" do
|
4
|
+
describe ".whitelist" do
|
5
|
+
describe "when other keys are present" do
|
6
|
+
it "returns Hash with only allowed keys" do
|
7
|
+
input = { :name => "name", :type => "type", :size => 80 }
|
8
|
+
valid_keys = %w(name size)
|
9
|
+
|
10
|
+
output = Fog::WhitelistKeys.whitelist(input, valid_keys)
|
11
|
+
|
12
|
+
expected = { "name" => "name", "size" => 80 }
|
13
|
+
assert_equal(expected, output)
|
14
|
+
end
|
15
|
+
end
|
16
|
+
|
17
|
+
describe "when key is a Symbol" do
|
18
|
+
it "returns a String" do
|
19
|
+
input = { :name => "name" }
|
20
|
+
valid_keys = %w(name)
|
21
|
+
|
22
|
+
output = Fog::WhitelistKeys.whitelist(input, valid_keys)
|
23
|
+
|
24
|
+
expected = { "name" => "name" }
|
25
|
+
assert(expected, output)
|
26
|
+
end
|
27
|
+
end
|
28
|
+
|
29
|
+
describe "when Hash is empty" do
|
30
|
+
it "returns empty Hash" do
|
31
|
+
output = Fog::WhitelistKeys.whitelist({}, [])
|
32
|
+
assert_equal({}, output)
|
33
|
+
end
|
34
|
+
end
|
35
|
+
end
|
36
|
+
end
|
data/spec/fog_attribute_spec.rb
CHANGED
@@ -105,6 +105,16 @@ describe "Fog::Attributes" do
|
|
105
105
|
assert_equal Time.parse(now.to_s), model.time
|
106
106
|
end
|
107
107
|
|
108
|
+
it "returns a Time object when passed a string that is monkeypatched" do
|
109
|
+
now = Time.now
|
110
|
+
string = now.to_s
|
111
|
+
def string.to_time
|
112
|
+
"<3 <3 <3"
|
113
|
+
end
|
114
|
+
model.merge_attributes(:time => string)
|
115
|
+
assert_equal Time.parse(string), model.time
|
116
|
+
end
|
117
|
+
|
108
118
|
it "returns a Time object when passed a XMLRPC::DateTime object" do
|
109
119
|
now = XMLRPC::DateTime.new(2000, 7, 8, 10, 20, 34)
|
110
120
|
model.merge_attributes(:time => now)
|
data/spec/formatador_spec.rb
CHANGED
@@ -1,72 +1,154 @@
|
|
1
1
|
require "spec_helper"
|
2
2
|
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
end
|
3
|
+
describe Fog::Formatador do
|
4
|
+
describe "when object is Fog::Collection instance" do
|
5
|
+
before do
|
6
|
+
@member_class = Class.new(Fog::Model) do
|
7
|
+
attribute :name
|
9
8
|
|
10
|
-
|
11
|
-
|
12
|
-
|
9
|
+
def self.name
|
10
|
+
"MemberGadget"
|
11
|
+
end
|
12
|
+
end
|
13
|
+
|
14
|
+
@collection_class = Class.new(Fog::Collection) do
|
15
|
+
model @member_class
|
16
|
+
|
17
|
+
attribute :attr_one
|
18
|
+
attribute :attr_two
|
13
19
|
|
14
|
-
|
15
|
-
|
20
|
+
def self.name
|
21
|
+
"InspectionGadget"
|
22
|
+
end
|
23
|
+
|
24
|
+
def all
|
25
|
+
self
|
26
|
+
end
|
27
|
+
end
|
28
|
+
|
29
|
+
@collection = @collection_class.new(:attr_one => "String", :attr_two => 5)
|
30
|
+
@collection << @member_class.new(:name => "Member name")
|
31
|
+
@expected = <<-EOS.gsub(/^ {6}/, "").chomp!
|
32
|
+
<InspectionGadget
|
33
|
+
attr_one=\"String\",
|
34
|
+
attr_two=5
|
35
|
+
[
|
36
|
+
<MemberGadget
|
37
|
+
name=\"Member name\"
|
38
|
+
>
|
39
|
+
]
|
40
|
+
>
|
41
|
+
EOS
|
42
|
+
end
|
43
|
+
|
44
|
+
it "returns formatted representation" do
|
45
|
+
Fog::Formatador.format(@collection).must_equal @expected
|
46
|
+
end
|
16
47
|
end
|
17
48
|
|
18
|
-
|
19
|
-
|
49
|
+
describe "when object is Fog::Collection without attributes" do
|
50
|
+
before do
|
51
|
+
@collection_class = Class.new(Fog::Collection) do
|
52
|
+
def all
|
53
|
+
self
|
54
|
+
end
|
55
|
+
end
|
56
|
+
|
57
|
+
@collection = @collection_class.new
|
58
|
+
@expected = <<-EOS.gsub(/^ {6}/, "").chomp!
|
59
|
+
<
|
60
|
+
[
|
61
|
+
|
62
|
+
]
|
63
|
+
>
|
64
|
+
EOS
|
65
|
+
end
|
66
|
+
|
67
|
+
it "returns formatted representation" do
|
68
|
+
Fog::Formatador.format(@collection).must_equal @expected
|
69
|
+
end
|
20
70
|
end
|
21
|
-
end
|
22
71
|
|
23
|
-
|
24
|
-
|
72
|
+
describe "when object has is Fog::Collection but ignoring nested objects" do
|
73
|
+
before do
|
74
|
+
@collection_class = Class.new(Fog::Collection) do
|
75
|
+
attribute :name
|
25
76
|
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
]
|
34
|
-
>
|
35
|
-
EOL
|
36
|
-
test_case_str1.chomp!
|
37
|
-
|
38
|
-
test_case_str2 = <<-EOL
|
39
|
-
<CollectionTestCase
|
40
|
-
this=["this", "that"],
|
41
|
-
that=["that", "this"]
|
42
|
-
>
|
43
|
-
EOL
|
44
|
-
test_case_str2.chomp!
|
45
|
-
|
46
|
-
test_case_str3 = <<-EOL
|
47
|
-
<NonCollectionTestCase
|
48
|
-
>
|
49
|
-
EOL
|
50
|
-
test_case_str3.chomp!
|
77
|
+
def all
|
78
|
+
self
|
79
|
+
end
|
80
|
+
end
|
81
|
+
@collection = @collection_class.new(:name => "Name")
|
82
|
+
@collection << "this"
|
83
|
+
end
|
51
84
|
|
52
|
-
|
85
|
+
it "returns formatted representation" do
|
86
|
+
@expected = <<-EOS.gsub(/^ {6}/, "").chomp!
|
87
|
+
<
|
88
|
+
name=\"Name\"
|
89
|
+
>
|
90
|
+
EOS
|
53
91
|
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
@non_collection_test = NonCollectionTestCase.new
|
92
|
+
opts = { :include_nested => false }
|
93
|
+
Fog::Formatador.format(@collection, opts).must_equal @expected
|
94
|
+
end
|
58
95
|
end
|
59
96
|
|
60
|
-
|
61
|
-
|
97
|
+
describe "when object is not enumerable" do
|
98
|
+
before do
|
99
|
+
@class = Class.new
|
100
|
+
@subject = @class.new
|
101
|
+
@expected = <<-EOS.gsub(/^ {6}/, "").chomp!
|
102
|
+
<
|
103
|
+
>
|
104
|
+
EOS
|
105
|
+
end
|
106
|
+
|
107
|
+
it "returns formatted representation" do
|
108
|
+
Fog::Formatador.format(@subject).must_equal @expected
|
109
|
+
end
|
62
110
|
end
|
63
111
|
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
112
|
+
describe "when object responds to non-enumerable '#map'" do
|
113
|
+
before do
|
114
|
+
@member = Class.new(Fog::Model) do
|
115
|
+
def self.name
|
116
|
+
"IPAddress"
|
117
|
+
end
|
118
|
+
|
119
|
+
# This map action is unrelated to Enumerable (See GH-138)
|
120
|
+
def map
|
121
|
+
raise "Do not call me when inspecting!"
|
122
|
+
end
|
123
|
+
end
|
124
|
+
|
125
|
+
@collection_class = Class.new(Fog::Collection) do
|
126
|
+
model @member
|
127
|
+
|
128
|
+
def self.name
|
129
|
+
"IPAddressCollection"
|
130
|
+
end
|
131
|
+
|
132
|
+
def all
|
133
|
+
self
|
134
|
+
end
|
135
|
+
end
|
136
|
+
|
137
|
+
@collection = @collection_class.new
|
138
|
+
@collection << @member.new
|
139
|
+
|
140
|
+
@expected = <<-EOS.gsub(/^ {6}/, "").chomp!
|
141
|
+
<IPAddressCollection
|
142
|
+
[
|
143
|
+
<IPAddress
|
144
|
+
>
|
145
|
+
]
|
146
|
+
>
|
147
|
+
EOS
|
148
|
+
end
|
68
149
|
|
69
|
-
|
70
|
-
|
150
|
+
it "returns formatted representation" do
|
151
|
+
Fog::Formatador.format(@collection).must_equal @expected
|
152
|
+
end
|
71
153
|
end
|
72
154
|
end
|
data/spec/spec_helper.rb
CHANGED
@@ -1,9 +1,3 @@
|
|
1
|
-
require "minitest/autorun"
|
2
|
-
require "minitest/spec"
|
3
|
-
require "minitest/stub_const"
|
4
|
-
|
5
|
-
$LOAD_PATH.unshift "lib"
|
6
|
-
|
7
1
|
if ENV["COVERAGE"]
|
8
2
|
require "coveralls"
|
9
3
|
require "simplecov"
|
@@ -13,6 +7,11 @@ if ENV["COVERAGE"]
|
|
13
7
|
end
|
14
8
|
end
|
15
9
|
|
10
|
+
require "minitest/autorun"
|
11
|
+
require "minitest/spec"
|
12
|
+
require "minitest/stub_const"
|
13
|
+
|
14
|
+
$LOAD_PATH.unshift "lib"
|
16
15
|
require "fog/core"
|
17
16
|
|
18
17
|
Dir["spec/fake_app/**/*.rb"].each do |file|
|
data/spec/wait_for_spec.rb
CHANGED
@@ -11,12 +11,20 @@ describe "Fog#wait_for" do
|
|
11
11
|
end
|
12
12
|
end
|
13
13
|
|
14
|
+
it "does not raise if successful when the wait timeout is exceeded" do
|
15
|
+
timeout = 2
|
16
|
+
i = 0
|
17
|
+
ret = Fog.wait_for(timeout) { i = i + 1; i > 2 }
|
18
|
+
assert_operator(ret[:duration], :>, timeout)
|
19
|
+
end
|
20
|
+
|
14
21
|
it "accepts a proc to determine the sleep interval" do
|
15
22
|
i = 0
|
16
23
|
ret = Fog.wait_for(1, lambda { |_t| 1 }) do
|
17
24
|
i += 1
|
18
25
|
i > 1
|
19
26
|
end
|
20
|
-
|
27
|
+
assert(1 <= ret[:duration])
|
28
|
+
assert(ret[:duration] < 2)
|
21
29
|
end
|
22
30
|
end
|
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.30.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Evan Light
|
@@ -9,202 +9,202 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2015-02
|
12
|
+
date: 2015-04-02 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: builder
|
16
16
|
requirement: !ruby/object:Gem::Requirement
|
17
17
|
requirements:
|
18
|
-
- -
|
18
|
+
- - '>='
|
19
19
|
- !ruby/object:Gem::Version
|
20
20
|
version: '0'
|
21
21
|
type: :runtime
|
22
22
|
prerelease: false
|
23
23
|
version_requirements: !ruby/object:Gem::Requirement
|
24
24
|
requirements:
|
25
|
-
- -
|
25
|
+
- - '>='
|
26
26
|
- !ruby/object:Gem::Version
|
27
27
|
version: '0'
|
28
28
|
- !ruby/object:Gem::Dependency
|
29
29
|
name: excon
|
30
30
|
requirement: !ruby/object:Gem::Requirement
|
31
31
|
requirements:
|
32
|
-
- -
|
32
|
+
- - ~>
|
33
33
|
- !ruby/object:Gem::Version
|
34
|
-
version: '0.
|
34
|
+
version: '0.45'
|
35
35
|
type: :runtime
|
36
36
|
prerelease: false
|
37
37
|
version_requirements: !ruby/object:Gem::Requirement
|
38
38
|
requirements:
|
39
|
-
- -
|
39
|
+
- - ~>
|
40
40
|
- !ruby/object:Gem::Version
|
41
|
-
version: '0.
|
41
|
+
version: '0.45'
|
42
42
|
- !ruby/object:Gem::Dependency
|
43
43
|
name: formatador
|
44
44
|
requirement: !ruby/object:Gem::Requirement
|
45
45
|
requirements:
|
46
|
-
- -
|
46
|
+
- - ~>
|
47
47
|
- !ruby/object:Gem::Version
|
48
48
|
version: '0.2'
|
49
49
|
type: :runtime
|
50
50
|
prerelease: false
|
51
51
|
version_requirements: !ruby/object:Gem::Requirement
|
52
52
|
requirements:
|
53
|
-
- -
|
53
|
+
- - ~>
|
54
54
|
- !ruby/object:Gem::Version
|
55
55
|
version: '0.2'
|
56
56
|
- !ruby/object:Gem::Dependency
|
57
57
|
name: mime-types
|
58
58
|
requirement: !ruby/object:Gem::Requirement
|
59
59
|
requirements:
|
60
|
-
- -
|
60
|
+
- - '>='
|
61
61
|
- !ruby/object:Gem::Version
|
62
62
|
version: '0'
|
63
63
|
type: :runtime
|
64
64
|
prerelease: false
|
65
65
|
version_requirements: !ruby/object:Gem::Requirement
|
66
66
|
requirements:
|
67
|
-
- -
|
67
|
+
- - '>='
|
68
68
|
- !ruby/object:Gem::Version
|
69
69
|
version: '0'
|
70
70
|
- !ruby/object:Gem::Dependency
|
71
71
|
name: net-scp
|
72
72
|
requirement: !ruby/object:Gem::Requirement
|
73
73
|
requirements:
|
74
|
-
- -
|
74
|
+
- - ~>
|
75
75
|
- !ruby/object:Gem::Version
|
76
76
|
version: '1.1'
|
77
77
|
type: :runtime
|
78
78
|
prerelease: false
|
79
79
|
version_requirements: !ruby/object:Gem::Requirement
|
80
80
|
requirements:
|
81
|
-
- -
|
81
|
+
- - ~>
|
82
82
|
- !ruby/object:Gem::Version
|
83
83
|
version: '1.1'
|
84
84
|
- !ruby/object:Gem::Dependency
|
85
85
|
name: net-ssh
|
86
86
|
requirement: !ruby/object:Gem::Requirement
|
87
87
|
requirements:
|
88
|
-
- -
|
88
|
+
- - '>='
|
89
89
|
- !ruby/object:Gem::Version
|
90
90
|
version: 2.1.3
|
91
91
|
type: :runtime
|
92
92
|
prerelease: false
|
93
93
|
version_requirements: !ruby/object:Gem::Requirement
|
94
94
|
requirements:
|
95
|
-
- -
|
95
|
+
- - '>='
|
96
96
|
- !ruby/object:Gem::Version
|
97
97
|
version: 2.1.3
|
98
98
|
- !ruby/object:Gem::Dependency
|
99
|
-
name:
|
99
|
+
name: coveralls
|
100
100
|
requirement: !ruby/object:Gem::Requirement
|
101
101
|
requirements:
|
102
|
-
- -
|
102
|
+
- - '>='
|
103
103
|
- !ruby/object:Gem::Version
|
104
104
|
version: '0'
|
105
105
|
type: :development
|
106
106
|
prerelease: false
|
107
107
|
version_requirements: !ruby/object:Gem::Requirement
|
108
108
|
requirements:
|
109
|
-
- -
|
109
|
+
- - '>='
|
110
110
|
- !ruby/object:Gem::Version
|
111
111
|
version: '0'
|
112
112
|
- !ruby/object:Gem::Dependency
|
113
|
-
name:
|
113
|
+
name: minitest
|
114
114
|
requirement: !ruby/object:Gem::Requirement
|
115
115
|
requirements:
|
116
|
-
- -
|
116
|
+
- - '>='
|
117
117
|
- !ruby/object:Gem::Version
|
118
118
|
version: '0'
|
119
119
|
type: :development
|
120
120
|
prerelease: false
|
121
121
|
version_requirements: !ruby/object:Gem::Requirement
|
122
122
|
requirements:
|
123
|
-
- -
|
123
|
+
- - '>='
|
124
124
|
- !ruby/object:Gem::Version
|
125
125
|
version: '0'
|
126
126
|
- !ruby/object:Gem::Dependency
|
127
|
-
name:
|
127
|
+
name: minitest-stub-const
|
128
128
|
requirement: !ruby/object:Gem::Requirement
|
129
129
|
requirements:
|
130
|
-
- -
|
130
|
+
- - '>='
|
131
131
|
- !ruby/object:Gem::Version
|
132
132
|
version: '0'
|
133
133
|
type: :development
|
134
134
|
prerelease: false
|
135
135
|
version_requirements: !ruby/object:Gem::Requirement
|
136
136
|
requirements:
|
137
|
-
- -
|
137
|
+
- - '>='
|
138
138
|
- !ruby/object:Gem::Version
|
139
139
|
version: '0'
|
140
140
|
- !ruby/object:Gem::Dependency
|
141
|
-
name:
|
141
|
+
name: pry
|
142
142
|
requirement: !ruby/object:Gem::Requirement
|
143
143
|
requirements:
|
144
|
-
- -
|
144
|
+
- - '>='
|
145
145
|
- !ruby/object:Gem::Version
|
146
146
|
version: '0'
|
147
147
|
type: :development
|
148
148
|
prerelease: false
|
149
149
|
version_requirements: !ruby/object:Gem::Requirement
|
150
150
|
requirements:
|
151
|
-
- -
|
151
|
+
- - '>='
|
152
152
|
- !ruby/object:Gem::Version
|
153
153
|
version: '0'
|
154
154
|
- !ruby/object:Gem::Dependency
|
155
|
-
name:
|
155
|
+
name: rake
|
156
156
|
requirement: !ruby/object:Gem::Requirement
|
157
157
|
requirements:
|
158
|
-
- -
|
158
|
+
- - '>='
|
159
159
|
- !ruby/object:Gem::Version
|
160
160
|
version: '0'
|
161
161
|
type: :development
|
162
162
|
prerelease: false
|
163
163
|
version_requirements: !ruby/object:Gem::Requirement
|
164
164
|
requirements:
|
165
|
-
- -
|
165
|
+
- - '>='
|
166
166
|
- !ruby/object:Gem::Version
|
167
167
|
version: '0'
|
168
168
|
- !ruby/object:Gem::Dependency
|
169
|
-
name:
|
169
|
+
name: rubocop
|
170
170
|
requirement: !ruby/object:Gem::Requirement
|
171
171
|
requirements:
|
172
|
-
- -
|
172
|
+
- - '>='
|
173
173
|
- !ruby/object:Gem::Version
|
174
174
|
version: '0'
|
175
175
|
type: :development
|
176
176
|
prerelease: false
|
177
177
|
version_requirements: !ruby/object:Gem::Requirement
|
178
178
|
requirements:
|
179
|
-
- -
|
179
|
+
- - '>='
|
180
180
|
- !ruby/object:Gem::Version
|
181
181
|
version: '0'
|
182
182
|
- !ruby/object:Gem::Dependency
|
183
|
-
name:
|
183
|
+
name: thor
|
184
184
|
requirement: !ruby/object:Gem::Requirement
|
185
185
|
requirements:
|
186
|
-
- -
|
186
|
+
- - '>='
|
187
187
|
- !ruby/object:Gem::Version
|
188
188
|
version: '0'
|
189
189
|
type: :development
|
190
190
|
prerelease: false
|
191
191
|
version_requirements: !ruby/object:Gem::Requirement
|
192
192
|
requirements:
|
193
|
-
- -
|
193
|
+
- - '>='
|
194
194
|
- !ruby/object:Gem::Version
|
195
195
|
version: '0'
|
196
196
|
- !ruby/object:Gem::Dependency
|
197
|
-
name:
|
197
|
+
name: yard
|
198
198
|
requirement: !ruby/object:Gem::Requirement
|
199
199
|
requirements:
|
200
|
-
- -
|
200
|
+
- - '>='
|
201
201
|
- !ruby/object:Gem::Version
|
202
202
|
version: '0'
|
203
203
|
type: :development
|
204
204
|
prerelease: false
|
205
205
|
version_requirements: !ruby/object:Gem::Requirement
|
206
206
|
requirements:
|
207
|
-
- -
|
207
|
+
- - '>='
|
208
208
|
- !ruby/object:Gem::Version
|
209
209
|
version: '0'
|
210
210
|
description: Shared classes and tests for fog providers and services.
|
@@ -215,9 +215,9 @@ executables: []
|
|
215
215
|
extensions: []
|
216
216
|
extra_rdoc_files: []
|
217
217
|
files:
|
218
|
-
-
|
219
|
-
-
|
220
|
-
-
|
218
|
+
- .gitignore
|
219
|
+
- .rubocop.yml
|
220
|
+
- .travis.yml
|
221
221
|
- CONTRIBUTING.md
|
222
222
|
- CONTRIBUTORS.md
|
223
223
|
- Gemfile
|
@@ -299,6 +299,8 @@ files:
|
|
299
299
|
- lib/tasks/test_task.rb
|
300
300
|
- spec/compute_spec.rb
|
301
301
|
- spec/connection_spec.rb
|
302
|
+
- spec/core/stringify_keys_spec.rb
|
303
|
+
- spec/core/whitelist_keys_spec.rb
|
302
304
|
- spec/credentials_spec.rb
|
303
305
|
- spec/current_machine_spec.rb
|
304
306
|
- spec/fake_app/fake_service.rb
|
@@ -318,8 +320,6 @@ files:
|
|
318
320
|
- spec/utils_spec.rb
|
319
321
|
- spec/uuid_spec.rb
|
320
322
|
- spec/wait_for_spec.rb
|
321
|
-
- tests/core/stringify_keys_tests.rb
|
322
|
-
- tests/core/whitelist_keys_tests.rb
|
323
323
|
homepage: https://github.com/fog/fog-core
|
324
324
|
licenses:
|
325
325
|
- MIT
|
@@ -330,23 +330,25 @@ require_paths:
|
|
330
330
|
- lib
|
331
331
|
required_ruby_version: !ruby/object:Gem::Requirement
|
332
332
|
requirements:
|
333
|
-
- -
|
333
|
+
- - '>='
|
334
334
|
- !ruby/object:Gem::Version
|
335
335
|
version: '0'
|
336
336
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
337
337
|
requirements:
|
338
|
-
- -
|
338
|
+
- - '>='
|
339
339
|
- !ruby/object:Gem::Version
|
340
340
|
version: '0'
|
341
341
|
requirements: []
|
342
342
|
rubyforge_project:
|
343
|
-
rubygems_version: 2.
|
343
|
+
rubygems_version: 2.0.3
|
344
344
|
signing_key:
|
345
345
|
specification_version: 4
|
346
346
|
summary: Shared classes and tests for fog providers and services.
|
347
347
|
test_files:
|
348
348
|
- spec/compute_spec.rb
|
349
349
|
- spec/connection_spec.rb
|
350
|
+
- spec/core/stringify_keys_spec.rb
|
351
|
+
- spec/core/whitelist_keys_spec.rb
|
350
352
|
- spec/credentials_spec.rb
|
351
353
|
- spec/current_machine_spec.rb
|
352
354
|
- spec/fake_app/fake_service.rb
|
@@ -1,29 +0,0 @@
|
|
1
|
-
input_hash = {
|
2
|
-
:name => 'test-server',
|
3
|
-
:flavor => '123'
|
4
|
-
}
|
5
|
-
|
6
|
-
output_hash = {
|
7
|
-
'name' => 'test-server',
|
8
|
-
'flavor' => '123'
|
9
|
-
}
|
10
|
-
|
11
|
-
Shindo.tests('Fog::StringifyKeys', 'core') do
|
12
|
-
|
13
|
-
tests('keys') do
|
14
|
-
|
15
|
-
tests('stringifies symbols') do
|
16
|
-
returns(output_hash) {
|
17
|
-
Fog::StringifyKeys.stringify(input_hash)
|
18
|
-
}
|
19
|
-
end
|
20
|
-
|
21
|
-
tests('skips strings') do
|
22
|
-
returns(output_hash) {
|
23
|
-
Fog::StringifyKeys.stringify(output_hash)
|
24
|
-
}
|
25
|
-
end
|
26
|
-
|
27
|
-
end
|
28
|
-
|
29
|
-
end
|
@@ -1,24 +0,0 @@
|
|
1
|
-
input_hash = {
|
2
|
-
:name => 'test-server',
|
3
|
-
:flavor => '123',
|
4
|
-
:size => '12345'
|
5
|
-
}
|
6
|
-
|
7
|
-
output_hash = {
|
8
|
-
'name' => 'test-server',
|
9
|
-
'flavor' => '123'
|
10
|
-
}
|
11
|
-
|
12
|
-
valid_keys = %w{flavor name}
|
13
|
-
|
14
|
-
Shindo.tests('Fog::WhitelistKeys', 'core') do
|
15
|
-
|
16
|
-
tests('whitelist_keys') do
|
17
|
-
tests('excludes invalid values') do
|
18
|
-
returns(output_hash) {
|
19
|
-
Fog::WhitelistKeys.whitelist(input_hash, valid_keys)
|
20
|
-
}
|
21
|
-
end
|
22
|
-
end
|
23
|
-
|
24
|
-
end
|