-
Notifications
You must be signed in to change notification settings - Fork 66
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge remote-tracking branch 'upstream/main' into undo-loan-return-true
- Loading branch information
Showing
25 changed files
with
575 additions
and
56 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
# | ||
# This file tells direnv, if both it and Nix are installed, to automatically | ||
# load the Nix dependencies defined in flake.nix. | ||
# | ||
# For details on the Nix development setup, see NIX.md. | ||
# | ||
if has nix; then | ||
if ! has nix_direnv_version || ! nix_direnv_version 2.3.0; then | ||
source_url "https://raw.githubusercontent.com/nix-community/nix-direnv/2.3.0/direnvrc" "sha256-Dmd+j63L84wuzgyjITIfSxSD57Tx7v51DMxVZOsiUD8=" | ||
fi | ||
nix_direnv_watch_file .ruby-version | ||
use flake | ||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,89 @@ | ||
# Development Setup using Nix | ||
|
||
> [!WARNING] | ||
> This is meant for advanced users already familiar with Nix. If you're looking | ||
> for general development instructions, please see [README.md](README.md). | ||
## Prerequisites | ||
|
||
- [Nix](https://nixos.org/download) | ||
- [Docker w/ Compose](https://github.com/docker/compose#where-to-get-docker-compose) via Docker Desktop or equivalent - this setup runs Rails directly but uses a container for the database. | ||
- [direnv](https://github.com/direnv/direnv) - technically optional but helpful to get the environment to automatically load when entering the project directory | ||
|
||
## Initial Dependencies | ||
|
||
If you have direnv, the `.envrc` file in the repository will get everything set | ||
up for you automatically, you just need to run `direnv allow`. If you're not | ||
using direnv, you can manually start a development shell with `nix develop`. | ||
|
||
## Database | ||
|
||
This setup uses the development database configured in `docker-compose.yml`, | ||
which can be started like this: | ||
|
||
```shell-session | ||
$ docker compose up -d database | ||
``` | ||
|
||
The database is working properly if this command produces a list of databases: | ||
|
||
```shell-session | ||
$ psql -l "$DATABASE_URL" | ||
``` | ||
|
||
## Bootstrapping | ||
|
||
Use the `setup` script to get started for the first time. | ||
|
||
```shell-session | ||
$ bin/setup | ||
``` | ||
|
||
This script will: | ||
|
||
- Fetch Ruby and NPM dependencies | ||
- Bootstrap the development database | ||
- Load some sample data into the development database | ||
|
||
The setup script doesn't create the test database, so do that separately: | ||
|
||
```shell-session | ||
$ bin/rails db:create:all | ||
``` | ||
|
||
## Asset Compilation | ||
|
||
You can get the assets automatically compiling on file changes by leaving this | ||
command running in a shell: | ||
|
||
```shell-session | ||
$ bin/dev -m all=1,web=0 | ||
``` | ||
|
||
Note this skips the Rails server, which we run separately below. This is | ||
because something is preventing Rails from loading properly within the Foreman | ||
environment. If somebody figures this out update this guide! | ||
|
||
## Development Server | ||
|
||
Run the Rails server in a separate shell: | ||
|
||
```shell-session | ||
$ bin/rails server | ||
``` | ||
|
||
## Running Tests | ||
|
||
All tests should be able to run normally: | ||
|
||
```shell-session | ||
# Unit tests | ||
$ bin/rails test | ||
# Selenium tests | ||
$ bin/rails test:system | ||
``` | ||
|
||
The Selenium tests are run by having Nix install Chromium and ChromeDriver and | ||
set a `SELENIUM_CHROME_BINARY` environment variable to point Selenium at | ||
Chromium in `test/application_system_test_case.rb`. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,3 @@ | ||
Thank you for signing up as a member of The <%= @library.name %>. We are excited to have you! | ||
|
||
<%= HTMLToMarkdown.new.convert(render(partial: "signup/confirmations/instructions", formats: [:html], locals: {library: @library})) %> | ||
If you have any questions, please email us at team@chicagotoollibrary.org. | ||
|
||
See you at the library! | ||
|
||
--- | ||
|
||
<%= @library.address %> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,16 @@ | ||
<%# Library can come from local or instance variable. %> | ||
<% library ||= @library %> | ||
<% if @amount %> | ||
<p><strong>Your payment of <%= @amount.format %> has been processed and applied to your account.</strong></p> | ||
<% end %> | ||
<p>To activate your membership, please bring the following with you to the library the first time you visit:</p> | ||
<ul> | ||
<li><strong>Proof of your address</strong><br>This needs to include your name and current address in <%= @library ? @library.city : library.city %>. Utility bills, leases, and other official mail work well for this.</li> | ||
<li><strong>Proof of your address</strong><br>This needs to include your name and current address in <%= library.city %>. Utility bills, leases, and other official mail work well for this.</li> | ||
<li><strong>A photo ID</strong><br>This needs to show your name and a photo and can be from the state, your job, school, etc.</li> | ||
</ul> | ||
<p>We're located at:<br> | ||
4015 W. Carroll Ave, Suite 101<br> | ||
Chicago, IL 60624</p> | ||
|
||
<p>Please consider adding <strong><%= library.email %></strong> to your contacts to ensure our emails make it to your inbox!</p> |
Oops, something went wrong.