Skip to content

gemify#2

Open
parasquid wants to merge 3 commits intomasterfrom
claude/make-this-011CV1oDaYjLiiRMdmfCnocx
Open

gemify#2
parasquid wants to merge 3 commits intomasterfrom
claude/make-this-011CV1oDaYjLiiRMdmfCnocx

Conversation

@parasquid
Copy link
Owner

No description provided.

- Create lib/rotpl.rb as main entry point
- Move library files to lib/rotpl/ for proper namespacing
- Create lib/rotpl/version.rb with version 0.1.0
- Add rotpl.gemspec with gem metadata and dependencies
- Update Gemfile to reference gemspec
- Update README.md with gem installation instructions
- Update require statements in documentation examples
- Update spec files to use new structure
- Fix license identifier to LGPL-3.0-or-later

The library can now be installed as a gem using:
  gem install rotpl
or added to a Gemfile:
  gem 'rotpl'
Added three new spec files with 58 passing tests:

1. spec/totp_spec.rb (19 tests)
   - RFC 6238 test vectors validation
   - Clock skew tolerance tests
   - Custom code digits (6, 7, 8)
   - Custom time steps
   - Current time generation

2. spec/google_authenticator_spec.rb (16 tests)
   - Base32 secret handling (with spaces, case-insensitive)
   - Code generation and validation
   - Two-factor authentication scenarios
   - Google Authenticator format compatibility

3. spec/integration_spec.rb (23 tests)
   - Gem loading and module structure
   - HOTP → TOTP → GoogleAuthenticator inheritance
   - Real-world 2FA scenarios (setup, login, clock drift)
   - Edge cases (large times, epoch, zero-padding)
   - Performance tests (1000 codes < 1 second)

All 58 examples pass with 0 failures.
Enhanced README.md with gem-specific information:

- Added gem version badge
- Added Requirements section (Ruby >= 2.6.0, base32 dependency)
- Added 'require' statements to all code examples
- Added section on checking gem version
- Enhanced Testing section with detailed test coverage info
- Added Development section with local installation and release instructions
- Updated Contributing section with test requirements
- Added notes about base32 being included as a dependency
- Added QR code generation hints

All examples now show proper gem usage with 'require rotpl'.
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.

2 participants