Compare commits
9 Commits
0fd2b75e60
...
main
Author | SHA1 | Date | |
---|---|---|---|
55900c3df9 | |||
b76e4adbf7 | |||
4a63b5a61c | |||
31e63f3ada | |||
1758651b9e | |||
b0b897152f | |||
902b185d96 | |||
3317aa6bf9 | |||
3cc545bb8c |
36
.gitea/workflows/code-quality.yaml
Normal file
36
.gitea/workflows/code-quality.yaml
Normal file
@@ -0,0 +1,36 @@
|
|||||||
|
name: Code Quality
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
format:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- name: Check out repository code
|
||||||
|
uses: actions/checkout@v5
|
||||||
|
|
||||||
|
- name: Setup Ruby
|
||||||
|
uses: ruby/setup-ruby@v1
|
||||||
|
with:
|
||||||
|
ruby-version: .ruby-version
|
||||||
|
bundler-cache: true
|
||||||
|
|
||||||
|
- name: Check formatting
|
||||||
|
run: bundle exec rubocop --only Layout --parallel
|
||||||
|
|
||||||
|
lint:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
needs: format
|
||||||
|
steps:
|
||||||
|
- name: Check out repository code
|
||||||
|
uses: actions/checkout@v5
|
||||||
|
|
||||||
|
- name: Setup Ruby
|
||||||
|
uses: ruby/setup-ruby@v1
|
||||||
|
with:
|
||||||
|
ruby-version: .ruby-version
|
||||||
|
bundler-cache: true
|
||||||
|
|
||||||
|
- name: Run lint
|
||||||
|
run: bundle exec rubocop --except Layout --parallel
|
19
.gitea/workflows/run-tests.yaml
Normal file
19
.gitea/workflows/run-tests.yaml
Normal file
@@ -0,0 +1,19 @@
|
|||||||
|
name: Run tests
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
test:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- name: Check out repository code
|
||||||
|
uses: actions/checkout@v5
|
||||||
|
|
||||||
|
- name: Setup ruby
|
||||||
|
uses: ruby/setup-ruby@v1
|
||||||
|
with:
|
||||||
|
ruby-version: .ruby-version
|
||||||
|
bundler-cache: true
|
||||||
|
|
||||||
|
- name: Run tests
|
||||||
|
run: bundle exec rake test
|
36
.github/workflows/code-quality.yaml
vendored
Normal file
36
.github/workflows/code-quality.yaml
vendored
Normal file
@@ -0,0 +1,36 @@
|
|||||||
|
name: Code Quality
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
format:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- name: Check out repository code
|
||||||
|
uses: actions/checkout@v5
|
||||||
|
|
||||||
|
- name: Setup Ruby
|
||||||
|
uses: ruby/setup-ruby@v1
|
||||||
|
with:
|
||||||
|
ruby-version: .ruby-version
|
||||||
|
bundler-cache: true
|
||||||
|
|
||||||
|
- name: Check formatting
|
||||||
|
run: bundle exec rubocop --only Layout --parallel
|
||||||
|
|
||||||
|
lint:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
needs: format
|
||||||
|
steps:
|
||||||
|
- name: Check out repository code
|
||||||
|
uses: actions/checkout@v5
|
||||||
|
|
||||||
|
- name: Setup Ruby
|
||||||
|
uses: ruby/setup-ruby@v1
|
||||||
|
with:
|
||||||
|
ruby-version: .ruby-version
|
||||||
|
bundler-cache: true
|
||||||
|
|
||||||
|
- name: Run lint
|
||||||
|
run: bundle exec rubocop --except Layout --parallel
|
19
.github/workflows/run-tests.yaml
vendored
Normal file
19
.github/workflows/run-tests.yaml
vendored
Normal file
@@ -0,0 +1,19 @@
|
|||||||
|
name: Run tests
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
test:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- name: Check out repository code
|
||||||
|
uses: actions/checkout@v5
|
||||||
|
|
||||||
|
- name: Setup ruby
|
||||||
|
uses: ruby/setup-ruby@v1
|
||||||
|
with:
|
||||||
|
ruby-version: .ruby-version
|
||||||
|
bundler-cache: true
|
||||||
|
|
||||||
|
- name: Run tests
|
||||||
|
run: bundle exec rake test
|
@@ -1,3 +1,6 @@
|
|||||||
AllCops:
|
AllCops:
|
||||||
TargetRubyVersion: 3.4
|
TargetRubyVersion: 3.4
|
||||||
NewCops: enable
|
NewCops: enable
|
||||||
|
plugins:
|
||||||
|
- rubocop-minitest
|
||||||
|
- rubocop-rake
|
||||||
|
1
.ruby-version
Normal file
1
.ruby-version
Normal file
@@ -0,0 +1 @@
|
|||||||
|
3.4.2
|
6
CHANGELOG.md
Normal file
6
CHANGELOG.md
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
# Changelog
|
||||||
|
|
||||||
|
All notable changes to this project will be documented in this file.
|
||||||
|
|
||||||
|
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
|
||||||
|
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
9
Gemfile
9
Gemfile
@@ -1,5 +1,12 @@
|
|||||||
# frozen_string_literal: true
|
# frozen_string_literal: true
|
||||||
|
|
||||||
source "https://rubygems.org"
|
source 'https://rubygems.org'
|
||||||
|
|
||||||
# gem "rails"
|
# gem "rails"
|
||||||
|
gem 'minitest', '~> 5.25'
|
||||||
|
|
||||||
|
gem 'rake', '~> 13.3'
|
||||||
|
|
||||||
|
gem 'rubocop', require: false
|
||||||
|
gem 'rubocop-minitest', '~> 0.38.2', require: false
|
||||||
|
gem 'rubocop-rake', '~> 0.7.1', require: false
|
||||||
|
44
Gemfile.lock
44
Gemfile.lock
@@ -1,12 +1,56 @@
|
|||||||
GEM
|
GEM
|
||||||
remote: https://rubygems.org/
|
remote: https://rubygems.org/
|
||||||
specs:
|
specs:
|
||||||
|
ast (2.4.3)
|
||||||
|
json (2.13.2)
|
||||||
|
language_server-protocol (3.17.0.5)
|
||||||
|
lint_roller (1.1.0)
|
||||||
|
minitest (5.25.5)
|
||||||
|
parallel (1.27.0)
|
||||||
|
parser (3.3.9.0)
|
||||||
|
ast (~> 2.4.1)
|
||||||
|
racc
|
||||||
|
prism (1.4.0)
|
||||||
|
racc (1.8.1)
|
||||||
|
rainbow (3.1.1)
|
||||||
|
rake (13.3.0)
|
||||||
|
regexp_parser (2.11.2)
|
||||||
|
rubocop (1.80.1)
|
||||||
|
json (~> 2.3)
|
||||||
|
language_server-protocol (~> 3.17.0.2)
|
||||||
|
lint_roller (~> 1.1.0)
|
||||||
|
parallel (~> 1.10)
|
||||||
|
parser (>= 3.3.0.2)
|
||||||
|
rainbow (>= 2.2.2, < 4.0)
|
||||||
|
regexp_parser (>= 2.9.3, < 3.0)
|
||||||
|
rubocop-ast (>= 1.46.0, < 2.0)
|
||||||
|
ruby-progressbar (~> 1.7)
|
||||||
|
unicode-display_width (>= 2.4.0, < 4.0)
|
||||||
|
rubocop-ast (1.46.0)
|
||||||
|
parser (>= 3.3.7.2)
|
||||||
|
prism (~> 1.4)
|
||||||
|
rubocop-minitest (0.38.2)
|
||||||
|
lint_roller (~> 1.1)
|
||||||
|
rubocop (>= 1.75.0, < 2.0)
|
||||||
|
rubocop-ast (>= 1.38.0, < 2.0)
|
||||||
|
rubocop-rake (0.7.1)
|
||||||
|
lint_roller (~> 1.1)
|
||||||
|
rubocop (>= 1.72.1)
|
||||||
|
ruby-progressbar (1.13.0)
|
||||||
|
unicode-display_width (3.1.5)
|
||||||
|
unicode-emoji (~> 4.0, >= 4.0.4)
|
||||||
|
unicode-emoji (4.0.4)
|
||||||
|
|
||||||
PLATFORMS
|
PLATFORMS
|
||||||
ruby
|
ruby
|
||||||
x86_64-linux
|
x86_64-linux
|
||||||
|
|
||||||
DEPENDENCIES
|
DEPENDENCIES
|
||||||
|
minitest (~> 5.25)
|
||||||
|
rake (~> 13.3)
|
||||||
|
rubocop
|
||||||
|
rubocop-minitest (~> 0.38.2)
|
||||||
|
rubocop-rake (~> 0.7.1)
|
||||||
|
|
||||||
BUNDLED WITH
|
BUNDLED WITH
|
||||||
2.7.1
|
2.7.1
|
||||||
|
10
README.md
10
README.md
@@ -1,3 +1,13 @@
|
|||||||
# Ruby Project
|
# Ruby Project
|
||||||
|
|
||||||
A little template for Ruby projects.
|
A little template for Ruby projects.
|
||||||
|
|
||||||
|
## Testing
|
||||||
|
|
||||||
|
This project uses [`minitest`](https://www.minite.st/) to run the tests.
|
||||||
|
|
||||||
|
A rake task is present in the [`Rakefile`](./Rakefile):
|
||||||
|
|
||||||
|
```sh
|
||||||
|
rake test
|
||||||
|
```
|
||||||
|
9
Rakefile
9
Rakefile
@@ -1,7 +1,8 @@
|
|||||||
require "rake/testtask"
|
# frozen_string_literal: true
|
||||||
|
|
||||||
|
require 'rake/testtask'
|
||||||
|
|
||||||
Rake::TestTask.new(:test) do |t|
|
Rake::TestTask.new(:test) do |t|
|
||||||
t.libs << "tests"
|
t.libs << 'tests'
|
||||||
t.test_files = FileList["tests/**/*_test.rb"]
|
t.test_files = FileList['tests/**/*_test.rb']
|
||||||
end
|
end
|
||||||
|
|
||||||
|
4
main.rb
4
main.rb
@@ -1,6 +1,8 @@
|
|||||||
#! /usr/bin/env ruby
|
# frozen_string_literal: true
|
||||||
|
|
||||||
|
# main
|
||||||
def main
|
def main
|
||||||
|
0
|
||||||
end
|
end
|
||||||
|
|
||||||
main if __FILE__ == $PROGRAM_NAME
|
main if __FILE__ == $PROGRAM_NAME
|
||||||
|
@@ -1,8 +1,11 @@
|
|||||||
require "minitest/autorun"
|
# frozen_string_literal: true
|
||||||
require_relative "../main"
|
|
||||||
|
|
||||||
|
require 'minitest/autorun'
|
||||||
|
require_relative '../main'
|
||||||
|
|
||||||
|
# TestMain
|
||||||
class TestMain < Minitest::Test
|
class TestMain < Minitest::Test
|
||||||
def test_main
|
def test_main
|
||||||
assert_equal true, true
|
assert_equal 0, main
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
Reference in New Issue
Block a user