fog-core 2.1.2 → 2.2.4

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: 37a78082a2b5880cfb9cd072a6a4cb2b3fbd93241e3ccdfc7b7af4441ef297a9
4
- data.tar.gz: 1623121246d01f7e9f4b046dfff2c7ed9d3704a21fdd9a2c6beba97f042a7c29
3
+ metadata.gz: 67cb461f9cadd8561112c31a7f506c4ff8b31a0ec3311e7e54ba824ac5e035d4
4
+ data.tar.gz: 9260f5a75cccc538be855890049577bf277a071b5df1135bdf1b5e881fc03c97
5
5
  SHA512:
6
- metadata.gz: b33e459698577f22440d749e8c14390c08caedea72b48ef222dc2941cb549ec4a916e5b198ac77b4b8a85c38852bf37c8152f4d3f42c677334a8334758a0a7bd
7
- data.tar.gz: 392d7f5b448dca96a1793d8624f01165c998ccb10ab37a1779a2caff91284dabc6ac1a8cf5a837cd41a47f6833f8db590f6952551b02d009f704e17575f0b5ac
6
+ metadata.gz: 7a84c4f82cd5da914c2dcc561b21d2a57b21806ea663b9a51f9f97f83e6897cc2052d902946ebcea51bea2502383bc8d1cd6092106fbdae5219113b680896b68
7
+ data.tar.gz: 073d12e4f17329540b9b00ea8308408acc8e04c6c094162833e3af459c63f523108331782e51e127bfe8f2ad5eb563e819be69bb1ca3ba113dffb6dfdb6bcd8d
@@ -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,34 @@
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
+
19
+ runs-on: ubuntu-latest
20
+ strategy:
21
+ matrix:
22
+ ruby-version: ['2.4', '2.5', '2.6', '2.7', '3.0', 'head']
23
+
24
+ steps:
25
+ - uses: actions/checkout@v2
26
+ - name: Set up Ruby
27
+ uses: ruby/setup-ruby@v1
28
+ with:
29
+ ruby-version: ${{ matrix.ruby-version }}
30
+ bundler-cache: true # runs 'bundle install' and caches installed gems automatically
31
+ - name: Install dependencies
32
+ run: bundle install
33
+ - name: Run tests
34
+ run: bundle exec rake
@@ -0,0 +1,23 @@
1
+ name: Mark stale issues and pull requests
2
+
3
+ on:
4
+ schedule:
5
+ - cron: "30 1 * * *"
6
+
7
+ jobs:
8
+ stale:
9
+
10
+ runs-on: ubuntu-latest
11
+
12
+ steps:
13
+ - uses: actions/stale@v3
14
+ with:
15
+ repo-token: ${{ secrets.GITHUB_TOKEN }}
16
+ days-before-stale: 60
17
+ days-before-close: 7
18
+ exempt-issue-labels: 'pinned,security'
19
+ exempt-pr-labels: 'pinned,security'
20
+ stale-issue-message: 'This issue has been marked inactive and will be closed if no further activity occurs.'
21
+ stale-pr-message: 'This pr has been marked inactive and will be closed if no further activity occurs.'
22
+ stale-issue-label: 'no-issue-activity'
23
+ stale-pr-label: 'no-pr-activity'
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/Rakefile CHANGED
@@ -1,4 +1,4 @@
1
- require 'bundler/setup'
1
+ require 'bundler/gem_tasks'
2
2
 
3
3
  task :default => [:test]
4
4
 
@@ -20,4 +20,4 @@ task :travis do
20
20
  Coveralls::RakeTask.new
21
21
  Rake::Task["coveralls:push"].invoke
22
22
  end
23
- end
23
+ end
data/changelog.md CHANGED
@@ -1,16 +1,48 @@
1
+ 2.2.4 04/28/2020
2
+ ==========================================================
3
+
4
+ Add FOG_DEBUG in addition to DEBUG to allow avoiding namespace collisions
5
+ Add github actions configuration
6
+ Update succeeds helper to expected syntax for ruby 3+
7
+
8
+ 2.2.3 09/16/2020
9
+ ==========================================================
10
+
11
+ Fix provider lookup to properly symbolize newly underscored names
12
+
13
+ 2.2.2 09/15/2020
14
+ ==========================================================
15
+
16
+ Fix #underscore name to be class method (instead of instance method)
17
+
18
+ 2.2.1 09/15/2020
19
+ ==========================================================
20
+
21
+ - Change to verify_host_key never in ssh/scp if supported
22
+ - Allow either downcased and underscored provider names for broader compatability
23
+
24
+ 2.2.0 12/17/2019
25
+ ==========================================================
26
+
27
+ - Add explanation for service/provider format deprecation.
28
+ - Fix formatting of changelog
29
+ - Better logging around required providers for easier debugging.
30
+ - bump excon version
31
+ - add bundler gem tasks
32
+
1
33
  2.1.2 09/04/2018
2
34
  ==========================================================
3
35
 
4
- fix typo in ssh options handling
36
+ - fix typo in ssh options handling
5
37
 
6
38
  2.1.1 09/04/2018
7
39
  ==========================================================
8
40
 
9
- deprecate attributes not defined by DSL
10
- fix path_prefix warnings
11
- update to enforce best practices
12
- extract parts of ssh to private methods
13
- deprecate wrong provider names
41
+ - deprecate attributes not defined by DSL
42
+ - fix path_prefix warnings
43
+ - update to enforce best practices
44
+ - extract parts of ssh to private methods
45
+ - deprecate wrong provider names
14
46
 
15
47
 
16
48
  2.1.0 03/10/2018
data/fog-core.gemspec CHANGED
@@ -22,7 +22,7 @@ Gem::Specification.new do |spec|
22
22
 
23
23
  spec.add_dependency("builder")
24
24
  spec.add_dependency("mime-types")
25
- spec.add_dependency("excon", "~> 0.58")
25
+ spec.add_dependency("excon", "~> 0.71")
26
26
  spec.add_dependency("formatador", "~> 0.2")
27
27
 
28
28
  # https://github.com/fog/fog-core/issues/206
@@ -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
@@ -8,9 +8,22 @@ module Fog
8
8
  end
9
9
 
10
10
  module Provider
11
- def self.extended(base)
12
- provider = base.to_s.split("::").last
13
- Fog.providers[provider.downcase.to_sym] = provider
11
+ class << self
12
+ def extended(base)
13
+ provider = base.to_s.split("::").last
14
+ Fog.providers[provider.downcase.to_sym] = provider
15
+ Fog.providers[underscore_name(provider).to_sym] = provider
16
+ end
17
+
18
+ private
19
+
20
+ def underscore_name(string)
21
+ string.gsub(/::/, '/').
22
+ gsub(/([A-Z]+)([A-Z][a-z])/,'\1_\2').
23
+ gsub(/([a-z\d])([A-Z])/,'\1_\2').
24
+ tr("-", "_").
25
+ downcase
26
+ end
14
27
  end
15
28
 
16
29
  def [](service_key)
@@ -28,13 +41,22 @@ module Fog
28
41
  @services_registry.keys
29
42
  end
30
43
 
44
+ # Returns service constant path, with provider, as string. If
45
+ # "provider::service" is defined (the preferred format) then it returns that
46
+ # string, otherwise it returns the deprecated string "service::provider".
31
47
  def service_klass(constant_string)
32
48
  eval([to_s, constant_string].join("::"))
33
49
  [to_s, constant_string].join("::")
34
50
  rescue NameError
35
51
  provider = to_s.split("::").last
36
52
  Fog::Logger.deprecation("Unable to load #{[to_s, constant_string].join("::")}")
37
- Fog::Logger.deprecation("The format #{['Fog', constant_string, provider].join("::")} is deprecated")
53
+ Fog::Logger.deprecation(
54
+ format(
55
+ Fog::ServicesMixin::E_SERVICE_PROVIDER_CONSTANT,
56
+ service: constant_string,
57
+ provider: provider
58
+ )
59
+ )
38
60
  ['Fog', constant_string, provider].join("::")
39
61
  end
40
62
  end
data/lib/fog/core/scp.rb CHANGED
@@ -64,8 +64,9 @@ module Fog
64
64
 
65
65
  @address = address
66
66
  @username = username
67
- @options = { :paranoid => false, :verify_host_key => false }.merge(options)
67
+ @options = { :paranoid => false, :verify_host_key => :never }.merge(options)
68
68
  @options.delete(:paranoid) if Net::SSH::VALID_OPTIONS.include? :verify_host_key
69
+ @options[:verify_host_key] = false unless Net::SSH::Verifiers.const_defined?(:Never)
69
70
  end
70
71
 
71
72
  def upload(local_path, remote_path, upload_options = {}, &block)
@@ -1,21 +1,37 @@
1
1
  module Fog
2
2
  module ServicesMixin
3
+ E_SERVICE_PROVIDER_CONSTANT = <<-EOS.gsub(/\s+/, ' ').strip.freeze
4
+ Falling back to deprecated constant Fog::%<service>s::%<provider>s. The
5
+ preferred format of service provider constants has changed from
6
+ service::provider to provider::service. Please update this service
7
+ provider to use the preferred format.
8
+ EOS
9
+ E_SERVICE_PROVIDER_PATH = <<-EOS.gsub(/\s+/, ' ').strip.freeze
10
+ Falling back to deprecated path fog/%<service>s/%<provider>s. The
11
+ preferred file path format has changed from service/provider to
12
+ provider/service. Please update this service provider to use the preferred
13
+ format.
14
+ EOS
15
+
3
16
  def [](provider)
4
17
  new(:provider => provider)
5
18
  end
6
19
 
7
20
  def new(attributes)
8
- attributes = attributes.dup # Prevent delete from having side effects
9
- provider = check_provider_alias(attributes.delete(:provider).to_s.downcase.to_sym)
10
- 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]
11
25
 
12
- 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)
13
27
 
14
- require_service_provider_library(service_name.downcase, provider)
28
+ require_service_provider_library(service_name.downcase, provider_alias)
15
29
  spc = service_provider_constant(service_name, provider_name)
16
30
  spc.new(attributes)
17
- rescue LoadError, NameError # Only rescue errors in finding the libraries, allow connection errors through to the caller
18
- raise Fog::Service::NotFound, "#{provider} has no #{service_name.downcase} service"
31
+ rescue LoadError, NameError => e # Only rescue errors in finding the libraries, allow connection errors through to the caller
32
+ Fog::Logger.warning("Error while loading provider #{provider_alias}: #{e.message}")
33
+ Fog::Logger.debug("backtrace: #{e.backtrace.join("\n")}")
34
+ raise Fog::Service::NotFound, "#{provider_alias} has no #{service_name.downcase} service"
19
35
  end
20
36
 
21
37
  def providers
@@ -32,7 +48,9 @@ module Fog
32
48
  require "fog/#{provider}/#{service}"
33
49
  rescue LoadError # Try to require the service provider in an alternate location
34
50
  Fog::Logger.deprecation("Unable to require fog/#{provider}/#{service}")
35
- Fog::Logger.deprecation("The format fog/#{service}/#{provider} is deprecated")
51
+ Fog::Logger.deprecation(
52
+ format(E_SERVICE_PROVIDER_PATH, service: service, provider: provider)
53
+ )
36
54
  require "fog/#{service}/#{provider}"
37
55
  end
38
56
 
@@ -40,7 +58,9 @@ module Fog
40
58
  Fog.const_get(provider_name).const_get(*const_get_args(service_name))
41
59
  rescue NameError # Try to find the constant from in an alternate location
42
60
  Fog::Logger.deprecation("Unable to load Fog::#{provider_name}::#{service_name}")
43
- Fog::Logger.deprecation("The format Fog::#{service_name}::#{provider_name} is deprecated")
61
+ Fog::Logger.deprecation(
62
+ format(E_SERVICE_PROVIDER_CONSTANT, service: service_name, provider: provider_name)
63
+ )
44
64
  Fog.const_get(service_name).const_get(*const_get_args(provider_name))
45
65
  end
46
66
 
data/lib/fog/core/ssh.rb CHANGED
@@ -116,10 +116,11 @@ module Fog
116
116
 
117
117
  # net-ssh has deprecated :paranoid in favor of :verify_host_key
118
118
  # https://github.com/net-ssh/net-ssh/pull/524
119
- opts = { :paranoid => false, :verify_host_key => false }.merge(options)
119
+ opts = { :paranoid => false, :verify_host_key => :never }.merge(options)
120
120
  if Net::SSH::VALID_OPTIONS.include? :verify_host_key
121
121
  opts.delete(:paranoid)
122
122
  end
123
+ opts[:verify_host_key] = false unless Net::SSH::Verifiers.const_defined?(:Never)
123
124
  opts
124
125
  end
125
126
 
@@ -1,5 +1,5 @@
1
1
  module Fog
2
2
  module Core
3
- VERSION = "2.1.2"
3
+ VERSION = "2.2.4"
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
metadata CHANGED
@@ -1,15 +1,15 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fog-core
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.1.2
4
+ version: 2.2.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Evan Light
8
8
  - Wesley Beary
9
- autorequire:
9
+ autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2018-09-04 00:00:00.000000000 Z
12
+ date: 2021-04-28 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: builder
@@ -45,14 +45,14 @@ dependencies:
45
45
  requirements:
46
46
  - - "~>"
47
47
  - !ruby/object:Gem::Version
48
- version: '0.58'
48
+ version: '0.71'
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
- version: '0.58'
55
+ version: '0.71'
56
56
  - !ruby/object:Gem::Dependency
57
57
  name: formatador
58
58
  requirement: !ruby/object:Gem::Requirement
@@ -201,10 +201,11 @@ executables: []
201
201
  extensions: []
202
202
  extra_rdoc_files: []
203
203
  files:
204
- - ".github/stale.yml"
204
+ - ".github/dependabot.yml"
205
+ - ".github/workflows/ruby.yml"
206
+ - ".github/workflows/stale.yml"
205
207
  - ".gitignore"
206
208
  - ".rubocop.yml"
207
- - ".travis.yml"
208
209
  - CONTRIBUTING.md
209
210
  - CONTRIBUTORS.md
210
211
  - Gemfile
@@ -320,7 +321,7 @@ homepage: https://github.com/fog/fog-core
320
321
  licenses:
321
322
  - MIT
322
323
  metadata: {}
323
- post_install_message:
324
+ post_install_message:
324
325
  rdoc_options: []
325
326
  require_paths:
326
327
  - lib
@@ -335,9 +336,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
335
336
  - !ruby/object:Gem::Version
336
337
  version: '0'
337
338
  requirements: []
338
- rubyforge_project:
339
- rubygems_version: 2.7.6
340
- signing_key:
339
+ rubygems_version: 3.2.15
340
+ signing_key:
341
341
  specification_version: 4
342
342
  summary: Shared classes and tests for fog providers and services.
343
343
  test_files:
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