Skip to content

Commit 1418d30

Browse files
rameerezclaude
andcommitted
vehiclesdb 0.2.0 — the official alias of the vehicles gem
Two files: depend on vehicles, expose the same API as VehiclesDB. The old unreleased API-client shell is gone — the hosted-API seam lives inside vehicles itself (one codebase, two front doors). Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01AdaRrmb73NLbc4CMGiFgit
1 parent 7b401f7 commit 1418d30

18 files changed

Lines changed: 86 additions & 409 deletions

.github/workflows/test.yml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
name: Tests
2+
on: [push, pull_request]
3+
jobs:
4+
test:
5+
runs-on: ubuntu-latest
6+
steps:
7+
- uses: actions/checkout@v4
8+
# The aliased gem comes from its repo at the same ref family (main).
9+
- uses: actions/checkout@v4
10+
with:
11+
repository: vehiclesdb/vehicles
12+
path: vehicles
13+
- uses: ruby/setup-ruby@v1
14+
with:
15+
ruby-version: "3.4"
16+
- run: ruby -Ilib -Ivehicles/lib test/alias_test.rb

.rubocop.yml

Lines changed: 0 additions & 29 deletions
This file was deleted.

.simplecov

Lines changed: 0 additions & 25 deletions
This file was deleted.

CHANGELOG.md

Lines changed: 4 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,7 @@
11
# Changelog
22

3-
All notable changes to this project are documented in this file.
3+
## [0.2.0] - 2026-07-05
44

5-
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
6-
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7-
8-
## [Unreleased]
9-
10-
## [0.1.0] - 2026-06-23
11-
12-
Initial release — the shell. Reserves the gem and establishes its shape ahead of
13-
the VehiclesDB API going public.
14-
15-
### Added
16-
- `VehiclesDB.configure` + `VehiclesDB::Configuration` (api_key — defaults from
17-
`ENV["VEHICLESDB_API_KEY"]` — api_base_url, timeout, user_agent).
18-
- `VehiclesDB::Client` with auth/JSON/timeout request plumbing and a
19-
`configured?` check; `VehiclesDB.client` memoized default client.
20-
- Error hierarchy: `VehiclesDB::Error` < `ConfigurationError` / `AuthenticationError` / `ApiError`.
21-
22-
Resource methods (model, image, …) land as the API ships.
23-
24-
[Unreleased]: https://github.com/rameerez/vehiclesdb-ruby/compare/v0.1.0...HEAD
25-
[0.1.0]: https://github.com/rameerez/vehiclesdb-ruby/releases/tag/v0.1.0
5+
`vehiclesdb` becomes the official alias of the `vehicles` gem (same API,
6+
`VehiclesDB` constant). The previous unreleased API-client shell is gone —
7+
the hosted-API seam lives inside `vehicles` itself.

Gemfile

Lines changed: 4 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,9 @@
11
# frozen_string_literal: true
22

33
source "https://rubygems.org"
4-
5-
# Specify your gem's dependencies in vehiclesdb.gemspec
64
gemspec
75

8-
gem "rake", "~> 13.0"
9-
10-
group :development, :test do
11-
gem "minitest"
12-
gem "simplecov", require: false
13-
end
14-
15-
group :development do
16-
gem "rubocop", "~> 1.0"
17-
gem "rubocop-minitest", "~> 0.35"
18-
gem "rubocop-performance", "~> 1.0"
19-
end
6+
# The aliased gem, from its sibling checkout for local dev/tests.
7+
gem "vehicles", path: "../vehicles"
8+
gem "minitest"
9+
gem "rake"

README.md

Lines changed: 18 additions & 71 deletions
Original file line numberDiff line numberDiff line change
@@ -1,82 +1,29 @@
1-
# 🚗 `vehiclesdb` – Official Ruby SDK for the VehiclesDB API
1+
# `vehiclesdb` — official alias of [`vehicles`](https://github.com/vehiclesdb/vehicles)
22

3-
[![Gem Version](https://badge.fury.io/rb/vehiclesdb.svg)](https://badge.fury.io/rb/vehiclesdb) [![Build Status](https://github.com/rameerez/vehiclesdb-ruby/workflows/Tests/badge.svg)](https://github.com/rameerez/vehiclesdb-ruby/actions)
4-
5-
> [!TIP]
6-
> **🚀 Ship your next Rails app 10x faster!** I've built **[RailsFast](https://railsfast.com/?ref=vehiclesdb)**, a production-ready Rails boilerplate template that comes with everything you need to launch a software business in days, not weeks. Go [check it out](https://railsfast.com/?ref=vehiclesdb)!
7-
8-
`vehiclesdb` is the official Ruby client for the [**VehiclesDB API**](https://vehiclesdb.com) — a hosted service for rich vehicle data: production years, model images (year- and color-accurate), market segments, specifications, and more.
9-
10-
> [!NOTE]
11-
> **This is an early shell release.** It reserves the gem and sets its shape; the VehiclesDB API isn't public yet, so resource methods (models, images, …) land as the service ships. Configuration, the client, and the error model are in place today.
12-
13-
## `vehiclesdb` vs `vehicles` — which do I want?
14-
15-
Two gems, one product, and they're **fully independent** (each works on its own):
16-
17-
| | [`vehicles`](https://github.com/rameerez/vehicles) | `vehiclesdb` (this gem) |
18-
|---|---|---|
19-
| What | Bundled make/model dataset + a delightful local API | Thin client for the hosted VehiclesDB API |
20-
| Data | Ships **inside the gem** (EU, offline) | Lives on the **server** (the paid API) |
21-
| Setup | Zero — no key, no network | Needs an API key |
22-
| Use it for | Make/model dropdowns, search, validation | Years, images, segments, specs |
23-
24-
Most apps want **`vehicles`** — it works offline with zero config. Add **`vehiclesdb`** (and a key) when you want the richer hosted data; `vehicles` will use it automatically for enrichment. Or use `vehiclesdb` directly if all you want is the raw API.
25-
26-
## Installation
3+
This gem is a two-file front door: it depends on
4+
[**`vehicles`**](https://github.com/vehiclesdb/vehicles) — the Ruby SDK for
5+
the [VehiclesDB](https://github.com/vehiclesdb/vehiclesdb) open vehicle
6+
dataset — and exposes the identical API under the `VehiclesDB` constant.
277

288
```ruby
299
gem "vehiclesdb"
3010
```
3111

32-
## Usage
33-
3412
```ruby
35-
VehiclesDB.configure do |config|
36-
config.api_key = ENV["VEHICLESDB_API_KEY"] # or just set ENV["VEHICLESDB_API_KEY"]
37-
end
38-
39-
VehiclesDB.client.configured? # => true
13+
VehiclesDB.find("vw golf") # => #<Vehicles::Model "Volkswagen Golf">
14+
VehiclesDB.top_models(kind: :motorcycle, country: :th, limit: 5)
15+
VehiclesDB.equal?(Vehicles) # => true — same module, two names
4016
```
4117

42-
You can also build a client explicitly (handy for multiple keys / standalone use):
43-
44-
```ruby
45-
client = VehiclesDB::Client.new(api_key: "vdb_live_...")
46-
client.configured? # => true
47-
```
48-
49-
### Errors
50-
51-
Everything raises a subclass of `VehiclesDB::Error`, so you can rescue broadly or narrowly:
52-
53-
```ruby
54-
VehiclesDB::Error # rescue-all base
55-
VehiclesDB::ConfigurationError # no API key configured
56-
VehiclesDB::AuthenticationError # bad key (HTTP 401/403)
57-
VehiclesDB::ApiError # other non-2xx — carries #status and #body
58-
```
59-
60-
## Configuration
61-
62-
| Option | Default | Notes |
63-
|---|---|---|
64-
| `api_key` | `ENV["VEHICLESDB_API_KEY"]` | your VehiclesDB key |
65-
| `api_base_url` | `https://api.vehiclesdb.com` | override for staging/self-host/tests |
66-
| `timeout` | `5` | request timeout (seconds) |
67-
| `user_agent` | `vehiclesdb-ruby/<version>` | sent with every request |
68-
69-
## Development
70-
71-
After checking out the repo, run `bin/setup` to install dependencies. Then run
72-
`rake test`. You can also run `bin/console` for an interactive prompt.
73-
74-
To install this gem onto your local machine, run `bundle exec rake install`.
75-
76-
## Contributing
77-
78-
Bug reports and pull requests are welcome on GitHub at https://github.com/rameerez/vehiclesdb-ruby. Our code of conduct is: just be nice and make your mom proud of what you do and post online.
18+
**Why two names?** The project is bigger than Ruby: the dataset lives at
19+
[github.com/vehiclesdb/vehiclesdb](https://github.com/vehiclesdb/vehiclesdb)
20+
and SDKs for other languages follow the `vehiclesdb-<language>` pattern. If
21+
you found the project through that name, this gem takes you to the right
22+
place. If you're starting fresh in Ruby, depend on
23+
[`vehicles`](https://github.com/vehiclesdb/vehicles) directly — it's the
24+
same thing with the shorter, Rails-idiomatic name.
7925

80-
## License
26+
Docs, features, dataset details: **see the
27+
[`vehicles` README](https://github.com/vehiclesdb/vehicles#readme)**.
8128

82-
The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).
29+
Code MIT · bundled data CC-BY 4.0 (VehiclesDB).

Rakefile

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,5 @@
11
# frozen_string_literal: true
22

3-
require "bundler/gem_tasks"
43
require "rake/testtask"
5-
6-
Rake::TestTask.new(:test) do |t|
7-
t.libs << "test"
8-
t.libs << "lib"
9-
t.pattern = "test/**/*_test.rb"
10-
t.verbose = false
11-
t.warning = false
12-
end
13-
4+
Rake::TestTask.new { |t| t.test_files = FileList["test/*_test.rb"] }
145
task default: :test

bin/console

Lines changed: 0 additions & 8 deletions
This file was deleted.

bin/setup

Lines changed: 0 additions & 6 deletions
This file was deleted.

context7.json

Lines changed: 0 additions & 4 deletions
This file was deleted.

0 commit comments

Comments
 (0)