Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
73 changes: 73 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
name: CI

on:
push:
branches: [ master ]
pull_request:
branches: [ master ]

jobs:
test:
runs-on: ubuntu-latest
strategy:
matrix:
ruby-version: ['3.0', '3.1', '3.2', '3.3']

steps:
- uses: actions/checkout@v4

- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ matrix.ruby-version }}
bundler-cache: true

- name: Install dependencies
run: bundle install

- name: Run tests with coverage
run: bundle exec rake test

- name: Upload coverage reports to Codecov
if: matrix.ruby-version == '3.3'
uses: codecov/codecov-action@v5
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: ./coverage/lcov.info
fail_ci_if_error: true

- name: Run RuboCop
run: bundle exec rubocop

lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: '3.3'
bundler-cache: true

- name: Install dependencies
run: bundle install

- name: Run RuboCop
run: bundle exec rubocop --parallel

security:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: '3.3'
bundler-cache: true

- name: Run bundle audit
run: |
gem install bundler-audit
bundle audit --update
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,4 @@ Gemfile.lock
pkg/*
*.sw*
.open_table
coverage/
61 changes: 61 additions & 0 deletions .rubocop.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
plugins:
- rubocop-minitest
- rubocop-rake

AllCops:
TargetRubyVersion: 3.0
NewCops: enable
Exclude:
- 'vendor/**/*'
- 'tmp/**/*'
- 'bin/**/*'

# Prefer double quotes for consistency
Style/StringLiterals:
EnforcedStyle: single_quotes

# Allow longer line lengths for readability
Layout/LineLength:
Max: 120

# Documentation is helpful but not required for every class
Style/Documentation:
Enabled: false

# Allow both compact and expanded module/class nesting
Style/ClassAndModuleChildren:
Enabled: false

# Prefer modern Hash syntax
Style/HashSyntax:
EnforcedStyle: ruby19

# Allow empty methods without body
Style/EmptyMethod:
EnforcedStyle: expanded

# Metrics
Metrics/MethodLength:
Max: 20
Exclude:
- 'test/**/*'

Metrics/ClassLength:
Max: 100
Exclude:
- 'test/**/*'

Metrics/BlockLength:
Exclude:
- 'test/**/*'
- '*.gemspec'
- 'Rakefile'

Metrics/AbcSize:
Max: 20
Exclude:
- 'test/**/*'

# Minitest
Minitest/MultipleAssertions:
Max: 15
1 change: 1 addition & 0 deletions .ruby-version
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
3.3.0
1 change: 0 additions & 1 deletion .rvmrc

This file was deleted.

13 changes: 13 additions & 0 deletions .simplecov
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# frozen_string_literal: true

SimpleCov.configure do
add_filter '/test/'
add_filter '/spec/'
add_filter '/.bundle/'
add_filter '/vendor/'

minimum_coverage 90

# Track all files in lib/
track_files 'lib/**/*.rb'
end
19 changes: 18 additions & 1 deletion Gemfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,22 @@
source "http://rubygems.org"
# frozen_string_literal: true

source 'https://rubygems.org'

# Specify your gem's dependencies in hungrytable.gemspec
gemspec

group :development, :test do
gem 'guard', '~> 2.18'
gem 'guard-minitest', '~> 2.4'
gem 'minitest', '~> 5.20'
gem 'minitest-reporters', '~> 1.6'
gem 'mocha', '~> 2.1'
gem 'pry', '~> 0.14'
gem 'rake', '~> 13.0'
gem 'rubocop', '~> 1.60'
gem 'rubocop-minitest', '~> 0.35'
gem 'rubocop-rake', '~> 0.6'
gem 'simplecov', '~> 0.22.0', require: false
gem 'simplecov-lcov', require: false
gem 'webmock', '~> 3.20'
end
8 changes: 5 additions & 3 deletions Guardfile
Original file line number Diff line number Diff line change
@@ -1,13 +1,15 @@
# frozen_string_literal: true

# A sample Guardfile
# More info at https://github.com/guard/guard#readme

notification :libnotify

guard 'minitest' do
# with Minitest::Unit
watch(%r|^test/(.*)_test\.rb|)
watch(%r|^lib/(.*)/([^/]+)\.rb|) { |m| "test/unit/#{m[1]}/#{m[2]}_test.rb" }
watch(%r|^test/test_helper\.rb|) { "test" }
watch(%r{^test/(.*)_test\.rb})
watch(%r{^lib/(.*)/([^/]+)\.rb}) { |m| "test/unit/#{m[1]}/#{m[2]}_test.rb" }
watch(%r{^test/test_helper\.rb}) { 'test' }

# with Minitest::Spec
# watch(%r|^spec/(.*)_spec\.rb|)
Expand Down
Loading