bundle install- Install dependenciesrake- Run all specs and auto-fix linting (default task)rake spec- Run all specsbundle exec rspec spec/path/to/file_spec.rb- Run a single test filebundle exec rspec spec/path/to/file_spec.rb:42- Run single test at line 42rake standard- Check code stylerake standard:fix- Auto-fix code style issues./bin/console- Launch interactive console
- Follow Standard Ruby style guide (enforced via
standardgem) - Ruby version: >= 3.0.0
- Always use
# frozen_string_literal: trueat the top of all Ruby files - Use double quotes for strings
- Use snake_case for variables/methods, SCREAMING_SNAKE_CASE for constants
- 2-space indentation
- No trailing whitespace
- Module structure:
lib/rqrcode/for implementation,spec/rqrcode/for tests
- Implementation:
lib/rqrcode/<feature>.rborlib/rqrcode/<namespace>/<feature>.rb - Tests:
spec/rqrcode/<feature>_spec.rb(must end with_spec.rb) - Export modules live in
lib/rqrcode/export/(e.g.,svg.rb,png.rb,ansi.rb)
- Use RSpec for all tests
- Test files require
spec_helperat the top - Use
describeblocks for grouping related tests - Use
itblocks for individual test cases - Tests should verify behavior, not implementation details
- Core QR generation:
rqrcode_coregem (do not modify, separate project) - PNG rendering:
chunky_pnggem - This gem focuses on rendering QR codes from
rqrcode_coredata structures
Use the Semantic Commit Message style:
- type: The type of change (see below)
- scope: Optional, the area of the codebase affected (e.g.,
auth,api,ui) - subject: A brief description in imperative mood, lowercase, no full stop