Skip to content

Commit

Permalink
Merge pull request #271 from mlibrary/2023-08-07-updates
Browse files Browse the repository at this point in the history
August 2023 dependency updates.
  • Loading branch information
niquerio authored Aug 22, 2023
2 parents 867755a + cb28c23 commit 5de8fa1
Show file tree
Hide file tree
Showing 11 changed files with 473 additions and 295 deletions.
25 changes: 25 additions & 0 deletions .github/pre-commit
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
#!/bin/sh
#
# An example hook script to verify what is about to be committed.
# Called by "git commit" with no arguments. The hook should
# exit with non-zero status after issuing an appropriate message if
# it wants to stop the commit.
#
# To enable this hook, rename this file to "pre-commit".
#!/bin/sh

set -e
rubyfiles=$(git diff --cached --name-only --diff-filter=ACM "*.rb" "Gemfile" | tr '\n' ' ')
[ -z "$rubyfiles" ] && exit 0

# Standardize all ruby files
echo "🧹 Formatting staged Ruby files using standardrb ($(echo $rubyfiles | wc -w | awk '{print $1}') total)"
echo "$rubyfiles" | xargs docker-compose run --rm web bundle exec standardrb --fix

# Add back the modified/prettified files to staging
echo "$rubyfiles" | xargs git add

echo "📋 Running tests with rspec"
docker-compose run --rm web bundle exec rspec --format progress

exit 0
2 changes: 1 addition & 1 deletion .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ jobs:
steps:
- uses: actions/checkout@v3
- name: Create .env file
run: cat .env-example .env-dev-values > .env
run: cat env.* > .env
- name: Load .env file
uses: xom9ikk/dotenv@v2
- name: Set up Ruby 3.2
Expand Down
53 changes: 28 additions & 25 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -11,20 +11,21 @@ GIT
GEM
remote: https://rubygems.org/
specs:
activemodel (7.0.6)
activesupport (= 7.0.6)
activesupport (7.0.6)
activemodel (7.0.7)
activesupport (= 7.0.7)
activesupport (7.0.7)
concurrent-ruby (~> 1.0, >= 1.0.2)
i18n (>= 1.6, < 2)
minitest (>= 5.1)
tzinfo (~> 2.0)
addressable (2.8.4)
addressable (2.8.5)
public_suffix (>= 2.0.2, < 6.0)
aes_key_wrap (1.1.0)
anyway_config (2.5.0)
ruby-next-core (>= 0.14.0)
ast (2.4.2)
attr_required (1.0.1)
base64 (0.1.1)
bindata (2.4.15)
byebug (11.1.3)
climate_control (1.2.0)
Expand Down Expand Up @@ -65,13 +66,13 @@ GEM
net-pop
net-smtp
method_source (1.0.0)
mini_mime (1.1.2)
minitest (5.18.1)
mini_mime (1.1.5)
minitest (5.19.0)
multi_json (1.15.0)
multi_xml (0.6.0)
mustermann (3.0.0)
ruby2_keywords (~> 0.0.1)
net-imap (0.3.6)
net-imap (0.3.7)
date
net-protocol
net-pop (0.1.2)
Expand Down Expand Up @@ -105,7 +106,7 @@ GEM
parser (3.2.2.3)
ast (~> 2.4.1)
racc
prometheus-client (4.2.0)
prometheus-client (4.2.1)
pry (0.14.2)
coderay (~> 1.1)
method_source (~> 1.0)
Expand All @@ -116,22 +117,22 @@ GEM
puma (6.3.0)
nio4r (~> 2.0)
racc (1.7.1)
rack (2.2.7)
rack (2.2.8)
rack-oauth2 (2.2.0)
activesupport
attr_required
faraday (~> 2.0)
faraday-follow_redirects
json-jwt (>= 1.11.0)
rack (>= 2.1.0)
rack-protection (3.0.6)
rack
rack-protection (3.1.0)
rack (~> 2.2, >= 2.2.4)
rack-test (2.1.0)
rack (>= 1.3)
rainbow (3.1.1)
redcarpet (3.6.0)
regexp_parser (2.8.1)
rexml (3.2.5)
rexml (3.2.6)
rspec (3.12.0)
rspec-core (~> 3.12.0)
rspec-expectations (~> 3.12.0)
Expand All @@ -145,19 +146,21 @@ GEM
diff-lcs (>= 1.2.0, < 2.0)
rspec-support (~> 3.12.0)
rspec-support (3.12.1)
rubocop (1.52.1)
rubocop (1.56.1)
base64 (~> 0.1.1)
json (~> 2.3)
language_server-protocol (>= 3.17.0)
parallel (~> 1.10)
parser (>= 3.2.2.3)
rainbow (>= 2.2.2, < 4.0)
regexp_parser (>= 1.8, < 3.0)
rexml (>= 3.2.5, < 4.0)
rubocop-ast (>= 1.28.0, < 2.0)
rubocop-ast (>= 1.28.1, < 2.0)
ruby-progressbar (~> 1.7)
unicode-display_width (>= 2.4.0, < 3.0)
rubocop-ast (1.29.0)
parser (>= 3.2.1.0)
rubocop-performance (1.18.0)
rubocop-performance (1.19.0)
rubocop (>= 1.7.0, < 2.0)
rubocop-ast (>= 0.4.0)
ruby-next-core (0.15.3)
Expand All @@ -169,31 +172,31 @@ GEM
simplecov_json_formatter (~> 0.1)
simplecov-html (0.12.3)
simplecov_json_formatter (0.1.4)
sinatra (3.0.6)
sinatra (3.1.0)
mustermann (~> 3.0)
rack (~> 2.2, >= 2.2.4)
rack-protection (= 3.0.6)
rack-protection (= 3.1.0)
tilt (~> 2.0)
sinatra-contrib (3.0.6)
sinatra-contrib (3.1.0)
multi_json
mustermann (~> 3.0)
rack-protection (= 3.0.6)
sinatra (= 3.0.6)
rack-protection (= 3.1.0)
sinatra (= 3.1.0)
tilt (~> 2.0)
sinatra-flash (0.3.0)
sinatra (>= 1.0.0)
standard (1.30.1)
standard (1.31.0)
language_server-protocol (~> 3.17.0.2)
lint_roller (~> 1.0)
rubocop (~> 1.52.0)
rubocop (~> 1.56.0)
standard-custom (~> 1.0.0)
standard-performance (~> 1.1.0)
standard-performance (~> 1.2)
standard-custom (1.0.2)
lint_roller (~> 1.0)
rubocop (~> 1.50)
standard-performance (1.1.1)
standard-performance (1.2.0)
lint_roller (~> 1.1)
rubocop-performance (~> 1.18.0)
rubocop-performance (~> 1.19.0)
swd (2.0.2)
activesupport (>= 3)
attr_required (>= 0.0.5)
Expand Down
27 changes: 2 additions & 25 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,36 +13,13 @@ git clone [email protected]:mlibrary/account.git
cd account
```

copy .env-example to .env

run the `init.sh` script.
```bash
cp .env-example .env
./init.sh
```

edit .env with the appropriate environment variables

build the containers

```bash
docker-compose build
```

bundle install
```bash
docker-compose run --rm web bundle install
```

npm install
```bash
docker-compose run --rm web npm install
```

build styles and scripts

```bash
docker-compose run --rm web npm run build
```

start containers

```bash
Expand Down
110 changes: 55 additions & 55 deletions account.rb
Original file line number Diff line number Diff line change
Expand Up @@ -12,61 +12,61 @@
# Monkey patch for omniauth_openid_connect -> openid_connect -> webfinger -> httpclient SSL errors
# require_relative "./lib/monkey_httpclient"

require_relative "./lib/entities/entities"
require_relative "./lib/entities/pages"
require_relative "./lib/entities/empty_state"

require_relative "./lib/navigation/navigation"
require_relative "./lib/navigation/page"
require_relative "./lib/navigation/horizontal_nav"
require_relative "./lib/navigation/sidebar"
require_relative "./lib/navigation/user_dropdown"
require_relative "./lib/navigation/title"
require_relative "./lib/navigation/description"

require_relative "./lib/utility"
require_relative "./lib/illiad_client"
require_relative "./lib/circ_history_client"
require_relative "./lib/table_controls"
require_relative "./lib/pagination/pagination"
require_relative "./lib/pagination/pagination_decorator"
require_relative "./lib/circulation_history_settings_text"

require_relative "./models/illiad_patron"
require_relative "./models/patron"
require_relative "./models/session_patron"

require_relative "./models/response/response"
require_relative "./models/response/renew_response_presenter"

require_relative "./models/fines/nelnet"
require_relative "./models/fines/fines"
require_relative "./models/fines/receipt"

require_relative "./models/items/items"
require_relative "./models/items/item"

require_relative "./models/items/alma/alma_item"
require_relative "./models/items/alma/loans"
require_relative "./models/items/alma/requests"

require_relative "./models/items/circ_history/circ_history_item"
require_relative "./models/items/interlibrary_loan/interlibrary_loan_item"
require_relative "./models/items/interlibrary_loan/interlibrary_loan_items"
require_relative "./models/items/interlibrary_loan/document_delivery"
require_relative "./models/items/interlibrary_loan/interlibrary_loans"
require_relative "./models/items/interlibrary_loan/interlibrary_loan_requests"
require_relative "./models/items/interlibrary_loan/past_document_delivery"
require_relative "./models/items/interlibrary_loan/past_interlibrary_loans"
require_relative "./models/items/interlibrary_loan/pending_document_delivery"

require_relative "./lib/routes/auth"
require_relative "./lib/routes/monitoring"
require_relative "./lib/routes/current_checkouts"
require_relative "./lib/routes/pending_requests"
require_relative "./lib/routes/past_activity"
require_relative "./lib/routes/settings"
require_relative "./lib/routes/fines_and_fees"
require_relative "lib/entities/entities"
require_relative "lib/entities/pages"
require_relative "lib/entities/empty_state"

require_relative "lib/navigation/navigation"
require_relative "lib/navigation/page"
require_relative "lib/navigation/horizontal_nav"
require_relative "lib/navigation/sidebar"
require_relative "lib/navigation/user_dropdown"
require_relative "lib/navigation/title"
require_relative "lib/navigation/description"

require_relative "lib/utility"
require_relative "lib/illiad_client"
require_relative "lib/circ_history_client"
require_relative "lib/table_controls"
require_relative "lib/pagination/pagination"
require_relative "lib/pagination/pagination_decorator"
require_relative "lib/circulation_history_settings_text"

require_relative "models/illiad_patron"
require_relative "models/patron"
require_relative "models/session_patron"

require_relative "models/response/response"
require_relative "models/response/renew_response_presenter"

require_relative "models/fines/nelnet"
require_relative "models/fines/fines"
require_relative "models/fines/receipt"

require_relative "models/items/items"
require_relative "models/items/item"

require_relative "models/items/alma/alma_item"
require_relative "models/items/alma/loans"
require_relative "models/items/alma/requests"

require_relative "models/items/circ_history/circ_history_item"
require_relative "models/items/interlibrary_loan/interlibrary_loan_item"
require_relative "models/items/interlibrary_loan/interlibrary_loan_items"
require_relative "models/items/interlibrary_loan/document_delivery"
require_relative "models/items/interlibrary_loan/interlibrary_loans"
require_relative "models/items/interlibrary_loan/interlibrary_loan_requests"
require_relative "models/items/interlibrary_loan/past_document_delivery"
require_relative "models/items/interlibrary_loan/past_interlibrary_loans"
require_relative "models/items/interlibrary_loan/pending_document_delivery"

require_relative "lib/routes/auth"
require_relative "lib/routes/monitoring"
require_relative "lib/routes/current_checkouts"
require_relative "lib/routes/pending_requests"
require_relative "lib/routes/past_activity"
require_relative "lib/routes/settings"
require_relative "lib/routes/fines_and_fees"

helpers StyledFlash

Expand Down
4 changes: 2 additions & 2 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ services:
- gem_cache:/gems
env_file:
- .env
- .env-dev-values
- env.development

nelnet-test:
build: ./nelnet_test/.
Expand All @@ -22,7 +22,7 @@ services:
volumes:
- ./nelnet_test/.:/app
env_file:
- .env-dev-values
- env.development

circulation-history:
image: ghcr.io/mlibrary/circulation_history_unstable:latest
Expand Down
File renamed without changes.
1 change: 1 addition & 0 deletions .env-example → env.example
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,4 @@ WEBLOGIN_SECRET='YOUR-WEBLOGIN-SECRET'
NELNET_SECRET_KEY='YOUR-NELNET-SECRET-KEY'
NELNET_PAYMENT_URL='https://nelnet-api-host.com'
WEBLOGIN_ON=false
APP_ENV='development'
28 changes: 28 additions & 0 deletions init.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
#!/bin/bash

#must be run from the project root directory
if [ -f ".env" ]; then
echo "🌎 .env exists. Leaving alone"
else
echo "🌎 .env does not exist. Copying env.example to .env"
cp env.example .env
fi

if [ -f ".git/hooks/pre-commit" ]; then
echo "🪝 .git/hooks/pre-commit exists. Leaving alone"
else
echo " 🪝 .git/hooks/pre-commit does not exist. Copying .github/pre-commit to .git/hooks/"
cp .github/pre-commit .git/hooks/pre-commit
fi

echo "🚢 Build docker images"
docker-compose build

echo "📦 Installing Gems"
docker-compose run --rm web bundle

echo "📦 Installing Node modules"
docker-compose run --rm web npm install

echo "📦 Building js and css"
docker-compose run --rm web npm run build
Loading

0 comments on commit 5de8fa1

Please sign in to comment.