Skip to content

Commit

Permalink
Merge pull request #33 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 0ce1006 + 85b5a82 commit 30ffc9d
Show file tree
Hide file tree
Showing 11 changed files with 141 additions and 107 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
67 changes: 35 additions & 32 deletions Gemfile.lock
Original file line number Diff line number Diff line change
@@ -1,20 +1,21 @@
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.4.2)
anyway_config (2.5.1)
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 All @@ -38,7 +39,7 @@ GEM
hashdiff (1.0.1)
hashie (5.0.0)
http-2-next (0.5.1)
httpx (0.24.1)
httpx (0.24.3)
http-2-next (>= 0.4.1)
i18n (1.14.1)
concurrent-ruby (~> 1.0)
Expand All @@ -60,12 +61,12 @@ 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)
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 @@ -99,35 +100,35 @@ GEM
parser (3.2.2.3)
ast (~> 2.4.1)
racc
prometheus-client (2.1.0)
prometheus-client (4.2.1)
pry (0.14.2)
coderay (~> 1.1)
method_source (~> 1.0)
pry-byebug (3.10.1)
byebug (~> 11.0)
pry (>= 0.13, < 0.15)
public_suffix (5.0.3)
puma (6.3.0)
puma (6.3.1)
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)
rb-fsevent (0.11.2)
rb-inotify (0.10.1)
ffi (~> 1.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 @@ -141,19 +142,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 @@ -165,31 +168,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 All @@ -214,12 +217,12 @@ GEM
addressable (>= 2.8.0)
crack (>= 0.3.2)
hashdiff (>= 0.4.0, < 2.0.0)
yabeda (0.11.0)
yabeda (0.12.0)
anyway_config (>= 1.0, < 3)
concurrent-ruby
dry-initializer
yabeda-prometheus (0.8.0)
prometheus-client (>= 0.10, < 3.0)
yabeda-prometheus (0.9.0)
prometheus-client (>= 3.0, < 5.0)
rack
yabeda (~> 0.10)
yabeda-puma-plugin (0.7.1)
Expand Down Expand Up @@ -264,4 +267,4 @@ DEPENDENCIES
yabeda-puma-plugin

BUNDLED WITH
2.4.13
2.4.19
34 changes: 6 additions & 28 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,41 +11,19 @@ git clone git@github.com:mlibrary/get-this.git
cd get-this
```

copy .env-example to .env

```
cp .env-example .env
```

edit .env with actual environment variables; ask a developer if you need them

build container
```
docker-compose build
```

bundle install
```
docker-compose run --rm web bundle install
run the `init.sh` script.
```bash
./init.sh
```

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

build the css

```
docker-compose run --rm web npm run build
```
edit .env with the appropriate environment variables

start containers
```

```bash
docker-compose up -d
```


## Updating `institution_hours_exceptions.json`

`config/institution_hours_exceptions.json` is a static file that needs to be updated yearly.
Expand Down
2 changes: 1 addition & 1 deletion 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
command:
- bundle
- exec
Expand Down
File renamed without changes.
File renamed without changes.
14 changes: 7 additions & 7 deletions get-this.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,13 @@

Time.zone = "Eastern Time (US & Canada)"

require_relative "./lib/styled_flash"
require_relative "./lib/utility"
require_relative "./models/patron"
require_relative "./models/item"
require_relative "./models/options/media_booking"
require_relative "./models/options"
require_relative "./lib/closed_days"
require_relative "lib/styled_flash"
require_relative "lib/utility"
require_relative "models/patron"
require_relative "models/item"
require_relative "models/options/media_booking"
require_relative "models/options"
require_relative "lib/closed_days"

helpers StyledFlash
enable :sessions
Expand Down
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 30ffc9d

Please sign in to comment.