From e09bb08f49a4ffc4fb503b1a0ca9d6cc68a2841c Mon Sep 17 00:00:00 2001 From: Cursor Agent Date: Mon, 11 May 2026 04:05:03 +0000 Subject: [PATCH 1/5] Add AGENTS.md with Cursor Cloud development instructions Co-authored-by: Barnett Klane --- AGENTS.md | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 AGENTS.md diff --git a/AGENTS.md b/AGENTS.md new file mode 100644 index 0000000..c2a3849 --- /dev/null +++ b/AGENTS.md @@ -0,0 +1,21 @@ +## Cursor Cloud specific instructions + +This is the **Trolley Ruby SDK** — a Ruby gem wrapping the Trolley payments API. No databases or background services are required. + +### Quick reference + +| Task | Command | +|---|---| +| Install deps | `bundle install` | +| Lint | `bundle exec rubocop` | +| Unit tests | `bundle exec rake unit_tests` | +| Integration tests | `bundle exec rake integration_tests` | +| All tests | `bundle exec rake` | +| Build gem | `gem build trolley.gemspec` | + +### Important notes + +- Ruby 3.2.2 is required (see `.ruby-version`). It is installed at `/usr/local/bin/ruby`. +- Integration tests use VCR cassettes in `test/fixtures/` and do **not** need live API credentials. The `.env` file with fake keys (copied from `.env.template`) is sufficient for cassette playback. +- To re-record VCR cassettes or run live integration tests, set real `SANDBOX_API_KEY` and `SANDBOX_SECRET_KEY` in `.env`. See `CONTRIBUTING.md`. +- The gem has no runtime dependencies; all deps in the gemspec are `add_development_dependency`. From cb69537f493ebf92fa78a315d4d4180216c8175a Mon Sep 17 00:00:00 2001 From: Cursor Agent Date: Mon, 11 May 2026 04:05:47 +0000 Subject: [PATCH 2/5] Update Gemfile.lock with simplecov dependencies Co-authored-by: Barnett Klane --- Gemfile.lock | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/Gemfile.lock b/Gemfile.lock index 23b57fb..873b24a 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -11,6 +11,7 @@ GEM ast (2.4.2) crack (0.4.5) rexml + docile (1.4.1) dotenv (2.8.1) hashdiff (1.0.1) json (2.6.3) @@ -36,6 +37,12 @@ GEM rubocop-ast (1.28.0) parser (>= 3.2.1.0) ruby-progressbar (1.13.0) + simplecov (0.22.0) + docile (~> 1.1) + simplecov-html (~> 0.11) + simplecov_json_formatter (~> 0.1) + simplecov-html (0.13.2) + simplecov_json_formatter (0.1.4) test-unit (3.5.7) power_assert unicode-display_width (2.4.2) @@ -52,6 +59,7 @@ DEPENDENCIES dotenv (~> 2) rake (~> 13) rubocop (~> 1) + simplecov (~> 0.22) test-unit (~> 3) trolley! vcr (~> 6.2) From 6da90eeefebfe7d2e95d81440ee2d0e75dab96bb Mon Sep 17 00:00:00 2001 From: Cursor Agent Date: Mon, 11 May 2026 05:27:57 +0000 Subject: [PATCH 3/5] Add API key guidance to AGENTS.md Co-authored-by: Barnett Klane --- AGENTS.md | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/AGENTS.md b/AGENTS.md index c2a3849..37aeb9d 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -13,6 +13,17 @@ This is the **Trolley Ruby SDK** — a Ruby gem wrapping the Trolley payments AP | All tests | `bundle exec rake` | | Build gem | `gem build trolley.gemspec` | +### API keys + +Sandbox credentials go in `.env` (loaded by `dotenv`). The file has two required variables: + +``` +SANDBOX_API_KEY= +SANDBOX_SECRET_KEY= +``` + +Get sandbox keys from [developers.trolley.com](https://developers.trolley.com). In Cloud Agent environments these are injected as env vars via Cursor Secrets (`SANDBOX_API_KEY`, `SANDBOX_SECRET_KEY`). + ### Important notes - Ruby 3.2.2 is required (see `.ruby-version`). It is installed at `/usr/local/bin/ruby`. From 51e543921b0e60f9e59c6355093f66c890e13dfd Mon Sep 17 00:00:00 2001 From: Cursor Agent Date: Mon, 11 May 2026 05:30:07 +0000 Subject: [PATCH 4/5] Restructure AGENTS.md for open-source context Co-authored-by: Barnett Klane --- AGENTS.md | 41 +++++++++++++++++++---------------------- 1 file changed, 19 insertions(+), 22 deletions(-) diff --git a/AGENTS.md b/AGENTS.md index 37aeb9d..b6bafba 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -1,32 +1,29 @@ -## Cursor Cloud specific instructions +# AGENTS.md -This is the **Trolley Ruby SDK** — a Ruby gem wrapping the Trolley payments API. No databases or background services are required. +Ruby SDK for the [Trolley](https://trolley.com) payments API. Pure gem — no databases or background services. -### Quick reference +## Development -| Task | Command | -|---|---| -| Install deps | `bundle install` | -| Lint | `bundle exec rubocop` | -| Unit tests | `bundle exec rake unit_tests` | -| Integration tests | `bundle exec rake integration_tests` | -| All tests | `bundle exec rake` | -| Build gem | `gem build trolley.gemspec` | +Requires Ruby 3.2.2 (see `.ruby-version`). Setup and test commands are in `CONTRIBUTING.md`. Quick reference: -### API keys +``` +bundle install # install deps +bundle exec rubocop # lint +bundle exec rake unit_tests # unit tests only +bundle exec rake integration_tests # integration tests only +bundle exec rake # all tests +gem build trolley.gemspec # build gem +``` + +## Testing without API keys + +Integration tests use VCR cassettes (`test/fixtures/`). Copy `.env.template` to `.env` — the fake keys are sufficient for cassette playback. No live API access is needed to run the full test suite. -Sandbox credentials go in `.env` (loaded by `dotenv`). The file has two required variables: +## Testing with live API + +To re-record cassettes or test against the sandbox, add real credentials from [developers.trolley.com](https://developers.trolley.com) to `.env`: ``` SANDBOX_API_KEY= SANDBOX_SECRET_KEY= ``` - -Get sandbox keys from [developers.trolley.com](https://developers.trolley.com). In Cloud Agent environments these are injected as env vars via Cursor Secrets (`SANDBOX_API_KEY`, `SANDBOX_SECRET_KEY`). - -### Important notes - -- Ruby 3.2.2 is required (see `.ruby-version`). It is installed at `/usr/local/bin/ruby`. -- Integration tests use VCR cassettes in `test/fixtures/` and do **not** need live API credentials. The `.env` file with fake keys (copied from `.env.template`) is sufficient for cassette playback. -- To re-record VCR cassettes or run live integration tests, set real `SANDBOX_API_KEY` and `SANDBOX_SECRET_KEY` in `.env`. See `CONTRIBUTING.md`. -- The gem has no runtime dependencies; all deps in the gemspec are `add_development_dependency`. From 4ab216956a5141ece83864db488b725347a54ed8 Mon Sep 17 00:00:00 2001 From: Cursor Agent Date: Mon, 11 May 2026 05:32:54 +0000 Subject: [PATCH 5/5] Add Cursor-specific cloud agent rules Co-authored-by: Barnett Klane --- .cursor/rules/cloud-agent.mdc | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 .cursor/rules/cloud-agent.mdc diff --git a/.cursor/rules/cloud-agent.mdc b/.cursor/rules/cloud-agent.mdc new file mode 100644 index 0000000..f4c2bf4 --- /dev/null +++ b/.cursor/rules/cloud-agent.mdc @@ -0,0 +1,12 @@ +--- +description: Cursor Cloud Agent environment details for Trolley Ruby SDK +globs: +alwaysApply: true +--- + +# Cloud Agent environment + +- Ruby 3.2.2 is installed at `/usr/local/bin/ruby`. +- Sandbox API credentials are available as env vars `SANDBOX_API_KEY` and `SANDBOX_SECRET_KEY` (injected via Cursor Secrets). +- Write them to `.env` before running live integration tests: `cp .env.template .env` then replace the fake values with `$SANDBOX_API_KEY` / `$SANDBOX_SECRET_KEY`. +- VCR cassette playback works with fake keys — no secrets needed for `bundle exec rake`.