QRCode

QRCode

A pure Ruby library for generating QR codes with multiple output formats. Generate QR codes as text art for terminal display or as scalable SVG graphics for web and print applications.

QR Code Example

This is a fork of rqrcode_core, which was originally adapted in 2008 from a Javascript library by Kazuhiko Arase.

Development Status

Features

Usage

Please browse the source code index or refer to the guides below.

Getting Started

This guide explains how to get started with qrcode to generate QR codes in Ruby.

Releases

Please browse the releases for more details.

v0.2.0

  • Added transparent SVG background support using light_color: nil or light_color: "transparent".

v0.1.0

  • Breaking: Complete refactor of encoder architecture with cleaner segment-based design.
  • Breaking: Renamed RSBlock to ErrorCorrectionBlock with cleaner method names (for, table_entry_for).
  • Breaking: Simplified Code constructor to take segments array, added Code.build() factory method.
  • Breaking: Removed redundant Multi class - multi-segment support now built into Code directly.
  • Breaking: Renamed ASCII output to Text output (QRCode.text() instead of QRCode.ascii()).
  • Breaking: Renamed ERROR_CORRECT_LEVEL to ERROR_CORRECTION_LEVEL for better grammar.
  • Added self-contained segment classes: Segment, NumericSegment, AlphanumericSegment.
  • Added comprehensive test coverage for output functionality (Text and SVG).
  • Added size alias for module_count for cleaner API.
  • Added proper documentation explaining error correction level encoding from ISO/IEC 18004.
  • Added getting started guide with comprehensive usage examples.
  • Improved code organization with QRCode::Encoder namespace for all encoding classes.
  • Removed QR prefix from encoder file and class names for cleaner codebase.

Contributing

We welcome contributions to this project.

  1. Fork it.
  2. Create your feature branch (git checkout -b my-new-feature).
  3. Commit your changes (git commit -am 'Add some feature').
  4. Push to the branch (git push origin my-new-feature).
  5. Create new Pull Request.

Developer Certificate of Origin

In order to protect users of this project, we require all contributors to comply with the Developer Certificate of Origin. This ensures that all contributions are properly licensed and attributed.

Community Guidelines

This project is best served by a collaborative and respectful environment. Treat each other professionally, respect differing viewpoints, and engage constructively. Harassment, discrimination, or harmful behavior is not tolerated. Communicate clearly, listen actively, and support one another. If any issues arise, please inform the project maintainers.