diff --git a/.github/dependabot.yml b/.github/dependabot.yml new file mode 100644 index 0000000..900df32 --- /dev/null +++ b/.github/dependabot.yml @@ -0,0 +1,7 @@ +--- +version: 2 +updates: + - package-ecosystem: "github-actions" + directory: "/" + schedule: + interval: "daily" diff --git a/.github/workflows/ruby.yml b/.github/workflows/ruby.yml new file mode 100644 index 0000000..ad9d8d1 --- /dev/null +++ b/.github/workflows/ruby.yml @@ -0,0 +1,18 @@ +name: Run Specs +on: [ push, pull_request ] + +jobs: + unit_specs: + strategy: + matrix: + ruby: ['3.3', '3.4', '4.0', head] + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: ruby/setup-ruby@v1 + with: + ruby-version: ${{ matrix.ruby }} + - name: run-specs + run: | + bundle install + bundle exec rspec diff --git a/.gitignore b/.gitignore index e7a7ea7..cfd3953 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,5 @@ Gemfile.lock .idea *.gem +vendor/ /version diff --git a/.rspec b/.rspec deleted file mode 100644 index 5f16476..0000000 --- a/.rspec +++ /dev/null @@ -1,2 +0,0 @@ ---color ---format progress diff --git a/bosh_cpi.gemspec b/bosh_cpi.gemspec index bc71611..e7217a0 100644 --- a/bosh_cpi.gemspec +++ b/bosh_cpi.gemspec @@ -13,12 +13,15 @@ Gem::Specification.new do |spec| spec.homepage = 'https://github.com/cloudfoundry/bosh-cpi-ruby/' spec.license = 'Apache 2.0' spec.email = 'support@cloudfoundry.com' - spec.required_ruby_version = Gem::Requirement.new('>= 1.9.3') + spec.required_ruby_version = Gem::Requirement.new('>= 3.3.0') spec.files = Dir['lib/**/*'].select{ |f| File.file? f } spec.require_path = 'lib' - spec.add_dependency 'membrane', '~>1.1.0' - spec.add_dependency 'httpclient', '~>2.8.3' - spec.add_dependency 'rspec' + spec.add_dependency 'base64' + spec.add_dependency 'logger' + spec.add_dependency 'membrane' + spec.add_dependency 'httpclient' + + spec.add_development_dependency 'rspec' end diff --git a/spec/unit/cpi/cli_spec.rb b/spec/unit/cpi/cli_spec.rb index 734a18e..f22eae5 100644 --- a/spec/unit/cpi/cli_spec.rb +++ b/spec/unit/cpi/cli_spec.rb @@ -592,7 +592,9 @@ def make_result_regexp(result, error = 'null', log_string = 'fake-log') context 'when request json cannot be parsed' do it 'returns invalid_call error' do subject.run('invalid-json') - expect(result_io.string).to match(/{"result":null,"error":{"type":"InvalidCall","message":"Request cannot be deserialized, details: unexpected token at 'invalid-json'","ok_to_retry":false},"log":/) + ruby_3_json_err = "token at 'invalid-json'" + ruby_4_json_err = "character: 'invalid-json' at line 1 column 1" + expect(result_io.string).to match(/{"result":null,"error":{"type":"InvalidCall","message":"Request cannot be deserialized, details: unexpected (#{ruby_3_json_err}|#{ruby_4_json_err})","ok_to_retry":false},"log":/) expect(result_io.string).to include_the_backtrace end end diff --git a/vendor/cache/httpclient-2.8.3.gem b/vendor/cache/httpclient-2.8.3.gem deleted file mode 100644 index 9c19ad4..0000000 Binary files a/vendor/cache/httpclient-2.8.3.gem and /dev/null differ diff --git a/vendor/cache/membrane-1.1.0.gem b/vendor/cache/membrane-1.1.0.gem deleted file mode 100644 index 396f546..0000000 Binary files a/vendor/cache/membrane-1.1.0.gem and /dev/null differ