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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 92d66fd0343833e7c90dcb8fce05e3104ce86996
4
- data.tar.gz: 713e785d1cb64e82f913387ff68137f9e26ba569
3
+ metadata.gz: bb77e8ccc89ecb7205337d9c92666d4f8bc6d178
4
+ data.tar.gz: d4f44471fbd8b9cd657434892d7eed7ddec97ac7
5
5
  SHA512:
6
- metadata.gz: 678c115c28500fb036b3cef826cfad6667136dbd165526e8e6ce85511deffd6ef23d5a312439d341f02b8fa281c013bc7a2d724da88f9ec8916c4ee9fa9d0538
7
- data.tar.gz: ba7626703891e1a952570dd9dfce2ebe1123d0028ed5ecbae060f8266e630ae503d20323dc80d46eb30cdf32bf1af19080dfb34586e2541f1a28add73e65999c
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/<my-github-username>/fog-core/fork )
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`)
@@ -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
 
@@ -1,36 +1,36 @@
1
1
  # coding: utf-8
2
- lib = File.expand_path('../lib', __FILE__)
2
+ lib = File.expand_path("../lib", __FILE__)
3
3
  $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
- require 'fog/core/version'
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 = %q{Shared classes and tests for fog providers and services.}
12
- spec.description = %q{Shared classes and tests for fog providers and services.}
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('builder')
22
- spec.add_dependency('excon', '~>0.38')
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')
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('rake')
29
- spec.add_development_dependency('yard')
30
- spec.add_development_dependency('thor')
31
- spec.add_development_dependency('minitest')
32
- spec.add_development_dependency('minitest-stub-const')
33
- spec.add_development_dependency('pry')
34
- spec.add_development_dependency('coveralls')
35
- spec.add_development_dependency('rubocop') if RUBY_VERSION.to_s >= '1.9.3'
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
@@ -163,7 +163,7 @@ module Fog
163
163
  value_string = value.to_s.downcase
164
164
  if value.nil?
165
165
  options.delete(key)
166
- elsif value == value_string.to_i.to_s
166
+ elsif value_string.to_i.to_s == value
167
167
  options[key] = value.to_i
168
168
  else
169
169
  options[key] = case value_string
@@ -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, options = {}, &block)
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
@@ -6,7 +6,7 @@ module Fog
6
6
  MONTHS = %w(Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec)
7
7
 
8
8
  def self.now
9
- at((::Time.now - offset).to_i)
9
+ at(::Time.now - offset)
10
10
  end
11
11
 
12
12
  def self.now=(new_now)
@@ -1,5 +1,5 @@
1
1
  module Fog
2
2
  module Core
3
- VERSION = "1.29.0"
3
+ VERSION = "1.30.0"
4
4
  end
5
5
  end
@@ -3,14 +3,14 @@ module Fog
3
3
  duration = 0
4
4
  start = Time.now
5
5
  retries = 0
6
- until yield || duration > timeout
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
- if duration > timeout
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
@@ -2,7 +2,7 @@ module Fog
2
2
  module WhitelistKeys
3
3
  def self.whitelist(hash, valid_keys)
4
4
  valid_hash = StringifyKeys.stringify(hash)
5
- valid_hash.select { |k, _v| valid_keys.include?(k) }
5
+ Hash[valid_hash.select { |k, _v| valid_keys.include?(k) }]
6
6
  end
7
7
  end
8
8
  end
@@ -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.respond_to?(:map)
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.respond_to?(:map)
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
@@ -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)
@@ -1,72 +1,154 @@
1
1
  require "spec_helper"
2
2
 
3
- class CollectionTestCase < Fog::Collection
4
- def all
5
- end
6
- def map(*_args)
7
- %w(foo bar)
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
- def self.attributes
11
- %w(this that)
12
- end
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
- def this
15
- %w(this that)
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
- def that
19
- %w(that this)
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
- class NonCollectionTestCase
24
- end
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
- test_case_str1 = <<-EOL
27
- <CollectionTestCase
28
- this=["this", "that"],
29
- that=["that", "this"]
30
- [
31
- foo,
32
- bar
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
- describe Fog::Formatador do
85
+ it "returns formatted representation" do
86
+ @expected = <<-EOS.gsub(/^ {6}/, "").chomp!
87
+ <
88
+ name=\"Name\"
89
+ >
90
+ EOS
53
91
 
54
- def setup
55
- @collection_test = CollectionTestCase.new
56
- @collection_test << 'this'
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
- it "should give a string representation of object with proper indentation" do
61
- Fog::Formatador.format(@collection_test).must_equal test_case_str1
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
- it 'should not include nested objects' do
65
- opts = { :include_nested => false }
66
- Fog::Formatador.format(@collection_test, opts).must_equal test_case_str2
67
- end
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
- it 'should not raise if object does not response to :empty? or :map' do
70
- Fog::Formatador.format(@non_collection_test).must_equal test_case_str3
150
+ it "returns formatted representation" do
151
+ Fog::Formatador.format(@collection).must_equal @expected
152
+ end
71
153
  end
72
154
  end
@@ -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|
@@ -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
- assert_equal({ :duration => 1 }, ret)
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.29.0
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-19 00:00:00.000000000 Z
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.38'
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.38'
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: rake
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: yard
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: thor
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: minitest
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: minitest-stub-const
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: pry
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: coveralls
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: rubocop
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
- - ".gitignore"
219
- - ".rubocop.yml"
220
- - ".travis.yml"
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.2.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