Skip to content

Commit 54515c7

Browse files
committed
v0.1.0
2 parents 155c931 + 789bb14 commit 54515c7

37 files changed

Lines changed: 928 additions & 0 deletions

.editorconfig

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
# EditorConfig: https://editorconfig.org/
2+
3+
root = true
4+
5+
[*]
6+
charset = utf-8
7+
end_of_line = lf
8+
indent_size = 2
9+
indent_style = space
10+
insert_final_newline = true
11+
tab_width = 2
12+
trim_trailing_whitespace = true

.github/workflows/ci.yml

Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches:
6+
- develop
7+
- main
8+
pull_request:
9+
branches:
10+
- develop
11+
- main
12+
13+
jobs:
14+
coverage:
15+
runs-on: ubuntu-latest
16+
steps:
17+
- name: Checkout
18+
uses: actions/checkout@v2
19+
- name: Install
20+
uses: ruby/setup-ruby@v1
21+
with:
22+
ruby-version: ruby-3.0
23+
bundler-cache: true
24+
- name: Test
25+
run: bundle exec rake
26+
- name: Upload
27+
uses: paambaati/codeclimate-action@v3.0.0
28+
env:
29+
CC_TEST_REPORTER_ID: cf390690a98dc04002844cd39dc93e82dad9c9f0f1f2f80b2dd148d5042ce345
30+
with:
31+
coverageLocations: ${{ github.workspace }}/spec/reports/coverage/coverage.xml:cobertura
32+
33+
lint:
34+
runs-on: ubuntu-latest
35+
steps:
36+
- name: Checkout
37+
uses: actions/checkout@v2
38+
- name: Install
39+
uses: ruby/setup-ruby@v1
40+
with:
41+
ruby-version: ruby-3.0
42+
bundler-cache: true
43+
- name: Lint
44+
run: bundle exec rubocop
45+
46+
test:
47+
strategy:
48+
matrix:
49+
os:
50+
# - macos-latest
51+
- ubuntu-latest
52+
ruby:
53+
- ruby-2.6
54+
- ruby-2.7
55+
- ruby-3.0
56+
# - jruby
57+
# - truffleruby
58+
runs-on: ${{ matrix.os }}
59+
steps:
60+
- name: Checkout
61+
uses: actions/checkout@v2
62+
- name: Install
63+
uses: ruby/setup-ruby@v1
64+
with:
65+
ruby-version: ${{ matrix.ruby }}
66+
bundler-cache: true
67+
- name: Test
68+
run: bundle exec rake

.gitignore

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
/[._]*/
2+
/doc/
3+
/pkg/
4+
/spec/reports/
5+
/tmp/
6+
/vendor/
7+
*.a
8+
*.bundle
9+
*.gem
10+
*.lock
11+
*.o
12+
*.rbc
13+
*.so
14+
mkmf.log

.rspec

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
--require spec_helper

.rubocop.yml

Lines changed: 171 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,171 @@
1+
require:
2+
- rubocop-performance
3+
- rubocop-rake
4+
- rubocop-rspec
5+
6+
AllCops:
7+
TargetRubyVersion: 2.6
8+
Exclude:
9+
- bin/**/*
10+
- vendor/**/*
11+
NewCops: enable
12+
13+
Layout/ArgumentAlignment:
14+
EnforcedStyle: with_fixed_indentation
15+
16+
Layout/BlockAlignment:
17+
EnforcedStyleAlignWith: start_of_block
18+
19+
Layout/CaseIndentation:
20+
# Disabled because IndentOneStep can't be configured for one-liner cases.
21+
# See: https://github.com/rubocop-hq/rubocop/issues/6447
22+
Enabled: false
23+
24+
Layout/ClassStructure:
25+
Enabled: true
26+
27+
Layout/EndAlignment:
28+
EnforcedStyleAlignWith: variable
29+
30+
Layout/ExtraSpacing:
31+
AllowForAlignment: false
32+
AllowBeforeTrailingComments: false
33+
ForceEqualSignAlignment: false
34+
35+
Layout/FirstArgumentIndentation:
36+
EnforcedStyle: consistent
37+
38+
Layout/FirstArrayElementIndentation:
39+
EnforcedStyle: consistent
40+
41+
Layout/FirstArrayElementLineBreak:
42+
Enabled: true
43+
44+
Layout/FirstHashElementIndentation:
45+
EnforcedStyle: consistent
46+
47+
Layout/FirstHashElementLineBreak:
48+
Enabled: true
49+
50+
Layout/FirstMethodArgumentLineBreak:
51+
Enabled: false
52+
53+
Layout/FirstMethodParameterLineBreak:
54+
Enabled: true
55+
56+
Layout/HeredocArgumentClosingParenthesis:
57+
Enabled: true
58+
59+
Layout/LineLength:
60+
Max: 80
61+
62+
Layout/MultilineArrayLineBreaks:
63+
Enabled: true
64+
65+
Layout/MultilineHashKeyLineBreaks:
66+
Enabled: true
67+
68+
Layout/MultilineMethodArgumentLineBreaks:
69+
Enabled: true
70+
71+
# Layout/MultilineMethodCallBraceLayout:
72+
# EnforcedStyle: new_line
73+
74+
Layout/MultilineMethodCallIndentation:
75+
EnforcedStyle: indented
76+
77+
Layout/MultilineMethodDefinitionBraceLayout:
78+
EnforcedStyle: new_line
79+
80+
Layout/MultilineOperationIndentation:
81+
EnforcedStyle: indented
82+
83+
Layout/ParameterAlignment:
84+
EnforcedStyle: with_fixed_indentation
85+
86+
Lint/DuplicateBranch:
87+
Enabled: true
88+
89+
Lint/DuplicateRegexpCharacterClassElement:
90+
Enabled: true
91+
92+
Lint/EmptyBlock:
93+
Enabled: true
94+
AllowComments: true
95+
96+
Lint/EmptyClass:
97+
Enabled: true
98+
AllowComments: true
99+
100+
Lint/HeredocMethodCallPosition:
101+
Enabled: true
102+
103+
Lint/NoReturnInBeginEndBlocks:
104+
Enabled: true
105+
106+
Metrics/BlockLength:
107+
CountAsOne:
108+
- array
109+
- hash
110+
- heredoc
111+
Exclude:
112+
- "*.gemspec"
113+
- spec/**/*_spec.rb
114+
115+
Metrics/ClassLength:
116+
CountAsOne:
117+
- array
118+
- hash
119+
- heredoc
120+
Max: 120
121+
122+
Metrics/CyclomaticComplexity:
123+
Max: 10
124+
125+
Metrics/MethodLength:
126+
CountAsOne:
127+
- array
128+
- hash
129+
- heredoc
130+
Max: 20
131+
132+
Metrics/ModuleLength:
133+
CountAsOne:
134+
- array
135+
- hash
136+
- heredoc
137+
138+
Metrics/ParameterLists:
139+
Max: 10
140+
141+
RSpec/MultipleMemoizedHelpers:
142+
Max: 10
143+
144+
RSpec/NestedGroups:
145+
Max: 8
146+
147+
Style/BlockDelimiters:
148+
EnforcedStyle: semantic
149+
AllowBracesOnProceduralOneLiners: true
150+
151+
Style/StringLiterals:
152+
EnforcedStyle: double_quotes
153+
ConsistentQuotesInMultiline: true
154+
155+
Style/StringLiteralsInInterpolation:
156+
EnforcedStyle: double_quotes
157+
158+
Style/SymbolArray:
159+
EnforcedStyle: brackets
160+
161+
Style/TrailingCommaInArguments:
162+
EnforcedStyleForMultiline: comma
163+
164+
Style/TrailingCommaInArrayLiteral:
165+
EnforcedStyleForMultiline: comma
166+
167+
Style/TrailingCommaInHashLiteral:
168+
EnforcedStyleForMultiline: comma
169+
170+
Style/WordArray:
171+
EnforcedStyle: brackets

CHANGELOG.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# Changelog
2+
3+
All notable changes to this project will be documented in this file.
4+
5+
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
6+
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7+
8+
## [Unreleased]

CONTRIBUTING.md

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
# Contributing
2+
3+
## Branches
4+
5+
This repository follows a modified version of the
6+
[Gitflow Workflow](https://www.atlassian.com/git/tutorials/comparing-workflows/gitflow-workflow):
7+
* The default development branch is `develop`.
8+
* The main release branch is `main`.
9+
10+
## Development
11+
12+
### Setup
13+
14+
Run `bin/setup` to install dependencies.
15+
16+
### Console
17+
18+
Run `bin/console` for an interactive prompt that will allow you to experiment.
19+
20+
### Test
21+
22+
Run `bin/test` to run the tests.
23+
24+
### Install
25+
26+
Run `bin/rake install` to install this gem onto your local machine.
27+
28+
## Releases
29+
30+
Releases are created automatically by continuous deployment.
31+
32+
***Please avoid creating releases manually.***
33+
34+
To create a new release:
35+
1. Checkout a new branch from `develop`:
36+
```sh
37+
git fetch origin develop
38+
git checkout -b release-x.y.z origin/develop
39+
```
40+
1. Update the version number:
41+
```sh
42+
bin/version x.y.z
43+
bin/setup
44+
```
45+
1. Update the changelog:
46+
- add mising entries
47+
- move `[Unreleased]` to `[x.y.z] - YYYY-MM-DD`
48+
1. Commit the changes:
49+
```sh
50+
git commit -m 'vx.y.z'
51+
```
52+
1. Push the new branch:
53+
```sh
54+
git push -u origin head
55+
```
56+
1. Create a merge/pull request to `main`.
57+
58+
When the `main` branch is updated, continuous deployment will tag and push a new
59+
release.
60+
61+
Afterwards:
62+
1. Create a merge/pull request from `main` to `develop`.

Gemfile

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
# frozen_string_literal: true
2+
3+
source "https://rubygems.org"
4+
5+
gemspec
6+
7+
gem "bundler-audit"
8+
gem "debug", ">= 1"
9+
gem "rake"
10+
gem "rspec"
11+
gem "rspec_junit_formatter"
12+
gem "rubocop"
13+
gem "rubocop-performance"
14+
gem "rubocop-rake"
15+
gem "rubocop-rspec"
16+
gem "simplecov"
17+
gem "simplecov-cobertura"
18+
gem "yard"

LICENSE

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
The MIT License (MIT)
2+
3+
Copyright (c) 2021 Zach Gianos
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
13+
all 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
21+
THE SOFTWARE.

0 commit comments

Comments
 (0)