Skip to content

Modernize gem: Ruby 3.4, rubyzip 3.x fix, tests, and rubocop cleanup#27

Merged
midwire merged 5 commits intomasterfrom
develop
Feb 14, 2026
Merged

Modernize gem: Ruby 3.4, rubyzip 3.x fix, tests, and rubocop cleanup#27
midwire merged 5 commits intomasterfrom
develop

Conversation

@midwire
Copy link
Copy Markdown
Owner

@midwire midwire commented Feb 14, 2026

Summary

  • Bump Ruby to 3.4.8 and add comprehensive RSpec test suite (106 examples)
  • Fix rubyzip 3.x API compatibility for zip extraction (extract keyword arg change)
  • Fix rubocop config to include **/*.rb and resolve all offenses across 35 files
  • Move dev dependencies from gemspec to Gemfile, replace instance_eval/eval with const_get

Test plan

  • All 106 RSpec examples pass
  • bundle exec rubocop reports 0 offenses across 35 files
  • End-to-end CLI run: bin/free_zipcode_data --work-dir /tmp/work_dir --country US --generate-files completes successfully (41,490 zipcodes processed, SQLite + CSV output verified)

- 12 spec files covering all classes: module, Options, Logger, SqliteRam,
  DbTable, CountryTable, StateTable, CountyTable, ZipcodeTable, DataSource,
  Runner, CsvSource, and the full ETL pipeline
- Fixtures: GeoNames-format TSV, CSV with headers, zip archive, config YAML
- Database test helpers for in-memory SQLite setup and seeding
- Add csv gem as runtime dependency (removed from Ruby 3.4 default gems)
- Add CLAUDE.md for Claude Code guidance
- Update .ruby-version from 3.0.2 to 3.4.8
- Ignore .claude/ directory
Update DataSource to use rubyzip 3.x keyword argument API for extract.
Move dev dependencies from gemspec to Gemfile, use add_dependency, sort
alphabetically. Fix version.rake: replace block constants with methods,
replace eval with const_get, use File.write, rename predicate method,
and simplify unreachable loop.
Add **/*.rb to rubocop Include list so all source files are inspected.
Fix offenses across the codebase: use Dir.home, safe navigation,
anonymous forwarding, respond_to_missing?, const_get instead of
instance_eval, rename exception param, use $stdout, sort redundant
Dir.glob, and various layout/style fixes. Exclude Metrics/BlockLength
and Style/OpenStructUse for spec files.
- Update CLAUDE.md with correct Ruby 3.4.8 and rubocop 3.4 target versions
- Fix CLAUDE.md architecture description (Source not Transform, add datafile step, namespaces)
- Remove redundant .freeze from write_version_file to match frozen_string_literal
- Replace Kernel#open with File.read in version.rake
- Add logger gem as runtime dependency (leaving default gems in Ruby 4.0)
- Add StandardError rescue to CountryTable#write and StateTable#write
- Add nil guard for unknown country codes in CountryTable#write
- Fix .rubocop.yml section header (Naming Cops, not Metrics Cops)
@midwire midwire merged commit 70ba22f into master Feb 14, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant