Skip to content

Commit

Permalink
feat!: add support for ruby 3.x (#9)
Browse files Browse the repository at this point in the history
* added support for ruby 3.x
* added github workflows
* added workflow to publish to rubygems

---------

Signed-off-by: Corey Hemminger <hemminger@hotmail.com>
  • Loading branch information
Stromweld authored Jul 1, 2024
1 parent 7c2a286 commit eca1fce
Show file tree
Hide file tree
Showing 18 changed files with 180 additions and 95 deletions.
1 change: 1 addition & 0 deletions .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
@test-kitchen/maintainers
8 changes: 8 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
---
version: 2
updates:
- package-ecosystem: bundler
directory: "/"
schedule:
interval: daily
open-pull-requests-limit: 10
9 changes: 9 additions & 0 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
---
name: 'Lint, Unit & Integration Tests'

'on':
pull_request:

jobs:
lint-unit:
uses: test-kitchen/.github/.github/workflows/lint-unit.yml@main
32 changes: 32 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
---
name: release-please

"on":
push:
branches: [main]

jobs:
release-please:
runs-on: ubuntu-latest
steps:
- uses: googleapis/release-please-action@v4
id: release
with:
token: ${{ secrets.PORTER_GITHUB_TOKEN }}

- name: Checkout
uses: actions/checkout@v4
if: ${{ steps.release.outputs.release_created }}

- name: Build and publish to GitHub Package
uses: actionshub/publish-gem-to-github@main
if: ${{ steps.release.outputs.release_created }}
with:
token: ${{ secrets.GITHUB_TOKEN }}
owner: ${{ secrets.OWNER }}

- name: Build and publish to RubyGems
uses: actionshub/publish-gem-to-rubygems@main
if: ${{ steps.release.outputs.release_created }}
with:
token: ${{ secrets.RUBYGEMS_API_KEY }}
8 changes: 8 additions & 0 deletions .markdownlint.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
---
default: true
MD004: false
MD007: false
MD012: false
MD013: false
MD024: false
MD039: false
3 changes: 3 additions & 0 deletions .release-please-manifest.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
".": "1.1.0"
}
25 changes: 11 additions & 14 deletions .rubocop.yml
Original file line number Diff line number Diff line change
@@ -1,14 +1,11 @@
Metrics/AbcSize:
Max: 50
Metrics/ClassLength:
Max: 300
Metrics/LineLength:
Max: 130
Metrics/MethodLength:
Max: 25
Style/Documentation:
Enabled: false
Style/SignalException:
Enabled: false
Style/SpaceInsideBrackets:
Enabled: false
---
require:
- chefstyle

AllCops:
TargetRubyVersion: 3.1
Include:
- "**/*.rb"
Exclude:
- "vendor/**/*"
- "spec/**/*"
19 changes: 0 additions & 19 deletions .travis.yml

This file was deleted.

3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,16 +1,19 @@
# kitchen-vcair Changelog

## Release: 1.1.0 / 2015-12-17

* [pr#2](https://github.com/chef-partners/kitchen-vcair/pull/2) Added better
error handling to resource fetchers for when the configured resource
(image, network, catalog, etc.) does not exist.

## Release: 1.0.0 / 2015-08-21

* Initial public release
* Refactor by Chef Partner Engineering to match style of other VMware plugins
* Support for vCloud Air OnDemand

## Release: 0.1.1 / 2015-06-04

* Destroy working
* Password updates
* Documentation updates
Expand Down
16 changes: 14 additions & 2 deletions Gemfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,18 @@
# Encoding: UTF-8

source 'https://rubygems.org'

# Specify your gem's dependencies in kitchen-rackspace.gemspec
gemspec

group :test do
gem "rake"
gem "kitchen-inspec"
gem "rspec", "~> 3.2"
end

group :debug do
gem "pry"
end

group :chefstyle do
gem "chefstyle", "2.2.3"
end
12 changes: 5 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,15 @@ gem 'kitchen-vcair'

And then execute:

$ bundle
`bundle`

Or install it yourself as:

$ gem install kitchen-vcair
`gem install kitchen-vcair`

Or even better, install it via ChefDK:

$ chef gem install kitchen-vcair
`chef gem install kitchen-vcair`

## Usage

Expand Down Expand Up @@ -168,9 +168,7 @@ License:: Apache License, Version 2.0
Licensed under the Apache License, Version 2.0 (the "License"); you may not use
this file except in compliance with the License. You may obtain a copy of the License at

```
http://www.apache.org/licenses/LICENSE-2.0
```
<http://www.apache.org/licenses/LICENSE-2.0>

Unless required by applicable law or agreed to in writing, software distributed under the
License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
Expand All @@ -181,7 +179,7 @@ and limitations under the License.

We'd love to hear from you if this doesn't perform in the manner you expect. Please log a GitHub issue, or even better, submit a Pull Request with a fix!

1. Fork it ( https://github.com/chef-partners/kitchen-vcair/fork )
1. Fork it (<https://github.com/chef-partners/kitchen-vcair/fork>)
2. Create your feature branch (`git checkout -b my-new-feature`)
3. Commit your changes (`git commit -am 'Add some feature'`)
4. Push to the branch (`git push origin my-new-feature`)
Expand Down
22 changes: 17 additions & 5 deletions Rakefile
Original file line number Diff line number Diff line change
@@ -1,7 +1,19 @@
require 'bundler/gem_tasks'
require 'rspec/core/rake_task'
require 'rubocop/rake_task'
require "bundler/gem_tasks"

RSpec::Core::RakeTask.new(:spec)
require "rspec/core/rake_task"
desc "Run all specs in spec directory"
RSpec::Core::RakeTask.new(:test) do |t|
t.pattern = "spec/**/*_spec.rb"
end

task default: [ :spec ]
begin
require "chefstyle"
require "rubocop/rake_task"
RuboCop::RakeTask.new(:style) do |task|
task.options += ["--display-cop-names", "--no-color"]
end
rescue LoadError
puts "chefstyle is not available. (sudo) gem install chefstyle to do style checking."
end

task default: %i{test style}
11 changes: 3 additions & 8 deletions kitchen-vcair.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,8 @@ Gem::Specification.new do |spec|
spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
spec.require_paths = %w(lib)

spec.required_ruby_version = '>= 2.0.0'
spec.required_ruby_version = '>= 3.1'

spec.add_dependency 'test-kitchen', '~> 1.4', '>= 1.4.1'
spec.add_dependency 'fog', '~> 1.33'

spec.add_development_dependency 'rake', '~> 10.0'
spec.add_development_dependency 'rspec', '~> 3.2'
spec.add_development_dependency 'rubocop', '~> 0.49'
spec.add_development_dependency 'pry', '~> 0.10'
spec.add_dependency 'test-kitchen', ">= 1.1", "< 4.0"
spec.add_dependency 'fog', "~> 1.38.0"
end
Loading

0 comments on commit eca1fce

Please sign in to comment.