From 3e87f504213e920bb921b62dfcff8bdf0c80bde2 Mon Sep 17 00:00:00 2001 From: geemus Date: Tue, 25 Oct 2022 09:53:51 -0500 Subject: [PATCH 1/2] add libcurldev to github actions setup for fog-aliyun --- .github/workflows/ruby.yml | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ruby.yml b/.github/workflows/ruby.yml index f80d3cf49..b85bf5356 100644 --- a/.github/workflows/ruby.yml +++ b/.github/workflows/ruby.yml @@ -18,6 +18,25 @@ permissions: jobs: test: + permissions: contents: none - uses: fog/.github/.github/workflows/ruby.yml@v1.1.0 + + runs-on: ubuntu-latest + + strategy: + matrix: + ruby-version: ['2.5', '2.6', '2.7', '3.0', '3.1', 'head'] + continue-on-error: ${{ matrix.ruby-version == 'head' }} + + steps: + - uses: actions/checkout@v2.4.0 + - name: Set up dependencies + run: sudo apt-get install libcurl4-openssl-dev + - name: Set up Ruby + uses: ruby/setup-ruby@v1 + with: + ruby-version: ${{ matrix.ruby-version }} + bundler-cache: true # runs 'bundle install' and caches installed gems automatically + - name: Run tests + run: bundle exec rake From 2939863efc1cc0e9e63b7eebfe8a712f077488cc Mon Sep 17 00:00:00 2001 From: geemus Date: Tue, 25 Oct 2022 10:29:50 -0500 Subject: [PATCH 2/2] check for constant defined before trying to const get in bin tests --- lib/fog/bin.rb | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/fog/bin.rb b/lib/fog/bin.rb index ca0945109..e06b62f30 100644 --- a/lib/fog/bin.rb +++ b/lib/fog/bin.rb @@ -3,7 +3,9 @@ require 'fog/core/credentials' module Fog class << self def available_providers - @available_providers ||= Fog.providers.values.select {|provider| Kernel.const_get(provider).try(:available?)}.sort + available_providers ||= Fog.providers.values.select do |provider| + Kernel.const_defined?(provider) && Kernel.const_get(provider).try(:available?) + end.sort end def registered_providers