fog-core 2.2.2 → 2.3.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
  SHA256:
3
- metadata.gz: 0e12788f1604380c50ec19c246cacdd74d769a04d71ee56660bc3c5bc62238ae
4
- data.tar.gz: d0bfdca7690d42db8771d84dd1fdb8b7d013b2d719071ee4165be900f14ae788
3
+ metadata.gz: 1ed45403ed1ae262f4cb11edb925bf9b46e54129c33c1aae9e75ea040aca788a
4
+ data.tar.gz: 8ff9db0cad760c871089ff3c2176b9e6f630daf6d57870a99782b78141cfe350
5
5
  SHA512:
6
- metadata.gz: 9f1e44a5714c271433bc108ba068006b98ab2acbb88319db688a63ef0ed0cb1d567fcb6c254fb96a6df527a4ff3e0e7f0f1d8e258f2eb6a8d43b05552e905c7f
7
- data.tar.gz: afcb84b9410a1361aa87a019bdf6934a428780d50713edd5da98c32104d4d3a3c813aef048f2368888b74da2718f6fea6a0c0cdade6ced7b29837ebc515db2a3
6
+ metadata.gz: 6b6a2fde1441edb56b5ebd703f8d3c4044a2eea7ee77a7f597d121ab33bc7af5e9d97d89ec1dcf0e713a80b3fd2ae377084eda4685edc59b02cf17c6c160d487
7
+ data.tar.gz: f743f73356f7bc34c63790061a5d255193a72946fafeec5250c0987786d2cff1815eae1ca016fe0c9b41952aea2ffe05c515a98bef3e1e9a4a9b1b434b3b5056
@@ -0,0 +1,10 @@
1
+ version: 2
2
+ updates:
3
+ - package-ecosystem: "bundler"
4
+ directory: "/"
5
+ schedule:
6
+ interval: "daily"
7
+ - package-ecosystem: "github-actions"
8
+ directory: "/"
9
+ schedule:
10
+ interval: "daily"
@@ -0,0 +1,18 @@
1
+ # This workflow uses actions that are not certified by GitHub.
2
+ # They are provided by a third-party and are governed by
3
+ # separate terms of service, privacy policy, and support
4
+ # documentation.
5
+ # This workflow will download a prebuilt Ruby version, install dependencies and run tests with Rake
6
+ # For more information see: https://github.com/marketplace/actions/setup-ruby-jruby-and-truffleruby
7
+
8
+ name: Ruby
9
+
10
+ on:
11
+ push:
12
+ branches: [ master ]
13
+ pull_request:
14
+ branches: [ master ]
15
+
16
+ jobs:
17
+ test:
18
+ uses: fog/.github/.github/workflows/ruby.yml@v1.1.0
@@ -0,0 +1,9 @@
1
+ name: Mark stale issues and pull requests
2
+
3
+ on:
4
+ schedule:
5
+ - cron: "30 1 * * *"
6
+
7
+ jobs:
8
+ stale:
9
+ uses: fog/.github/.github/workflows/stale.yml@v1.1.0
data/README.md CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  Shared classes and tests for fog providers and services.
4
4
 
5
- [![Build Status](https://travis-ci.org/fog/fog-core.svg?branch=master)](https://travis-ci.org/fog/fog-core)
5
+ [![Build Status](https://github.com/fog/fog-core/actions/workflows/ruby.yml/badge.svg)](https://github.com/fog/fog-core/actions/workflows/ruby.yml)
6
6
 
7
7
  ## Ruby version
8
8
 
data/changelog.md CHANGED
@@ -1,3 +1,31 @@
1
+ 2.3.0 03/08/2022
2
+ ==========================================================
3
+
4
+ - fix v2.2.4 changelog
5
+ - bump actions/stale
6
+ - bump actions/checkout
7
+ - avoid loading unnecessary service via autoload
8
+ - update ruby.yml
9
+ - continue tests dispite head errors
10
+ - bump actions/checkout
11
+ - bump formatador requirement
12
+ - utilize reusable actions workflows
13
+ - bump reusable actions
14
+ - fix cache test for ruby 3.1+
15
+ - tweak format of reusable workflows
16
+
17
+ 2.2.4 04/28/2020
18
+ ==========================================================
19
+
20
+ - Add FOG_DEBUG in addition to DEBUG to allow avoiding namespace collisions
21
+ - Add github actions configuration
22
+ - Update succeeds helper to expected syntax for ruby 3+
23
+
24
+ 2.2.3 09/16/2020
25
+ ==========================================================
26
+
27
+ Fix provider lookup to properly symbolize newly underscored names
28
+
1
29
  2.2.2 09/15/2020
2
30
  ==========================================================
3
31
 
data/fog-core.gemspec CHANGED
@@ -23,7 +23,7 @@ Gem::Specification.new do |spec|
23
23
  spec.add_dependency("builder")
24
24
  spec.add_dependency("mime-types")
25
25
  spec.add_dependency("excon", "~> 0.71")
26
- spec.add_dependency("formatador", "~> 0.2")
26
+ spec.add_dependency("formatador", ">= 0.2", "< 2.0")
27
27
 
28
28
  # https://github.com/fog/fog-core/issues/206
29
29
  # spec.add_dependency("xmlrpc") if RUBY_VERSION.to_s >= "2.4"
@@ -7,6 +7,9 @@ module Fog
7
7
 
8
8
  @channels[:debug] = ::STDERR if ENV["DEBUG"]
9
9
 
10
+ # provide an env var with narrower scope in case of namespace conflicts
11
+ @channels[:debug] = ::STDERR if ENV["FOG_DEBUG"]
12
+
10
13
  def self.[](channel)
11
14
  @channels[channel]
12
15
  end
@@ -12,7 +12,7 @@ module Fog
12
12
  def extended(base)
13
13
  provider = base.to_s.split("::").last
14
14
  Fog.providers[provider.downcase.to_sym] = provider
15
- Fog.providers[underscore_name(provider)] = provider
15
+ Fog.providers[underscore_name(provider).to_sym] = provider
16
16
  end
17
17
 
18
18
  private
@@ -45,19 +45,20 @@ module Fog
45
45
  # "provider::service" is defined (the preferred format) then it returns that
46
46
  # string, otherwise it returns the deprecated string "service::provider".
47
47
  def service_klass(constant_string)
48
- eval([to_s, constant_string].join("::"))
49
- [to_s, constant_string].join("::")
50
- rescue NameError
51
- provider = to_s.split("::").last
52
- Fog::Logger.deprecation("Unable to load #{[to_s, constant_string].join("::")}")
53
- Fog::Logger.deprecation(
54
- format(
55
- Fog::ServicesMixin::E_SERVICE_PROVIDER_CONSTANT,
56
- service: constant_string,
57
- provider: provider
48
+ if const_defined?([to_s, constant_string].join("::"))
49
+ [to_s, constant_string].join("::")
50
+ else
51
+ provider = to_s.split("::").last
52
+ Fog::Logger.deprecation("Unable to load #{[to_s, constant_string].join("::")}")
53
+ Fog::Logger.deprecation(
54
+ format(
55
+ Fog::ServicesMixin::E_SERVICE_PROVIDER_CONSTANT,
56
+ service: constant_string,
57
+ provider: provider
58
+ )
58
59
  )
59
- )
60
- ['Fog', constant_string, provider].join("::")
60
+ ['Fog', constant_string, provider].join("::")
61
+ end
61
62
  end
62
63
  end
63
64
  end
@@ -18,19 +18,20 @@ module Fog
18
18
  end
19
19
 
20
20
  def new(attributes)
21
- attributes = attributes.dup # Prevent delete from having side effects
22
- provider = check_provider_alias(attributes.delete(:provider).to_s.downcase.to_sym)
23
- provider_name = Fog.providers[provider]
21
+ attributes = attributes.dup # Prevent delete from having side effects
22
+ provider = attributes.delete(:provider).to_s.downcase.to_sym
23
+ provider_alias = check_provider_alias(provider)
24
+ provider_name = Fog.providers[provider_alias]
24
25
 
25
- raise ArgumentError, "#{provider} is not a recognized provider" unless providers.include?(provider)
26
+ raise ArgumentError, "#{provider_alias} is not a recognized provider" unless providers.include?(provider) || providers.include?(provider_alias)
26
27
 
27
- require_service_provider_library(service_name.downcase, provider)
28
+ require_service_provider_library(service_name.downcase, provider_alias)
28
29
  spc = service_provider_constant(service_name, provider_name)
29
30
  spc.new(attributes)
30
31
  rescue LoadError, NameError => e # Only rescue errors in finding the libraries, allow connection errors through to the caller
31
- Fog::Logger.warning("Error while loading provider #{provider}: #{e.message}")
32
+ Fog::Logger.warning("Error while loading provider #{provider_alias}: #{e.message}")
32
33
  Fog::Logger.debug("backtrace: #{e.backtrace.join("\n")}")
33
- raise Fog::Service::NotFound, "#{provider} has no #{service_name.downcase} service"
34
+ raise Fog::Service::NotFound, "#{provider_alias} has no #{service_name.downcase} service"
34
35
  end
35
36
 
36
37
  def providers
@@ -1,5 +1,5 @@
1
1
  module Fog
2
2
  module Core
3
- VERSION = "2.2.2"
3
+ VERSION = "2.3.0"
4
4
  end
5
5
  end
@@ -1,8 +1,8 @@
1
1
  module Shindo
2
2
  class Tests
3
- def succeeds
3
+ def succeeds(&block)
4
4
  test("succeeds") do
5
- !!instance_eval(&Proc.new)
5
+ !!instance_eval(&block)
6
6
  end
7
7
  end
8
8
  end
data/spec/compute_spec.rb CHANGED
@@ -10,16 +10,16 @@ describe "Fog::Compute" do
10
10
  describe "#new" do
11
11
  module Fog
12
12
  module TheRightWay
13
- extend Provider
14
- service(:compute, "Compute")
13
+ class Compute
14
+ def initialize(_args); end
15
+ end
15
16
  end
16
17
  end
17
18
 
18
19
  module Fog
19
20
  module TheRightWay
20
- class Compute
21
- def initialize(_args); end
22
- end
21
+ extend Provider
22
+ service(:compute, "Compute")
23
23
  end
24
24
  end
25
25
 
@@ -28,13 +28,6 @@ describe "Fog::Compute" do
28
28
  assert_instance_of(Fog::TheRightWay::Compute, compute)
29
29
  end
30
30
 
31
- module Fog
32
- module TheWrongWay
33
- extend Provider
34
- service(:compute, "Compute")
35
- end
36
- end
37
-
38
31
  module Fog
39
32
  module Compute
40
33
  class TheWrongWay
@@ -43,18 +36,18 @@ describe "Fog::Compute" do
43
36
  end
44
37
  end
45
38
 
46
- it "instantiates an instance of Fog::<Provider>::Compute from the :provider keyword arg" do
47
- compute = Fog::Compute.new(:provider => :thewrongway)
48
- assert_instance_of(Fog::Compute::TheWrongWay, compute)
49
- end
50
-
51
39
  module Fog
52
- module BothWays
40
+ module TheWrongWay
53
41
  extend Provider
54
42
  service(:compute, "Compute")
55
43
  end
56
44
  end
57
45
 
46
+ it "instantiates an instance of Fog::<Provider>::Compute from the :provider keyword arg" do
47
+ compute = Fog::Compute.new(:provider => :thewrongway)
48
+ assert_instance_of(Fog::Compute::TheWrongWay, compute)
49
+ end
50
+
58
51
  module Fog
59
52
  module BothWays
60
53
  class Compute
@@ -74,6 +67,13 @@ describe "Fog::Compute" do
74
67
  end
75
68
  end
76
69
 
70
+ module Fog
71
+ module BothWays
72
+ extend Provider
73
+ service(:compute, "Compute")
74
+ end
75
+ end
76
+
77
77
  describe "when both Fog::Compute::<Provider> and Fog::<Provider>::Compute exist" do
78
78
  it "prefers Fog::<Provider>::Compute" do
79
79
  compute = Fog::Compute.new(:provider => :bothways)
@@ -87,7 +87,7 @@ describe Fog::Cache do
87
87
  f.write(data)
88
88
  }
89
89
 
90
- assert_equal false, Fog::Cache.load_cache(path)
90
+ assert !Fog::Cache.load_cache(path)
91
91
  end
92
92
 
93
93
  it "must have a namespace_prefix configurable" do
@@ -10,16 +10,16 @@ describe "Fog::Identity" do
10
10
  describe "#new" do
11
11
  module Fog
12
12
  module TheRightWay
13
- extend Provider
14
- service(:identity, "Identity")
13
+ class Identity
14
+ def initialize(_args); end
15
+ end
15
16
  end
16
17
  end
17
18
 
18
19
  module Fog
19
20
  module TheRightWay
20
- class Identity
21
- def initialize(_args); end
22
- end
21
+ extend Provider
22
+ service(:identity, "Identity")
23
23
  end
24
24
  end
25
25
 
@@ -28,13 +28,6 @@ describe "Fog::Identity" do
28
28
  assert_instance_of(Fog::TheRightWay::Identity, identity)
29
29
  end
30
30
 
31
- module Fog
32
- module TheWrongWay
33
- extend Provider
34
- service(:identity, "Identity")
35
- end
36
- end
37
-
38
31
  module Fog
39
32
  module Identity
40
33
  class TheWrongWay
@@ -43,18 +36,18 @@ describe "Fog::Identity" do
43
36
  end
44
37
  end
45
38
 
46
- it "instantiates an instance of Fog::<Provider>::Identity from the :provider keyword arg" do
47
- identity = Fog::Identity.new(:provider => :thewrongway)
48
- assert_instance_of(Fog::Identity::TheWrongWay, identity)
49
- end
50
-
51
39
  module Fog
52
- module BothWays
40
+ module TheWrongWay
53
41
  extend Provider
54
42
  service(:identity, "Identity")
55
43
  end
56
44
  end
57
45
 
46
+ it "instantiates an instance of Fog::<Provider>::Identity from the :provider keyword arg" do
47
+ identity = Fog::Identity.new(:provider => :thewrongway)
48
+ assert_instance_of(Fog::Identity::TheWrongWay, identity)
49
+ end
50
+
58
51
  module Fog
59
52
  module BothWays
60
53
  class Identity
@@ -74,6 +67,13 @@ describe "Fog::Identity" do
74
67
  end
75
68
  end
76
69
 
70
+ module Fog
71
+ module BothWays
72
+ extend Provider
73
+ service(:identity, "Identity")
74
+ end
75
+ end
76
+
77
77
  describe "when both Fog::Identity::<Provider> and Fog::<Provider>::Identity exist" do
78
78
  it "prefers Fog::Identity::<Provider>" do
79
79
  identity = Fog::Identity.new(:provider => :bothways)
data/spec/storage_spec.rb CHANGED
@@ -10,16 +10,16 @@ describe "Fog::Storage" do
10
10
  describe "#new" do
11
11
  module Fog
12
12
  module TheRightWay
13
- extend Provider
14
- service(:storage, "Storage")
13
+ class Storage
14
+ def initialize(_args); end
15
+ end
15
16
  end
16
17
  end
17
18
 
18
19
  module Fog
19
20
  module TheRightWay
20
- class Storage
21
- def initialize(_args); end
22
- end
21
+ extend Provider
22
+ service(:storage, "Storage")
23
23
  end
24
24
  end
25
25
 
@@ -29,16 +29,16 @@ describe "Fog::Storage" do
29
29
  end
30
30
 
31
31
  module Fog
32
- module TheWrongWay
33
- extend Provider
34
- service(:storage, "Storage")
35
- end
36
-
37
32
  module Storage
38
33
  class TheWrongWay
39
34
  def initialize(_args); end
40
35
  end
41
36
  end
37
+
38
+ module TheWrongWay
39
+ extend Provider
40
+ service(:storage, "Storage")
41
+ end
42
42
  end
43
43
 
44
44
  it "instantiates an instance of Fog::Storage::<Provider> from the :provider keyword arg" do
@@ -46,13 +46,6 @@ describe "Fog::Storage" do
46
46
  assert_instance_of(Fog::Storage::TheWrongWay, compute)
47
47
  end
48
48
 
49
- module Fog
50
- module BothWays
51
- extend Provider
52
- service(:storage, "Storage")
53
- end
54
- end
55
-
56
49
  module Fog
57
50
  module BothWays
58
51
  class Storage
@@ -73,6 +66,13 @@ describe "Fog::Storage" do
73
66
  end
74
67
  end
75
68
 
69
+ module Fog
70
+ module BothWays
71
+ extend Provider
72
+ service(:storage, "Storage")
73
+ end
74
+ end
75
+
76
76
  describe "when both Fog::Storage::<Provider> and Fog::<Provider>::Storage exist" do
77
77
  it "prefers Fog::Storage::<Provider>" do
78
78
  compute = Fog::Storage.new(:provider => :bothways)
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: 2.2.2
4
+ version: 2.3.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: 2020-09-15 00:00:00.000000000 Z
12
+ date: 2022-03-08 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: builder
@@ -57,16 +57,22 @@ dependencies:
57
57
  name: formatador
58
58
  requirement: !ruby/object:Gem::Requirement
59
59
  requirements:
60
- - - "~>"
60
+ - - ">="
61
61
  - !ruby/object:Gem::Version
62
62
  version: '0.2'
63
+ - - "<"
64
+ - !ruby/object:Gem::Version
65
+ version: '2.0'
63
66
  type: :runtime
64
67
  prerelease: false
65
68
  version_requirements: !ruby/object:Gem::Requirement
66
69
  requirements:
67
- - - "~>"
70
+ - - ">="
68
71
  - !ruby/object:Gem::Version
69
72
  version: '0.2'
73
+ - - "<"
74
+ - !ruby/object:Gem::Version
75
+ version: '2.0'
70
76
  - !ruby/object:Gem::Dependency
71
77
  name: tins
72
78
  requirement: !ruby/object:Gem::Requirement
@@ -201,10 +207,11 @@ executables: []
201
207
  extensions: []
202
208
  extra_rdoc_files: []
203
209
  files:
204
- - ".github/stale.yml"
210
+ - ".github/dependabot.yml"
211
+ - ".github/workflows/ruby.yml"
212
+ - ".github/workflows/stale.yml"
205
213
  - ".gitignore"
206
214
  - ".rubocop.yml"
207
- - ".travis.yml"
208
215
  - CONTRIBUTING.md
209
216
  - CONTRIBUTORS.md
210
217
  - Gemfile
@@ -335,7 +342,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
335
342
  - !ruby/object:Gem::Version
336
343
  version: '0'
337
344
  requirements: []
338
- rubygems_version: 3.1.2
345
+ rubygems_version: 3.3.5
339
346
  signing_key:
340
347
  specification_version: 4
341
348
  summary: Shared classes and tests for fog providers and services.
data/.github/stale.yml DELETED
@@ -1,17 +0,0 @@
1
- # Number of days of inactivity before an issue becomes stale
2
- daysUntilStale: 60
3
- # Number of days of inactivity before a stale issue is closed
4
- daysUntilClose: 7
5
- # Issues with these labels will never be considered stale
6
- exemptLabels:
7
- - pinned
8
- - security
9
- # Label to use when marking an issue as stale
10
- staleLabel: wontfix
11
- # Comment to post when marking an issue as stale. Set to `false` to disable
12
- markComment: >
13
- This issue has been automatically marked stale due to inactivity.
14
- It will be closed if no further activity occurs.
15
- Thank you for your contributions.
16
- # Comment to post when closing a stale issue. Set to `false` to disable
17
- closeComment: false
data/.travis.yml DELETED
@@ -1,39 +0,0 @@
1
- language: ruby
2
-
3
- rvm:
4
- - 2.0
5
- - 2.1
6
- - 2.2
7
- - 2.3
8
- - 2.4
9
- - jruby-head
10
-
11
- sudo: false
12
- dist: trusty
13
-
14
- script: bundle exec rake travis
15
-
16
- matrix:
17
- fast_finish: true
18
- include:
19
- - rvm: 2.1
20
- gemfile: Gemfile
21
- env: COVERAGE=true
22
- - rvm: jruby-head
23
- gemfile: Gemfile
24
- allow_failures:
25
- - rvm: jruby-head
26
- - rvm: jruby9k
27
-
28
- notifications:
29
- email: false
30
- irc:
31
- channels:
32
- - "irc.freenode.org#ruby-fog"
33
- template:
34
- - "[#%{build_number}] %{message} %{build_url}"
35
- - "[#%{build_number}] %{commit} on %{branch} by %{author}"
36
- - "[#%{build_number}] %{compare_url}"
37
- on_success: always
38
- on_failure: always
39
- use_notice: false