Added some initial project structure and supporting tooling
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
This commit is contained in:
24
.rubocop.yml
Normal file
24
.rubocop.yml
Normal file
@@ -0,0 +1,24 @@
|
|||||||
|
plugins:
|
||||||
|
- rubocop-rspec
|
||||||
|
|
||||||
|
AllCops:
|
||||||
|
NewCops: enable
|
||||||
|
|
||||||
|
Layout/EmptyLinesAroundClassBody:
|
||||||
|
EnforcedStyle: 'empty_lines_except_namespace'
|
||||||
|
Layout/EmptyLinesAroundModuleBody:
|
||||||
|
EnforcedStyle: 'empty_lines_except_namespace'
|
||||||
|
Layout/FirstHashElementIndentation:
|
||||||
|
EnforcedStyle: 'consistent'
|
||||||
|
Metrics/ClassLength:
|
||||||
|
Max: 150
|
||||||
|
Style/ClassVars:
|
||||||
|
Enabled: false
|
||||||
|
Style/GlobalVars:
|
||||||
|
Enabled: false
|
||||||
|
Style/MethodCallWithoutArgsParentheses:
|
||||||
|
Enabled: false
|
||||||
|
Style/MethodCallWithArgsParentheses:
|
||||||
|
Enabled: true
|
||||||
|
Style/RedundantReturn:
|
||||||
|
Enabled: false
|
39
.woodpecker.yml
Normal file
39
.woodpecker.yml
Normal file
@@ -0,0 +1,39 @@
|
|||||||
|
steps:
|
||||||
|
setup:
|
||||||
|
image: ruby:3.4
|
||||||
|
env:
|
||||||
|
RACK_ENV: testing
|
||||||
|
commands:
|
||||||
|
- gem install rake
|
||||||
|
- bundle config set --local path "vendor/bundle"
|
||||||
|
- bundle install
|
||||||
|
|
||||||
|
test_ruby34:
|
||||||
|
image: ruby:3.4
|
||||||
|
env:
|
||||||
|
RACK_ENV: testing
|
||||||
|
commands:
|
||||||
|
- gem install rake
|
||||||
|
- bundle config set --local path "vendor/bundle"
|
||||||
|
- rake test:unit
|
||||||
|
group: tests
|
||||||
|
|
||||||
|
style:
|
||||||
|
image: ruby:3.4
|
||||||
|
env:
|
||||||
|
RACK_ENV: testing
|
||||||
|
commands:
|
||||||
|
- gem install rake
|
||||||
|
- bundle config set --local path "vendor/bundle"
|
||||||
|
- rake test:lint
|
||||||
|
|
||||||
|
gitea_release:
|
||||||
|
image: plugins/gitea-release
|
||||||
|
settings:
|
||||||
|
api_key:
|
||||||
|
from_secret: gitea_api_key
|
||||||
|
base_url: https://git.metaunix.net
|
||||||
|
title: "${CI_COMMIT_TAG}"
|
||||||
|
when:
|
||||||
|
event:
|
||||||
|
- tag
|
14
Gemfile
Normal file
14
Gemfile
Normal file
@@ -0,0 +1,14 @@
|
|||||||
|
source 'https://rubygems.org'
|
||||||
|
|
||||||
|
gem 'thor', '~> 1.3'
|
||||||
|
|
||||||
|
gem 'logger'
|
||||||
|
|
||||||
|
group :development, :test do
|
||||||
|
# rubocop and extensions for code style
|
||||||
|
gem 'rubocop'
|
||||||
|
gem 'rubocop-rspec'
|
||||||
|
|
||||||
|
# rspec for unit testing
|
||||||
|
gem 'rspec'
|
||||||
|
end
|
66
Gemfile.lock
Normal file
66
Gemfile.lock
Normal file
@@ -0,0 +1,66 @@
|
|||||||
|
GEM
|
||||||
|
remote: https://rubygems.org/
|
||||||
|
specs:
|
||||||
|
ast (2.4.3)
|
||||||
|
diff-lcs (1.6.2)
|
||||||
|
json (2.13.2)
|
||||||
|
language_server-protocol (3.17.0.5)
|
||||||
|
lint_roller (1.1.0)
|
||||||
|
logger (1.7.0)
|
||||||
|
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)
|
||||||
|
regexp_parser (2.11.2)
|
||||||
|
rspec (3.13.1)
|
||||||
|
rspec-core (~> 3.13.0)
|
||||||
|
rspec-expectations (~> 3.13.0)
|
||||||
|
rspec-mocks (~> 3.13.0)
|
||||||
|
rspec-core (3.13.5)
|
||||||
|
rspec-support (~> 3.13.0)
|
||||||
|
rspec-expectations (3.13.5)
|
||||||
|
diff-lcs (>= 1.2.0, < 2.0)
|
||||||
|
rspec-support (~> 3.13.0)
|
||||||
|
rspec-mocks (3.13.5)
|
||||||
|
diff-lcs (>= 1.2.0, < 2.0)
|
||||||
|
rspec-support (~> 3.13.0)
|
||||||
|
rspec-support (3.13.5)
|
||||||
|
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-rspec (3.6.0)
|
||||||
|
lint_roller (~> 1.1)
|
||||||
|
rubocop (~> 1.72, >= 1.72.1)
|
||||||
|
ruby-progressbar (1.13.0)
|
||||||
|
thor (1.4.0)
|
||||||
|
unicode-display_width (3.1.5)
|
||||||
|
unicode-emoji (~> 4.0, >= 4.0.4)
|
||||||
|
unicode-emoji (4.0.4)
|
||||||
|
|
||||||
|
PLATFORMS
|
||||||
|
ruby
|
||||||
|
x86_64-linux-gnu
|
||||||
|
|
||||||
|
DEPENDENCIES
|
||||||
|
logger
|
||||||
|
rspec
|
||||||
|
rubocop
|
||||||
|
rubocop-rspec
|
||||||
|
thor (~> 1.3)
|
||||||
|
|
||||||
|
BUNDLED WITH
|
||||||
|
2.6.9
|
12
Rakefile
Normal file
12
Rakefile
Normal file
@@ -0,0 +1,12 @@
|
|||||||
|
require 'bundler/setup'
|
||||||
|
|
||||||
|
namespace :test do
|
||||||
|
task :unit do
|
||||||
|
ENV['RACK_ENV'] = 'testing'
|
||||||
|
system('rspec')
|
||||||
|
end
|
||||||
|
|
||||||
|
task :lint do
|
||||||
|
system('rubocop src/ spec/')
|
||||||
|
end
|
||||||
|
end
|
12
src/cmd/network.rb
Normal file
12
src/cmd/network.rb
Normal file
@@ -0,0 +1,12 @@
|
|||||||
|
# frozen_string_literal: true
|
||||||
|
|
||||||
|
require 'thor'
|
||||||
|
|
||||||
|
class Network < Thor
|
||||||
|
|
||||||
|
desc 'print', 'Prints the network subcommand.'
|
||||||
|
def print()
|
||||||
|
puts 'This is the network subcommand'
|
||||||
|
end
|
||||||
|
|
||||||
|
end
|
25
src/main.rb
Normal file
25
src/main.rb
Normal file
@@ -0,0 +1,25 @@
|
|||||||
|
# frozen_string_literal: true
|
||||||
|
|
||||||
|
#!/usr/bin/env ruby
|
||||||
|
require 'bundler/setup'
|
||||||
|
require 'thor'
|
||||||
|
|
||||||
|
module PCHWBM
|
||||||
|
|
||||||
|
require_relative 'cmd/network'
|
||||||
|
|
||||||
|
class CLI < Thor
|
||||||
|
|
||||||
|
desc 'version', 'Prints the application version.'
|
||||||
|
def version()
|
||||||
|
puts 'PC Hardware Benchmark CLI app v0.1.0.'
|
||||||
|
end
|
||||||
|
|
||||||
|
desc 'network', 'network SUBCOMMAND for testing networking components.'
|
||||||
|
subcommand 'network', Network
|
||||||
|
|
||||||
|
end
|
||||||
|
|
||||||
|
end
|
||||||
|
|
||||||
|
PCHWBM::CLI.start(ARGV)
|
Reference in New Issue
Block a user