Skip to content

Commit d1c9804

Browse files
authored
Update supported ruby versions (#211)
* Update supported ruby versions * add solargraph * add github actions for tests * Add Gemfile.lock back to repo as this is modern best practice * update codeclimate config * Update formatting of readme
1 parent 31c30b2 commit d1c9804

11 files changed

Lines changed: 384 additions & 169 deletions

File tree

.codeclimate.yml

Lines changed: 32 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,32 @@
1-
---
2-
engines:
3-
bundler-audit:
4-
enabled: false
5-
csslint:
6-
enabled: false
7-
duplication:
8-
enabled: true
9-
config:
10-
languages:
11-
- ruby
12-
eslint:
13-
enabled: false
14-
fixme:
15-
enabled: true
16-
rubocop:
17-
enabled: true
18-
channel: rubocop-0-63
19-
ratings:
20-
paths:
21-
- "**.rb"
22-
exclude_paths:
23-
- ruby-units.gemspec
24-
- bin/
25-
- spec/
1+
version: "2" # required to adjust maintainability checks
2+
checks:
3+
argument-count:
4+
config:
5+
threshold: 4
6+
complex-logic:
7+
config:
8+
threshold: 4
9+
file-lines:
10+
config:
11+
threshold: 250
12+
method-complexity:
13+
config:
14+
threshold: 5
15+
method-count:
16+
config:
17+
threshold: 20
18+
method-lines:
19+
config:
20+
threshold: 25
21+
nested-control-flow:
22+
config:
23+
threshold: 4
24+
return-statements:
25+
config:
26+
threshold: 4
27+
similar-code:
28+
config:
29+
threshold: # language-specific defaults. an override will affect all languages.
30+
identical-code:
31+
config:
32+
threshold: # language-specific defaults. an override will affect all languages.

.github/workflows/tests.yml

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
name: Tests
2+
3+
on:
4+
push:
5+
branches: [ master ]
6+
pull_request:
7+
branches: [ master ]
8+
workflow_dispatch:
9+
schedule:
10+
# 00:00 on the 1st of every month
11+
- cron: '0 0 1 * *'
12+
jobs:
13+
test:
14+
runs-on: ubuntu-latest
15+
strategy:
16+
fail-fast: false
17+
matrix:
18+
ruby: ['2.5', '2.6', '2.7', '3.0', 'jruby-9.2']
19+
steps:
20+
- uses: actions/checkout@v2
21+
- uses: ruby/setup-ruby@v1
22+
with:
23+
ruby-version: ${{ matrix.ruby }}
24+
bundler-cache: true
25+
- name: Tests for Ruby ${{ matrix.ruby }}
26+
run: bundle exec rake
27+
coverage:
28+
needs: test
29+
runs-on: ubuntu-latest
30+
steps:
31+
- uses: actions/checkout@v2
32+
- uses: ruby/setup-ruby@v1
33+
with:
34+
bundler-cache: true
35+
- name: Publish code coverage
36+
uses: paambaati/codeclimate-action@v2.7.5
37+
env:
38+
CC_TEST_REPORTER_ID: ${{ secrets.CC_TEST_REPORTER_ID }}
39+
with:
40+
coverageCommand: bundle exec rake

.gitignore

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,3 @@
99
/bin/
1010
# rspec failure tracking
1111
.rspec_status
12-
13-
# don't check in Gemfile.lock for a gem
14-
Gemfile.lock

.rubocop.yml

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,17 @@
1+
require:
2+
- rubocop-rake
3+
- rubocop-rspec
4+
15
AllCops:
2-
TargetRubyVersion: 2.3
6+
NewCops: enable
37
Exclude:
48
- ruby-units.gemspec
59
- bin/*
610
Style/CaseEquality:
711
Enabled: false
812
Style/FrozenStringLiteralComment:
913
Enabled: false
10-
Metrics/LineLength:
14+
Layout/LineLength:
1115
Enabled: false
1216
Style/SingleLineBlockParams:
1317
Enabled: false

.ruby-version

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1 @@
1-
2.3
2-
1+
2.5.8

.solargraph.yml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
---
2+
include:
3+
- "**/*.rb"
4+
exclude:
5+
- spec/**/*
6+
- test/**/*
7+
- vendor/**/*
8+
- ".bundle/**/*"
9+
require: []
10+
domains: []
11+
reporters:
12+
- rubocop
13+
- require_not_found
14+
require_paths: []
15+
plugins: []
16+
max_files: 5000

.travis.yml

Lines changed: 0 additions & 28 deletions
This file was deleted.

Gemfile

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,4 @@ group :development do
66
gem 'ruby-prof', platform: :mri
77
end
88

9-
# This is a minimal set of Gems required to build on travis
10-
group :test do
11-
gem 'bundler'
12-
gem 'rake'
13-
gem 'rspec'
14-
gem 'simplecov'
15-
end
16-
179
gemspec

Gemfile.lock

Lines changed: 164 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,164 @@
1+
PATH
2+
remote: .
3+
specs:
4+
ruby-units (2.3.1)
5+
6+
GEM
7+
remote: https://rubygems.org/
8+
specs:
9+
ast (2.4.1)
10+
backport (1.1.2)
11+
benchmark (0.1.1)
12+
byebug (11.1.3)
13+
coderay (1.1.3)
14+
diff-lcs (1.4.4)
15+
docile (1.3.4)
16+
e2mmap (0.1.0)
17+
ffi (1.14.2)
18+
ffi (1.14.2-java)
19+
formatador (0.2.5)
20+
guard (2.16.2)
21+
formatador (>= 0.2.4)
22+
listen (>= 2.7, < 4.0)
23+
lumberjack (>= 1.0.12, < 2.0)
24+
nenv (~> 0.1)
25+
notiffany (~> 0.0)
26+
pry (>= 0.9.12)
27+
shellany (~> 0.0)
28+
thor (>= 0.18.1)
29+
guard-compat (1.2.1)
30+
guard-rspec (4.7.3)
31+
guard (~> 2.1)
32+
guard-compat (~> 1.1)
33+
rspec (>= 2.99.0, < 4.0)
34+
jaro_winkler (1.5.4)
35+
jaro_winkler (1.5.4-java)
36+
kramdown (2.3.0)
37+
rexml
38+
kramdown-parser-gfm (1.1.0)
39+
kramdown (~> 2.0)
40+
listen (3.3.3)
41+
rb-fsevent (~> 0.10, >= 0.10.3)
42+
rb-inotify (~> 0.9, >= 0.9.10)
43+
lumberjack (1.2.8)
44+
method_source (1.0.0)
45+
mini_portile2 (2.4.0)
46+
nenv (0.3.0)
47+
nokogiri (1.10.10)
48+
mini_portile2 (~> 2.4.0)
49+
nokogiri (1.10.10-java)
50+
notiffany (0.1.3)
51+
nenv (~> 0.1)
52+
shellany (~> 0.0)
53+
parallel (1.20.1)
54+
parser (2.7.2.0)
55+
ast (~> 2.4.1)
56+
pry (0.13.1)
57+
coderay (~> 1.1)
58+
method_source (~> 1.0)
59+
pry (0.13.1-java)
60+
coderay (~> 1.1)
61+
method_source (~> 1.0)
62+
spoon (~> 0.0)
63+
pry-byebug (3.9.0)
64+
byebug (~> 11.0)
65+
pry (~> 0.13.0)
66+
rainbow (3.0.0)
67+
rake (13.0.3)
68+
rb-fsevent (0.10.4)
69+
rb-inotify (0.10.1)
70+
ffi (~> 1.0)
71+
regexp_parser (2.0.3)
72+
reverse_markdown (2.0.0)
73+
nokogiri
74+
rexml (3.2.4)
75+
rspec (3.10.0)
76+
rspec-core (~> 3.10.0)
77+
rspec-expectations (~> 3.10.0)
78+
rspec-mocks (~> 3.10.0)
79+
rspec-core (3.10.1)
80+
rspec-support (~> 3.10.0)
81+
rspec-expectations (3.10.1)
82+
diff-lcs (>= 1.2.0, < 2.0)
83+
rspec-support (~> 3.10.0)
84+
rspec-mocks (3.10.1)
85+
diff-lcs (>= 1.2.0, < 2.0)
86+
rspec-support (~> 3.10.0)
87+
rspec-support (3.10.1)
88+
rubocop (1.7.0)
89+
parallel (~> 1.10)
90+
parser (>= 2.7.1.5)
91+
rainbow (>= 2.2.2, < 4.0)
92+
regexp_parser (>= 1.8, < 3.0)
93+
rexml
94+
rubocop-ast (>= 1.2.0, < 2.0)
95+
ruby-progressbar (~> 1.7)
96+
unicode-display_width (>= 1.4.0, < 2.0)
97+
rubocop-ast (1.3.0)
98+
parser (>= 2.7.1.5)
99+
rubocop-rake (0.5.1)
100+
rubocop
101+
rubocop-rspec (2.1.0)
102+
rubocop (~> 1.0)
103+
rubocop-ast (>= 1.1.0)
104+
ruby-maven (3.3.12)
105+
ruby-maven-libs (~> 3.3.9)
106+
ruby-maven-libs (3.3.9)
107+
ruby-prof (1.4.2)
108+
ruby-progressbar (1.10.1)
109+
shellany (0.0.1)
110+
simplecov (0.20.0)
111+
docile (~> 1.1)
112+
simplecov-html (~> 0.11)
113+
simplecov_json_formatter (~> 0.1)
114+
simplecov-html (0.12.3)
115+
simplecov_json_formatter (0.1.2)
116+
solargraph (0.40.1)
117+
backport (~> 1.1)
118+
benchmark
119+
bundler (>= 1.17.2)
120+
e2mmap
121+
jaro_winkler (~> 1.5)
122+
kramdown (~> 2.3)
123+
kramdown-parser-gfm (~> 1.1)
124+
parser (~> 2.3)
125+
reverse_markdown (>= 1.0.5, < 3)
126+
rubocop (>= 0.52)
127+
thor (~> 1.0)
128+
tilt (~> 2.0)
129+
yard (~> 0.9, >= 0.9.24)
130+
spoon (0.0.6)
131+
ffi
132+
terminal-notifier (2.0.0)
133+
terminal-notifier-guard (1.7.0)
134+
thor (1.0.1)
135+
tilt (2.0.10)
136+
unicode-display_width (1.7.0)
137+
yard (0.9.26)
138+
139+
PLATFORMS
140+
java
141+
ruby
142+
universal-java-11
143+
x86_64-darwin-19
144+
145+
DEPENDENCIES
146+
guard-rspec
147+
pry
148+
pry-byebug
149+
rake
150+
rspec (~> 3.0)
151+
rubocop
152+
rubocop-rake
153+
rubocop-rspec
154+
ruby-maven
155+
ruby-prof
156+
ruby-units!
157+
simplecov
158+
simplecov-html
159+
solargraph
160+
terminal-notifier
161+
terminal-notifier-guard
162+
163+
BUNDLED WITH
164+
2.2.3

0 commit comments

Comments
 (0)