Skip to content

Modernize for Ruby 3.3+ / fog-core 2 (0.6.0) - #7

Merged
alexandru-calinoiu merged 6 commits into
masterfrom
modernize
Oct 12, 2026
Merged

alexandru-calinoiu merged 6 commits into
masterfrom
modernize

Conversation

@alexandru-calinoiu

Copy link
Copy Markdown
Member

Summary

The gem has been dormant since 2016 and no longer runs on any supported Ruby. This brings it up to date and prepares a 0.6.0 release.

What was broken

  • OpenSSL::Digest::Digest and Base64 are gone on current Rubies, so request signing raised
  • minitest 6 dropped MiniTest::, and codeclimate-test-reporter is discontinued
  • rake test globbed a non-existent tests/ directory and ran 0 tests
  • fog-core 2 logged two [fog][DEPRECATION] lines on every Fog::Storage.new (~100 per test run)
  • .travis.yml never ran (line 1 was nguage: ruby)

What changed (one commit per area, so it reviews well commit by commit)

  1. Toolchain and runtime fixes: Ruby >= 3.3, fog-core ~> 2.1, fog-json dropped (unused), dev dependencies moved to the Gemfile, OpenSSL::Digest.new('SHA256') + pack('m0') for signing, explicit securerandom/cgi/escape requires, minitest 6 / webmock 3 / SimpleCov. Also fixes ArgumentError('body is required'), which raised NoMethodError.
  2. Namespace: service moves to Fog::Akamai::Storage (what fog-core 2 expects). Fog::Storage::Akamai stays as a deprecated alias. Fog::Storage.new(provider: 'akamai') is unchanged.
  3. RuboCop 1.x: autocorrected changes were reviewed; all are equivalent rewrites.
  4. CI: GitHub Actions (Ruby 3.3 / 3.4 / 4.0, RuboCop, non-blocking fog-core/fog-xml master job) and Dependabot, replacing Travis and Code Climate.
  5. Release prep: README (wrong Fog::Compute example fixed, badges, upgrade note), new CHANGELOG, version 0.6.0.
  6. CLAUDE.md update, in its own commit. Happy to drop it from this PR if you'd rather not carry it here.

Breaking changes

  • Requires Ruby >= 3.3 (previously unspecified)
  • Requires fog-core ~> 2.1 (was ~> 1.27)

Test plan

  • 71 tests (65 existing + 6 new) pass on Ruby 3.3.5, 3.4.7 and 4.0.7, and against fog-core/fog-xml master
  • bundle exec rake (tests + RuboCop) is green
  • New tests: no deprecation output on load (subprocess) or on Fog::Storage.new, real/mock classes under the new namespace, deprecated alias warns and resolves, nil body raises ArgumentError
  • Built the gem: ships only lib/, README, LICENSE, CHANGELOG (no tests/PDF); installed into an isolated GEM_HOME and exercised in mock and real mode; the signature matches the known-answer test vector
  • CI is green on this PR (first run of the new workflow)
  • A live NetStorage smoke test with real credentials. The stubs can't fully prove the signing/escaping changes against the actual service.

Closes #2, closes #6
Not addressed here: #3 (symlink mock), and the File#get/File#destroy stubs.

🤖 Generated with Claude Code

alexandru-calinoiu and others added 6 commits October 12, 2026 15:33
The gem could not run on any supported Ruby: OpenSSL::Digest::Digest and
Base64 are gone, minitest 6 dropped MiniTest::, codeclimate-test-reporter
is dead and `rake test` globbed a non-existent tests/ directory (0 tests).

- require Ruby >= 3.3, fog-core ~> 2.1, fog-xml ~> 0.1; drop fog-json
- move development dependencies from the gemspec to the Gemfile
- ship only lib/ and docs in the gem; point metadata at fog/fog-akamai
- sign requests with OpenSSL::Digest.new('SHA256') and pack('m0')
- require securerandom/openssl/cgi/escape explicitly, drop DateTime
- fix path_and_body_guard raising NoMethodError instead of ArgumentError
- minitest 6, minitest-mock, webmock 3, timecop 0.9, SimpleCov
- Rakefile runs test/**/*_test.rb and rubocop
- remove rvm gemset and the Ruby 1.8.7 Gemfile; ignore built *.gem

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
fog-core 2 looks up providers as Fog::<Provider>::<Service> and logs two
[fog][DEPRECATION] lines on every Fog::Storage.new when only the legacy
Fog::Storage::<Provider> layout exists (~100 lines per test run).

- Fog::Akamai autoloads Storage so fog-core's const_defined? check passes
- requests, models and the service class move under Fog::Akamai::Storage
- parsers move to Fog::Parsers::Akamai::Storage (internal, no alias)
- Fog::Storage::Akamai stays as a deprecated alias of the new class
- tests cover the real and mock services, the absence of deprecation
  output on load (subprocess) and on Fog::Storage.new, and the alias

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
- .rubocop.yml: TargetRubyVersion 3.3, NewCops enabled, Layout/LineLength
  (renamed from Metrics/LineLength), extension suggestions off
- add frozen_string_literal comments; freeze VALID_ACTIONS (%i[] literal)
- fail -> raise, if/else raise -> guard clauses, expand_path with __dir__
- tests: open fixture files lazily or in a block instead of leaking
  handles in setup, drop the numeric suffix from a test name
- symlink.rb: replace the empty Mock class with a comment pointing at #3

Autocorrected changes were reviewed for behavior: all are equivalent
rewrites; tests pass unchanged on Ruby 3.3, 3.4 and 4.0.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
.travis.yml never ran (line 1 was `nguage: ruby`) and targeted Ruby
1.8.7-2.2; codeclimate-test-reporter is discontinued.

- ci.yml: tests on Ruby 3.3/3.4/4.0, RuboCop, and a non-blocking job
  against fog-core and fog-xml master (gemfiles/Gemfile-edge)
- dependabot.yml: weekly bundler and github-actions updates
- gemfiles/Gemfile-edge: add rubocop (the Rakefile requires it); ignore
  generated gemfiles/*.lock

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
- README: drop the gem-generator boilerplate and Code Climate badges, add
  a CI badge, fix the example (Fog::Storage.new, not Fog::Compute.new),
  document explicit credentials, Ruby >= 3.3 and the 0.5 upgrade note,
  point contributing at fog/fog-akamai (#6)
- CHANGELOG.md: new, describes the 0.6.0 changes
- version 0.6.0
- gemspec: drop redundant homepage_uri/source_code_uri metadata, which
  made `gem build` warn

Closes #2, closes #6

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@alexandru-calinoiu
alexandru-calinoiu merged commit 54f2423 into master Oct 12, 2026
5 checks passed
@alexandru-calinoiu
alexandru-calinoiu deleted the modernize branch October 12, 2026 12:51
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.

Contributing target repo Add travis build

1 participant