Skip to content

Commit 804c6ff

Browse files
committed
Modernize gem.
1 parent 9a8297b commit 804c6ff

61 files changed

Lines changed: 708 additions & 805 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.editorconfig

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
root = true
2+
3+
[*]
4+
indent_style = tab
5+
indent_size = 2
6+
7+
[*.{yml,yaml}]
8+
indent_style = space
9+
indent_size = 2
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
name: Documentation Coverage
2+
3+
on: [push, pull_request]
4+
5+
permissions:
6+
contents: read
7+
8+
env:
9+
CONSOLE_OUTPUT: XTerm
10+
COVERAGE: PartialSummary
11+
12+
jobs:
13+
validate:
14+
runs-on: ubuntu-latest
15+
16+
steps:
17+
- uses: actions/checkout@v4
18+
- uses: ruby/setup-ruby@v1
19+
with:
20+
ruby-version: "3.3"
21+
bundler-cache: true
22+
23+
- name: Validate coverage
24+
timeout-minutes: 5
25+
run: bundle exec bake decode:index:coverage lib
Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
name: Documentation
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
8+
# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages:
9+
permissions:
10+
contents: read
11+
pages: write
12+
id-token: write
13+
14+
# Allow one concurrent deployment:
15+
concurrency:
16+
group: "pages"
17+
cancel-in-progress: true
18+
19+
env:
20+
CONSOLE_OUTPUT: XTerm
21+
BUNDLE_WITH: maintenance
22+
23+
jobs:
24+
generate:
25+
runs-on: ubuntu-latest
26+
27+
steps:
28+
- uses: actions/checkout@v4
29+
30+
- uses: ruby/setup-ruby@v1
31+
with:
32+
ruby-version: "3.3"
33+
bundler-cache: true
34+
35+
- name: Installing packages
36+
run: sudo apt-get install wget
37+
38+
- name: Generate documentation
39+
timeout-minutes: 5
40+
run: bundle exec bake utopia:project:static --force no
41+
42+
- name: Upload documentation artifact
43+
uses: actions/upload-pages-artifact@v3
44+
with:
45+
path: docs
46+
47+
deploy:
48+
runs-on: ubuntu-latest
49+
50+
environment:
51+
name: github-pages
52+
url: ${{steps.deployment.outputs.page_url}}
53+
54+
needs: generate
55+
steps:
56+
- name: Deploy to GitHub Pages
57+
id: deployment
58+
uses: actions/deploy-pages@v4

.github/workflows/rubocop.yaml

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
name: RuboCop
2+
3+
on: [push, pull_request]
4+
5+
permissions:
6+
contents: read
7+
8+
env:
9+
CONSOLE_OUTPUT: XTerm
10+
11+
jobs:
12+
check:
13+
runs-on: ubuntu-latest
14+
15+
steps:
16+
- uses: actions/checkout@v4
17+
- uses: ruby/setup-ruby@v1
18+
with:
19+
ruby-version: ruby
20+
bundler-cache: true
21+
22+
- name: Run RuboCop
23+
timeout-minutes: 10
24+
run: bundle exec rubocop
Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
name: Test Coverage
2+
3+
on: [push, pull_request]
4+
5+
permissions:
6+
contents: read
7+
8+
env:
9+
CONSOLE_OUTPUT: XTerm
10+
COVERAGE: PartialSummary
11+
12+
jobs:
13+
test:
14+
name: ${{matrix.ruby}} on ${{matrix.os}}
15+
runs-on: ${{matrix.os}}-latest
16+
17+
strategy:
18+
matrix:
19+
os:
20+
- ubuntu
21+
- macos
22+
23+
ruby:
24+
- "3.3"
25+
26+
steps:
27+
- uses: actions/checkout@v4
28+
- uses: ruby/setup-ruby@v1
29+
with:
30+
ruby-version: ${{matrix.ruby}}
31+
bundler-cache: true
32+
33+
- name: Run tests
34+
timeout-minutes: 5
35+
run: bundle exec bake test
36+
37+
- uses: actions/upload-artifact@v4
38+
with:
39+
include-hidden-files: true
40+
if-no-files-found: error
41+
name: coverage-${{matrix.os}}-${{matrix.ruby}}
42+
path: .covered.db
43+
44+
validate:
45+
needs: test
46+
runs-on: ubuntu-latest
47+
48+
steps:
49+
- uses: actions/checkout@v4
50+
- uses: ruby/setup-ruby@v1
51+
with:
52+
ruby-version: "3.3"
53+
bundler-cache: true
54+
55+
- uses: actions/download-artifact@v4
56+
57+
- name: Validate coverage
58+
timeout-minutes: 5
59+
run: bundle exec bake covered:validate --paths */.covered.db \;

.github/workflows/test.yaml

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
name: Test
2+
3+
on: [push, pull_request]
4+
5+
permissions:
6+
contents: read
7+
8+
env:
9+
CONSOLE_OUTPUT: XTerm
10+
11+
jobs:
12+
test:
13+
name: ${{matrix.ruby}} on ${{matrix.os}}
14+
runs-on: ${{matrix.os}}-latest
15+
continue-on-error: ${{matrix.experimental}}
16+
17+
strategy:
18+
matrix:
19+
os:
20+
- ubuntu
21+
- macos
22+
23+
ruby:
24+
- "3.1"
25+
- "3.2"
26+
- "3.3"
27+
28+
experimental: [false]
29+
30+
include:
31+
- os: ubuntu
32+
ruby: truffleruby
33+
experimental: true
34+
- os: ubuntu
35+
ruby: jruby
36+
experimental: true
37+
- os: ubuntu
38+
ruby: head
39+
experimental: true
40+
41+
steps:
42+
- uses: actions/checkout@v4
43+
- uses: ruby/setup-ruby@v1
44+
with:
45+
ruby-version: ${{matrix.ruby}}
46+
bundler-cache: true
47+
48+
- name: Run tests
49+
timeout-minutes: 10
50+
run: bundle exec bake test

.gitignore

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
1-
# Development specific:
2-
/.rspec_status
3-
/.bundle
1+
/.bundle/
2+
/pkg/
3+
/gems.locked
4+
/.covered.db
5+
/external
46

57
# Temporary data should not be added to the repository:
68
/tmp
@@ -15,4 +17,4 @@
1517
/public/_gallery
1618

1719
/db
18-
/example/db
20+
/example/db

.rubocop.yml

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
AllCops:
2+
DisabledByDefault: true
3+
4+
Layout/IndentationStyle:
5+
Enabled: true
6+
EnforcedStyle: tabs
7+
8+
Layout/InitialIndentation:
9+
Enabled: true
10+
11+
Layout/IndentationWidth:
12+
Enabled: true
13+
Width: 1
14+
15+
Layout/IndentationConsistency:
16+
Enabled: true
17+
EnforcedStyle: normal
18+
19+
Layout/BlockAlignment:
20+
Enabled: true
21+
22+
Layout/EndAlignment:
23+
Enabled: true
24+
EnforcedStyleAlignWith: start_of_line
25+
26+
Layout/BeginEndAlignment:
27+
Enabled: true
28+
EnforcedStyleAlignWith: start_of_line
29+
30+
Layout/ElseAlignment:
31+
Enabled: true
32+
33+
Layout/DefEndAlignment:
34+
Enabled: true
35+
36+
Layout/CaseIndentation:
37+
Enabled: true
38+
39+
Layout/CommentIndentation:
40+
Enabled: true
41+
42+
Layout/EmptyLinesAroundClassBody:
43+
Enabled: true
44+
45+
Layout/EmptyLinesAroundModuleBody:
46+
Enabled: true
47+
48+
Style/FrozenStringLiteralComment:
49+
Enabled: true
50+
51+
Style/StringLiterals:
52+
Enabled: true
53+
EnforcedStyle: double_quotes

bake/financier/user.rb

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,16 @@
1+
# frozen_string_literal: true
2+
3+
# Released under the MIT License.
4+
# Copyright, 2017-2024, by Samuel Williams.
15

26
def create
3-
call 'environment'
7+
call "environment"
48

5-
require 'tty/prompt'
9+
require "tty/prompt"
610

711
prompt = TTY::Prompt.new
812

9-
name = prompt.ask("Login name:", default: 'admin')
13+
name = prompt.ask("Login name:", default: "admin")
1014
password = prompt.mask("Login password:")
1115

1216
Financier::DB.commit(message: "New User") do |dataset|

config.ru

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
#!/usr/bin/env rackup
22
# frozen_string_literal: true
33

4-
require_relative 'config/environment'
4+
require_relative "config/environment"
55

6-
require 'financier/middleware'
6+
require "financier/middleware"
77

88
Financier::Middleware.call(self, utopia: UTOPIA)

0 commit comments

Comments
 (0)