Skip to content

Commit 83a5527

Browse files
committed
🎨 Modernize Codebase
1 parent 5b2b0a5 commit 83a5527

158 files changed

Lines changed: 9779 additions & 287 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
{
2+
"name": "Apt Install Packages",
3+
"id": "apt-install",
4+
"version": "1.0.0",
5+
"description": "More packages are needed",
6+
"install": {
7+
"script": "install.sh"
8+
}
9+
}
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
#!/bin/sh
2+
apt-get update -y
3+
apt-get install -y direnv default-jdk postgresql libpq-dev git zlib1g-dev build-essential libssl-dev libreadline-dev libyaml-dev libsqlite3-dev sqlite3 libxml2-dev libxslt1-dev libcurl4-openssl-dev software-properties-common libffi-dev
4+
# Adds the direnv setup script to ~/.bashrc file (at the end)
5+
echo 'eval "$(direnv hook bash)"' >> ~/.bashrc

.devcontainer/devcontainer.json

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
// For format details, see https://aka.ms/devcontainer.json. For config options, see the
2+
// README at: https://github.com/devcontainers/templates/tree/main/src/ruby
3+
{
4+
"name": "Ruby",
5+
// Or use a Dockerfile or Docker Compose file. More info: https://containers.dev/guide/dockerfile
6+
"image": "mcr.microsoft.com/devcontainers/ruby:1-3-bookworm",
7+
8+
// Features to add to the dev container. More info: https://containers.dev/features.
9+
"features": {
10+
"./apt-install": {}
11+
},
12+
13+
// Use 'forwardPorts' to make a list of ports inside the container available locally.
14+
// "forwardPorts": [],
15+
16+
// Use 'postCreateCommand' to run commands after the container is created.
17+
"postCreateCommand": "bundle update --bundler",
18+
19+
// Configure tool-specific properties.
20+
"customizations" : {
21+
"jetbrains" : {
22+
"backend" : "RubyMine"
23+
}
24+
},
25+
26+
// Uncomment to connect as root instead. More info: https://aka.ms/dev-containers-non-root.
27+
// "remoteUser": "root"
28+
}

.envrc

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
# Run any command in this library's bin/ without the bin/ prefix!
2+
PATH_add bin
3+
4+
# Only add things to this file that should be shared with the team.
5+
6+
# **dotenv** (See end of file for .env.local integration)
7+
# .env would override anything in this file, if enabled.
8+
# .env is a DOCKER standard, and if we use it, it would be in deployed, or DOCKER, environments.
9+
# Override and customize anything below in your own .env.local
10+
# If you are using dotenv and not direnv,
11+
# copy the following `export` statements to your own .env file.
12+
13+
### General Ruby ###
14+
# Turn off Ruby Warnings about deprecated code
15+
# export RUBYOPT="-W0"
16+
17+
### External Testing Controls
18+
export K_SOUP_COV_DO=true # Means you want code coverage
19+
# Available formats are html, xml, rcov, lcov, json, tty
20+
export K_SOUP_COV_COMMAND_NAME="RSpec Coverage"
21+
export K_SOUP_COV_FORMATTERS="html,tty"
22+
export K_SOUP_COV_MIN_BRANCH=11 # Means you want to enforce X% branch coverage
23+
export K_SOUP_COV_MIN_LINE=61 # Means you want to enforce X% line coverage
24+
export K_SOUP_COV_MIN_HARD=true # Means you want the build to fail if the coverage thresholds are not met
25+
export K_SOUP_COV_MULTI_FORMATTERS=true
26+
export MAX_ROWS=1 # Setting for simplecov-console gem for tty output, limits to the worst N rows of bad coverage
27+
28+
# Internal Debugging Controls
29+
export DEBUG=false # do not allow byebug statements (override in .env.local)
30+
31+
# .env would override anything in this file, if `dotenv` is uncommented below.
32+
# .env is a DOCKER standard, and if we use it, it would be in deployed, or DOCKER, environments,
33+
# and that is why we generally want to leave it commented out.
34+
# dotenv
35+
36+
# .env.local will override anything in this file.
37+
dotenv_if_exists .env.local

.github/dependabot.yml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
version: 2
2+
updates:
3+
- package-ecosystem: bundler
4+
directory: "/"
5+
schedule:
6+
interval: "daily"
7+
open-pull-requests-limit: 10
8+
ignore:
9+
- dependency-name: "rubocop-lts"
10+
- package-ecosystem: "github-actions"
11+
directory: "/"
12+
schedule:
13+
interval: "daily"

.github/workflows/ancient.yml

Lines changed: 144 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,144 @@
1+
name: MRI 2.4, 2.5 (Ancient)
2+
3+
permissions:
4+
contents: read
5+
6+
env:
7+
K_SOUP_COV_DO: false
8+
9+
on:
10+
push:
11+
branches:
12+
- 'main'
13+
tags:
14+
- '!*' # Do not execute on tags
15+
pull_request:
16+
branches:
17+
- '*'
18+
# Allow manually triggering the workflow.
19+
workflow_dispatch:
20+
21+
# Cancels all previous workflow runs for the same branch that have not yet completed.
22+
concurrency:
23+
# The concurrency group contains the workflow name and the branch name.
24+
group: "${{ github.workflow }}-${{ github.ref }}"
25+
cancel-in-progress: true
26+
27+
jobs:
28+
test:
29+
name: Specs ${{ matrix.ruby }} ${{ matrix.appraisal_name }}${{ matrix.name_extra || '' }}
30+
if: "!contains(github.event.commits[0].message, '[ci skip]') && !contains(github.event.commits[0].message, '[skip ci]')"
31+
runs-on: ubuntu-22.04
32+
continue-on-error: ${{ matrix.experimental || endsWith(matrix.ruby, 'head') }}
33+
env: # $BUNDLE_GEMFILE must be set at job level, so it is set for all steps
34+
BUNDLE_GEMFILE: ${{ github.workspace }}/${{ matrix.gemfile }}.gemfile
35+
strategy:
36+
fail-fast: false
37+
matrix:
38+
include:
39+
# Ruby 2.4
40+
- ruby: "2.4"
41+
appraisal_name: "omniauth-v1.1-r2.4"
42+
exec_cmd: "rake spec"
43+
gemfile: "Appraisal.root"
44+
rubygems: "3.3.27"
45+
bundler: "2.3.27"
46+
47+
# Ruby 2.5
48+
- ruby: "2.5"
49+
appraisal_name: "omniauth-v1.2-r2"
50+
exec_cmd: "rake spec"
51+
gemfile: "Appraisal.root"
52+
rubygems: "3.3.27"
53+
bundler: "2.3.27"
54+
- ruby: "2.5"
55+
appraisal_name: "omniauth-v1.3-r2"
56+
exec_cmd: "rake spec"
57+
gemfile: "Appraisal.root"
58+
rubygems: "3.3.27"
59+
bundler: "2.3.27"
60+
- ruby: "2.5"
61+
appraisal_name: "omniauth-v1.4-r2"
62+
exec_cmd: "rake spec"
63+
gemfile: "Appraisal.root"
64+
rubygems: "3.3.27"
65+
bundler: "2.3.27"
66+
- ruby: "2.5"
67+
appraisal_name: "omniauth-v1.5-r2"
68+
exec_cmd: "rake spec"
69+
gemfile: "Appraisal.root"
70+
rubygems: "3.3.27"
71+
bundler: "2.3.27"
72+
- ruby: "2.5"
73+
appraisal_name: "omniauth-v1.6-r2"
74+
exec_cmd: "rake spec"
75+
gemfile: "Appraisal.root"
76+
rubygems: "3.3.27"
77+
bundler: "2.3.27"
78+
- ruby: "2.5"
79+
appraisal_name: "omniauth-v1.7-r2"
80+
exec_cmd: "rake spec"
81+
gemfile: "Appraisal.root"
82+
rubygems: "3.3.27"
83+
bundler: "2.3.27"
84+
- ruby: "2.5"
85+
appraisal_name: "omniauth-v1.8-r2"
86+
exec_cmd: "rake spec"
87+
gemfile: "Appraisal.root"
88+
rubygems: "3.3.27"
89+
bundler: "2.3.27"
90+
- ruby: "2.5"
91+
appraisal_name: "omniauth-v1.9-r2"
92+
exec_cmd: "rake spec"
93+
gemfile: "Appraisal.root"
94+
rubygems: "3.3.27"
95+
bundler: "2.3.27"
96+
- ruby: "2.5"
97+
appraisal_name: "omniauth-v2.0-r2"
98+
exec_cmd: "rake spec"
99+
gemfile: "Appraisal.root"
100+
rubygems: "3.3.27"
101+
bundler: "2.3.27"
102+
103+
steps:
104+
### COUCHDB
105+
- name: Start CouchDB
106+
uses: iamssen/couchdb-github-action@master
107+
if: "endsWith(matrix.exec_cmd, 'couch_potato')"
108+
with:
109+
couchdb-version: "3.4.1"
110+
111+
### MONGODB
112+
- name: Start MongoDB
113+
uses: supercharge/mongodb-github-action@1.12.0
114+
if: "endsWith(matrix.exec_cmd, 'mongoid')"
115+
with:
116+
mongodb-version: "8.0"
117+
118+
### SMOKE-TEST
119+
- name: Smoke CouchDB
120+
if: "endsWith(matrix.exec_cmd, 'couch_potato')"
121+
run: |
122+
curl -f http://127.0.0.1:5984/
123+
curl -X POST -H "Content-Type: application/json; charset=utf-8" -d '{"name": "admin", "password": "password"}' http://127.0.0.1:5984/_session
124+
125+
- name: Checkout
126+
uses: actions/checkout@v4
127+
128+
- name: Setup Ruby & RubyGems
129+
uses: ruby/setup-ruby@v1
130+
with:
131+
ruby-version: ${{ matrix.ruby }}
132+
rubygems: ${{ matrix.rubygems }}
133+
bundler: ${{ matrix.bundler }}
134+
bundler-cache: false
135+
136+
# Raw `bundle` will use the BUNDLE_GEMFILE set to matrix.gemfile (i.e. Appraisal.root)
137+
# We need to do this first to get appraisal installed.
138+
# NOTE: This does not use the main Gemfile at all.
139+
- name: Install Root Appraisal
140+
run: bundle
141+
- name: Appraisal for ${{ matrix.ruby }}@${{ matrix.appraisal_name }}
142+
run: bundle exec appraisal ${{ matrix.appraisal_name }} bundle
143+
- name: Run ${{ matrix.exec_cmd }} on ${{ matrix.ruby }}@${{ matrix.appraisal_name }}
144+
run: bundle exec appraisal ${{ matrix.appraisal_name }} bundle exec ${{ matrix.exec_cmd }}
Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
# For most projects, this workflow file will not need changing; you simply need
2+
# to commit it to your repository.
3+
#
4+
# You may wish to alter this file to override the set of languages analyzed,
5+
# or to provide custom queries or build logic.
6+
#
7+
# ******** NOTE ********
8+
# We have attempted to detect the languages in your repository. Please check
9+
# the `language` matrix defined below to confirm you have the correct set of
10+
# supported CodeQL languages.
11+
#
12+
name: "CodeQL"
13+
14+
on:
15+
push:
16+
branches: [ main, "*-stable" ]
17+
pull_request:
18+
# The branches below must be a subset of the branches above
19+
branches: [ main, "*-stable" ]
20+
schedule:
21+
- cron: '35 1 * * 5'
22+
23+
jobs:
24+
analyze:
25+
name: Analyze
26+
runs-on: ubuntu-latest
27+
permissions:
28+
actions: read
29+
contents: read
30+
security-events: write
31+
32+
strategy:
33+
fail-fast: false
34+
matrix:
35+
language: [ 'ruby' ]
36+
# CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python', 'ruby' ]
37+
# Learn more about CodeQL language support at https://git.io/codeql-language-support
38+
39+
steps:
40+
- name: Checkout repository
41+
uses: actions/checkout@v4
42+
43+
# Initializes the CodeQL tools for scanning.
44+
- name: Initialize CodeQL
45+
uses: github/codeql-action/init@v3
46+
with:
47+
languages: ${{ matrix.language }}
48+
# If you wish to specify custom queries, you can do so here or in a config file.
49+
# By default, queries listed here will override any specified in a config file.
50+
# Prefix the list here with "+" to use these queries and those in the config file.
51+
# queries: ./path/to/local/query, your-org/your-repo/queries@main
52+
53+
# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
54+
# If this step fails, then you should remove it and run the build manually (see below)
55+
- name: Autobuild
56+
uses: github/codeql-action/autobuild@v3
57+
58+
# ℹ️ Command-line programs to run using the OS shell.
59+
# 📚 https://git.io/JvXDl
60+
61+
# ✏️ If the Autobuild fails above, remove it and uncomment the following three lines
62+
# and modify them (or add more) to build your code if your project
63+
# uses a compiled language
64+
65+
#- run: |
66+
# make bootstrap
67+
# make release
68+
69+
- name: Perform CodeQL Analysis
70+
uses: github/codeql-action/analyze@v3

0 commit comments

Comments
 (0)