pax_global_header 0000666 0000000 0000000 00000000064 13771640114 0014516 g ustar 00root root 0000000 0000000 52 comment=d01161fcf7f85f3552196c5e5857a15c1597dfe2
rqrcode-1.2.0/ 0000775 0000000 0000000 00000000000 13771640114 0013155 5 ustar 00root root 0000000 0000000 rqrcode-1.2.0/.github/ 0000775 0000000 0000000 00000000000 13771640114 0014515 5 ustar 00root root 0000000 0000000 rqrcode-1.2.0/.github/workflows/ 0000775 0000000 0000000 00000000000 13771640114 0016552 5 ustar 00root root 0000000 0000000 rqrcode-1.2.0/.github/workflows/ruby.yml 0000664 0000000 0000000 00000001210 13771640114 0020250 0 ustar 00root root 0000000 0000000 name: rqrcode
on:
push:
branches:
- master
- release/*
pull_request:
branches:
- master
jobs:
build:
name: Test Ruby ${{ matrix.ruby_version }} on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
ruby_version: [2.5.x, 2.6.x]
os: [ubuntu-latest]
steps:
- uses: actions/checkout@v1
- name: Use Ruby ${{ matrix.ruby_version }}
uses: actions/setup-ruby@v1
with:
ruby-version: ${{ matrix.ruby_version }}
- name: Gem install and test
run: |
gem install bundler
bundle install --jobs 4 --retry 3
bundle exec rspec
rqrcode-1.2.0/.gitignore 0000664 0000000 0000000 00000000223 13771640114 0015142 0 ustar 00root root 0000000 0000000 /.bundle/
/.yardoc
/_yardoc/
/coverage/
/doc/
/pkg/
/spec/reports/
/tmp/
/.devcontainer/
.rvmrc
*.sublime-project
*.sublime-workspace
Gemfile.lock
rqrcode-1.2.0/.rspec 0000664 0000000 0000000 00000000036 13771640114 0014271 0 ustar 00root root 0000000 0000000 --color
--require spec_helper
rqrcode-1.2.0/Gemfile 0000664 0000000 0000000 00000000141 13771640114 0014444 0 ustar 00root root 0000000 0000000 source "https://rubygems.org"
# Specify your gem's dependencies in rqrcode-base.gemspec
gemspec
rqrcode-1.2.0/LICENSE.txt 0000664 0000000 0000000 00000002073 13771640114 0015002 0 ustar 00root root 0000000 0000000 The MIT License (MIT)
Copyright (c) 2008 Duncan Robertson
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
rqrcode-1.2.0/README.md 0000664 0000000 0000000 00000010454 13771640114 0014440 0 ustar 00root root 0000000 0000000 # RQRCode

[RQRCode](https://github.com/whomwah/rqrcode) is a library for creating and rendering QR codes into various formats. It has a simple interface with all the standard QR code options. It was adapted from the Javascript library by Kazuhiko Arase.
* QR code is trademarked by Denso Wave inc
* Minimum Ruby version is `>= 2.3`
* For `rqrcode` releases `< 1.0.0` please use [this README](https://github.com/whomwah/rqrcode/blob/cd2732a68434e6197c219e6c8cbdadfce0c4c4f3/README.md)
## Installing
Add this line to your application's `Gemfile`:
```ruby
gem 'rqrcode'
```
or install manually:
```ruby
gem install rqrcode
```
## Basic usage example
```ruby
require 'rqrcode'
qr = RQRCode::QRCode.new('http://github.com')
result = ''
qr.qrcode.modules.each do |row|
row.each do |col|
result << (col ? 'X' : 'O')
end
result << "\n"
end
puts result
```
### Advanced Options
These are the various QR Code generation options provided by [rqrqcode_core](https://github.com/whomwah/rqrcode_core).
```
string - the string you wish to encode
size - the size of the qrcode (default 4)
level - the error correction level, can be:
* Level :l 7% of code can be restored
* Level :m 15% of code can be restored
* Level :q 25% of code can be restored
* Level :h 30% of code can be restored (default :h)
mode - the mode of the qrcode (defaults to alphanumeric or byte_8bit, depending on the input data):
* :number
* :alphanumeric
* :byte_8bit
* :kanji
```
Example
```
qrcode = RQRCodeCore::QRCode.new('hello world', size: 1, level: :m, mode: :alphanumeric)
```
## Render types
You can output your QR code in various forms. These are detailed below:
### as SVG
The SVG renderer will produce a stand-alone SVG as a `String`
```ruby
require 'rqrcode'
qrcode = RQRCode::QRCode.new("http://github.com/")
# NOTE: showing with default options specified explicitly
svg = qrcode.as_svg(
offset: 0,
color: '000',
shape_rendering: 'crispEdges',
module_size: 6,
standalone: true
)
```

### as ANSI
The ANSI renderer will produce as a string with ANSI color codes.
```ruby
require 'rqrcode'
qrcode = RQRCode::QRCode.new("http://github.com/")
# NOTE: showing with default options specified explicitly
svg = qrcode.as_ansi(
light: "\033[47m", dark: "\033[40m",
fill_character: ' ',
quiet_zone_size: 4
)
```

### as PNG
The library can produce a PNG. Result will be a `ChunkyPNG::Image` instance.
```ruby
require 'rqrcode'
qrcode = RQRCode::QRCode.new("http://github.com/")
# NOTE: showing with default options specified explicitly
png = qrcode.as_png(
bit_depth: 1,
border_modules: 4,
color_mode: ChunkyPNG::COLOR_GRAYSCALE,
color: 'black',
file: nil,
fill: 'white',
module_px_size: 6,
resize_exactly_to: false,
resize_gte_to: false,
size: 120
)
IO.binwrite("/tmp/github-qrcode.png", png.to_s)
```

### On the console ( just because you can )
```ruby
require 'rqrcode'
qr = RQRCode::QRCode.new('http://kyan.com', size: 4, level: :h)
puts qr.to_s
```
Output:
```
xxxxxxx x x xxx xxxxxxx
x x xxxxx x x x x
x xxx x x x x x xxx x
x xxx x xxx x xxx x xxx x
x xxx x xxx x x x x xxx x
... etc
```
## API Documentation
[http://www.rubydoc.info/gems/rqrcode](http://www.rubydoc.info/gems/rqrcode)
## Tests
You can run the test suite using:
```
$ ./bin/setup
$ bundle exec rspec
```
or try the lib from the console with:
```
$ ./bin/console
```
## Contributing
* Fork the project
* Send a pull request
* Don't touch the .gemspec, I'll do that when I release a new version
## Authors
Original RQRCode author: Duncan Robertson
A massive thanks to [all the contributors of the library over the years](https://github.com/whomwah/rqrcode/graphs/contributors). It wouldn't exist if it wasn't for you all.
Oh, and thanks to my bosses at https://kyan.com for giving me time to maintain this project.
## Resources
* wikipedia:: http://en.wikipedia.org/wiki/QR_Code
* Denso-Wave website:: http://www.denso-wave.com/qrcode/index-e.html
* kaywa:: http://qrcode.kaywa.com
## Copyright
MIT License (http://www.opensource.org/licenses/mit-license.html)
rqrcode-1.2.0/_config.yml 0000664 0000000 0000000 00000000031 13771640114 0015276 0 ustar 00root root 0000000 0000000 theme: jekyll-theme-slate rqrcode-1.2.0/bin/ 0000775 0000000 0000000 00000000000 13771640114 0013725 5 ustar 00root root 0000000 0000000 rqrcode-1.2.0/bin/console 0000775 0000000 0000000 00000000526 13771640114 0015320 0 ustar 00root root 0000000 0000000 #!/usr/bin/env ruby
require "bundler/setup"
require "rqrcode"
# You can add fixtures and/or initialization code here to make experimenting
# with your gem easier. You can also use a different console, if you like.
# (If you use this, don't forget to add pry to your Gemfile!)
# require "pry"
# Pry.start
require "irb"
IRB.start(__FILE__)
rqrcode-1.2.0/bin/setup 0000775 0000000 0000000 00000000203 13771640114 0015006 0 ustar 00root root 0000000 0000000 #!/usr/bin/env bash
set -euo pipefail
IFS=$'\n\t'
set -vx
bundle install
# Do any other automated setup that you need to do here
rqrcode-1.2.0/images/ 0000775 0000000 0000000 00000000000 13771640114 0014422 5 ustar 00root root 0000000 0000000 rqrcode-1.2.0/images/ansi-screen-shot.png 0000664 0000000 0000000 00000245616 13771640114 0020330 0 ustar 00root root 0000000 0000000 PNG
IHDR # n sRGB pHYs YiTXtXML:com.adobe.xmp
1
L'Y @ IDATxifY߹<\w.LۦHZ|@: 'XtE 6DB7|IH(Bc_wTsթSg>WW{LYϚ^{biyy֭^Uoy\Oν w4S3SO}iO~ԗiv4p/5\R?T=ձc'c+K՛k_--TNSjuz555YmllU3N599YMMOW{^5V511YM>1QW{:}۩ݨ;Քj^^!ȴxmVU {Ĕ>Z 3dUmV'NU+W}4)yvww4vwvU)eSfݝjW<̾hQqD#В"[RZȹX-<:C8DI4`'.J#Qn|R/UP]70UA}wBӔQW/|ԳS8`p]:2
^#Ri6JH&q8.٘ufY-l7(CK\`$|o9V-!YS6jdo|[տ:~x5
zU3$̔*iz7c'NVkׅ=Q,/Uo(jss]8#}}c#!Б,/T.]jfyںe32kaQOImi_ƲrS
WǰATa /jw]u23յ՛zB)FaV,la #fW?f\tB%*#tWy0Bva@2ƋVnK}:aQ}ZA6:F[":oG>M|).+