Skip to content

Commit ff673f5

Browse files
committed
init
0 parents  commit ff673f5

25 files changed

Lines changed: 2611 additions & 0 deletions

.github/dependabot.yml

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
version: 2
2+
updates:
3+
- package-ecosystem: "bundler"
4+
directory: "/"
5+
schedule:
6+
interval: "daily"
7+
open-pull-requests-limit: 5
8+
commit-message:
9+
prefix: "chore"
10+
include: "scope"
11+
labels:
12+
- "dependencies"
13+
- "ruby"
14+
versioning-strategy: "increase"
15+
allow:
16+
- dependency-type: "direct"
17+
- dependency-type: "indirect"
18+
ignore:
19+
# Ignore major version updates for now
20+
- dependency-name: "*"
21+
update-types: ["version-update:semver-major"]

.github/workflows/ci.yml

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches: [ main ]
6+
7+
jobs:
8+
test:
9+
runs-on: self-hosted
10+
strategy:
11+
matrix:
12+
ruby-version: ['2.7', '3.0', '3.1', '3.2', '3.3', '3.4']
13+
14+
steps:
15+
- uses: actions/checkout@v4
16+
17+
- name: Set up Ruby ${{ matrix.ruby-version }}
18+
uses: ruby/setup-ruby@v1
19+
with:
20+
ruby-version: ${{ matrix.ruby-version }}
21+
bundler-cache: true
22+
23+
- name: Run tests
24+
run: bundle exec rspec
25+
env:
26+
TAPSILAT_API_TOKEN: ${{ secrets.TAPSILAT_API_TOKEN }}
27+
28+
- name: Run RuboCop
29+
run: bundle exec rubocop
30+
31+
- name: Generate coverage report
32+
run: bundle exec rake coverage
33+
env:
34+
COVERAGE: true
35+
TAPSILAT_API_TOKEN: ${{ secrets.TAPSILAT_API_TOKEN }}
36+
37+
- name: Upload coverage to Codecov
38+
uses: codecov/codecov-action@v3
39+
if: matrix.ruby-version == '3.4'
40+
with:
41+
file: ./coverage/coverage.xml
42+
flags: unittests
43+
name: codecov-umbrella
44+
fail_ci_if_error: false
45+
46+
security:
47+
runs-on: self-hosted
48+
steps:
49+
- uses: actions/checkout@v4
50+
51+
- name: Set up Ruby
52+
uses: ruby/setup-ruby@v1
53+
with:
54+
ruby-version: '3.4'
55+
bundler-cache: true
56+
57+
- name: Run bundle audit
58+
run: |
59+
gem install bundler-audit
60+
bundle audit check --update

.gitignore

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
*.gem
2+
*.rbc
3+
/.config
4+
/coverage/
5+
/InstalledFiles
6+
/pkg/
7+
/spec/reports/
8+
/spec/examples.txt
9+
/test/tmp/
10+
/test/version_tmp/
11+
/tmp/
12+
13+
# Used by dotenv library to load environment variables.
14+
.env
15+
16+
# Ignore Byebug command history file.
17+
.byebug_history
18+
19+
# Ignore RSpec status file
20+
.rspec_status
21+
22+
# Ignore VCR cassettes that might contain sensitive data
23+
/spec/vcr_cassettes/*
24+
!/spec/vcr_cassettes/.keep
25+
26+
# Bundler
27+
/vendor/bundle
28+
Gemfile.lock
29+
30+
# Documentation
31+
/doc/
32+
/.yardoc
33+
/_yardoc/
34+
35+
# IDEs
36+
.vscode/
37+
.idea/
38+
*.sublime-*
39+
40+
# OS files
41+
.DS_Store
42+
.DS_Store?
43+
._*
44+
.Spotlight-V100
45+
.Trashes
46+
ehthumbs.db
47+
Thumbs.db
48+
49+
# Temporary files
50+
*~
51+
*.swp
52+
*.swo

.rspec

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
--require spec_helper
2+
--format documentation
3+
--color
4+
--order random

.rubocop.yml

Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
require:
2+
- rubocop-rspec
3+
4+
AllCops:
5+
TargetRubyVersion: 2.6
6+
NewCops: enable
7+
SuggestExtensions: false
8+
Exclude:
9+
- 'vendor/**/*'
10+
- 'tmp/**/*'
11+
- 'bin/**/*'
12+
13+
# Disable problematic cops
14+
Capybara/RSpec/PredicateMatcher:
15+
Enabled: false
16+
17+
Layout/LineLength:
18+
Max: 120
19+
Exclude:
20+
- 'spec/**/*'
21+
22+
Metrics/MethodLength:
23+
Max: 50
24+
Exclude:
25+
- 'spec/**/*'
26+
27+
Metrics/BlockLength:
28+
Max: 40
29+
Exclude:
30+
- 'spec/**/*'
31+
- 'tapsilat.gemspec'
32+
33+
Metrics/ClassLength:
34+
Max: 400
35+
Exclude:
36+
- 'spec/**/*'
37+
38+
Metrics/AbcSize:
39+
Max: 40
40+
41+
Metrics/CyclomaticComplexity:
42+
Max: 20
43+
44+
Metrics/PerceivedComplexity:
45+
Max: 20
46+
47+
Metrics/ParameterLists:
48+
Max: 10
49+
50+
Style/Documentation:
51+
Enabled: false
52+
53+
Style/FrozenStringLiteralComment:
54+
Enabled: false
55+
56+
RSpec/ExampleLength:
57+
Max: 50
58+
59+
RSpec/MultipleExpectations:
60+
Max: 25
61+
62+
RSpec/NestedGroups:
63+
Max: 4
64+
65+
Naming/PredicatePrefix:
66+
Enabled: false
67+
68+
Gemspec/DevelopmentDependencies:
69+
Enabled: false
70+
71+
RSpec/IdenticalEqualityAssertion:
72+
Enabled: false

Gemfile

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
source 'https://rubygems.org'
2+
3+
# Specify your gem's dependencies in tapsilat.gemspec
4+
gemspec

LICENSE

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2024 Tapsilat
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

Makefile

Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
.PHONY: help install test test-verbose coverage lint format console clean ci setup
2+
3+
# Default target
4+
help: ## Show this help message
5+
@echo 'Usage: make [target]'
6+
@echo ''
7+
@echo 'Targets:'
8+
@awk 'BEGIN {FS = ":.*?## "} /^[a-zA-Z_-]+:.*?## / {printf " %-15s %s\n", $$1, $$2}' $(MAKEFILE_LIST)
9+
10+
setup: ## Initial setup - install dependencies
11+
bundle install
12+
13+
install: ## Install dependencies
14+
bundle install
15+
16+
test: ## Run all tests
17+
bundle exec rspec
18+
19+
test-verbose: ## Run tests with verbose output
20+
bundle exec rspec --format documentation
21+
22+
coverage: ## Run tests with coverage report
23+
bundle exec rake coverage
24+
25+
lint: ## Run linting (RuboCop)
26+
bundle exec rubocop
27+
28+
format: ## Auto-fix linting issues
29+
bundle exec rubocop -a
30+
31+
console: ## Start interactive console
32+
bundle exec rake console
33+
34+
clean: ## Clean up generated files
35+
rm -rf coverage/
36+
rm -f .rspec_status
37+
38+
ci: ## Run CI pipeline (tests + linting)
39+
bundle exec rake ci
40+
41+
build: ## Build the gem
42+
bundle exec rake build
43+
44+
release: ## Release a patch version (0.1.4 -> 0.1.5)
45+
ruby release.rb patch
46+
47+
release-minor: ## Release a minor version (0.1.4 -> 0.2.0)
48+
ruby release.rb minor
49+
50+
release-major: ## Release a major version (0.1.4 -> 1.0.0)
51+
ruby release.rb major
52+
53+
release-patch: ## Alias for release (patch version)
54+
ruby release.rb patch
55+
56+
yard: ## Generate documentation
57+
bundle exec yard
58+
59+
server: ## Start YARD documentation server
60+
bundle exec yard server
61+
62+
# Development shortcuts
63+
t: test ## Shortcut for test
64+
l: lint ## Shortcut for lint
65+
c: console ## Shortcut for console
66+
r: release ## Shortcut for release (patch)
67+
rm: release-minor ## Shortcut for release-minor
68+
rM: release-major ## Shortcut for release-major

0 commit comments

Comments
 (0)