Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion ruby/.ruby-version

This file was deleted.

1 change: 1 addition & 0 deletions ruby/.tool-versions
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
ruby 3.4
27 changes: 21 additions & 6 deletions ruby/README.md
Original file line number Diff line number Diff line change
@@ -1,17 +1,32 @@
# Ruby

Pairing test starter project for Ruby with rspec for testing.
Skeleton project for Ruby.

## Prerequisites

The toolchain this project needs is declared in [`.tool-versions`](./.tool-versions):

```
ruby 3.4
```

Install those however you prefer, as long as they end up on your `PATH`. The quickest route is
[mise](https://mise.jdx.dev/), which reads the file for you:

```sh
mise install
```

## Usage
- `./script/setup` to install dependencies
- `./script/setup` to fetch dependencies
- `./script/test` to run the tests
- `./script/start` to run the code
- `./script/start` to run the app
- `./script/console` for an interactive prompt

## Structure
- Code located in [pairing_test.rb](./lib/pairing_test.rb)
- Tests located in [pairing_test_spec.rb](./spec/pairing_test_spec.rb)
- Code located in [`pairing_test.rb`](./lib/pairing_test.rb)
- Tests located in [`pairing_test_spec.rb`](./spec/pairing_test_spec.rb)

`lib` has been added to the `require` path so all imports inside the `lib` directory must be relative to this, e.g. `require "pairing_test/version"`.

However, you're free to organise your code as you like.
However, you're free to organise your code as you like.
6 changes: 3 additions & 3 deletions ruby/script/setup
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/usr/bin/env bash

set -euo pipefail
IFS=$'\n\t'
set -vx

gem install bundler
cd "$(dirname "${BASH_SOURCE[0]}")/.."

bundle install
6 changes: 4 additions & 2 deletions ruby/script/test
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
#!/usr/bin/env bash

set -e
set -euo pipefail

rake spec
cd "$(dirname "${BASH_SOURCE[0]}")/.."

bundle exec rake spec
Loading