qrcode 0.1.0 → 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- checksums.yaml.gz.sig +0 -0
- data/lib/qrcode/output/svg.rb +9 -2
- data/lib/qrcode/version.rb +1 -1
- data/readme.md +10 -3
- data/releases.md +7 -0
- data.tar.gz.sig +2 -0
- metadata +32 -3
- metadata.gz.sig +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ccad4946a6158f733c2974ec052caa690c55036270b2b2fdad7e8ed07cc91108
|
4
|
+
data.tar.gz: cb827b3cb1120d25a7f9f4ee537a3e96aff506807b62eb56b72c7b66a19954c0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6c76e3d705e4a5b5a88d3fde8a2118317c1490495eda5891ddb8c6f90f6f86b87c857b7fed244490b165aff7bf03b98fca048d5f872e0715e92de43b3da893ba
|
7
|
+
data.tar.gz: bbfcb3883238642e8d9ad5d3f2541e07e99b5b1e14dcfde8cbe3d6855379e9c560afa418337b71ea8b24acc2b7064015fda01dd0bf92e812b462e3d122415c78
|
checksums.yaml.gz.sig
ADDED
Binary file
|
data/lib/qrcode/output/svg.rb
CHANGED
@@ -17,6 +17,11 @@ module QRCode
|
|
17
17
|
@light_color = light_color
|
18
18
|
end
|
19
19
|
|
20
|
+
# @returns [Boolean] true if background should be transparent
|
21
|
+
def transparent?
|
22
|
+
@light_color.nil? || @light_color == "transparent"
|
23
|
+
end
|
24
|
+
|
20
25
|
def render
|
21
26
|
total_size = (qrcode.size + (border * 2)) * cell_size
|
22
27
|
|
@@ -24,8 +29,10 @@ module QRCode
|
|
24
29
|
svg << %[<?xml version="1.0" encoding="UTF-8"?>]
|
25
30
|
svg << %[<svg xmlns="http://www.w3.org/2000/svg" width="#{total_size}" height="#{total_size}" viewBox="0 0 #{total_size} #{total_size}">]
|
26
31
|
|
27
|
-
# Background rectangle
|
28
|
-
|
32
|
+
# Background rectangle (only if not transparent)
|
33
|
+
unless transparent?
|
34
|
+
svg << %[ <rect x="0" y="0" width="#{total_size}" height="#{total_size}" fill="#{light_color}"/>]
|
35
|
+
end
|
29
36
|
|
30
37
|
# Generate dark modules as rectangles
|
31
38
|
qrcode.size.times do |row|
|
data/lib/qrcode/version.rb
CHANGED
data/readme.md
CHANGED
@@ -2,9 +2,9 @@
|
|
2
2
|
|
3
3
|
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.
|
4
4
|
|
5
|
-
|
6
|
-
|
7
|
-
qrcode-generator).
|
5
|
+

|
6
|
+
|
7
|
+
This is a fork of [`rqrcode_core`](https://github.com/whomwah/rqrcode_core), which was originally adapted in 2008 from a Javascript library by [Kazuhiko Arase](https://github.com/kazuhikoarase/qrcode-generator).
|
8
8
|
|
9
9
|
[](https://github.com/socketry/qrcode/actions?workflow=Test)
|
10
10
|
|
@@ -28,16 +28,23 @@ Please see the [project documentation](https://socketry.github.io/qrcode/) for m
|
|
28
28
|
|
29
29
|
Please see the [project releases](https://socketry.github.io/qrcode/releases/index) for all releases.
|
30
30
|
|
31
|
+
### v0.2.0
|
32
|
+
|
33
|
+
- Added transparent SVG background support using `light_color: nil` or `light_color: "transparent"`.
|
34
|
+
|
31
35
|
### v0.1.0
|
32
36
|
|
33
37
|
- **Breaking**: Complete refactor of encoder architecture with cleaner segment-based design.
|
34
38
|
- **Breaking**: Renamed `RSBlock` to `ErrorCorrectionBlock` with cleaner method names (`for`, `table_entry_for`).
|
35
39
|
- **Breaking**: Simplified `Code` constructor to take segments array, added `Code.build()` factory method.
|
36
40
|
- **Breaking**: Removed redundant `Multi` class - multi-segment support now built into `Code` directly.
|
41
|
+
- **Breaking**: Renamed ASCII output to Text output (`QRCode.text()` instead of `QRCode.ascii()`).
|
42
|
+
- **Breaking**: Renamed `ERROR_CORRECT_LEVEL` to `ERROR_CORRECTION_LEVEL` for better grammar.
|
37
43
|
- Added self-contained segment classes: `Segment`, `NumericSegment`, `AlphanumericSegment`.
|
38
44
|
- Added comprehensive test coverage for output functionality (Text and SVG).
|
39
45
|
- Added `size` alias for `module_count` for cleaner API.
|
40
46
|
- Added proper documentation explaining error correction level encoding from ISO/IEC 18004.
|
47
|
+
- Added getting started guide with comprehensive usage examples.
|
41
48
|
- Improved code organization with `QRCode::Encoder` namespace for all encoding classes.
|
42
49
|
- Removed QR prefix from encoder file and class names for cleaner codebase.
|
43
50
|
|
data/releases.md
CHANGED
@@ -1,14 +1,21 @@
|
|
1
1
|
# Releases
|
2
2
|
|
3
|
+
## v0.2.0
|
4
|
+
|
5
|
+
- Added transparent SVG background support using `light_color: nil` or `light_color: "transparent"`.
|
6
|
+
|
3
7
|
## v0.1.0
|
4
8
|
|
5
9
|
- **Breaking**: Complete refactor of encoder architecture with cleaner segment-based design.
|
6
10
|
- **Breaking**: Renamed `RSBlock` to `ErrorCorrectionBlock` with cleaner method names (`for`, `table_entry_for`).
|
7
11
|
- **Breaking**: Simplified `Code` constructor to take segments array, added `Code.build()` factory method.
|
8
12
|
- **Breaking**: Removed redundant `Multi` class - multi-segment support now built into `Code` directly.
|
13
|
+
- **Breaking**: Renamed ASCII output to Text output (`QRCode.text()` instead of `QRCode.ascii()`).
|
14
|
+
- **Breaking**: Renamed `ERROR_CORRECT_LEVEL` to `ERROR_CORRECTION_LEVEL` for better grammar.
|
9
15
|
- Added self-contained segment classes: `Segment`, `NumericSegment`, `AlphanumericSegment`.
|
10
16
|
- Added comprehensive test coverage for output functionality (Text and SVG).
|
11
17
|
- Added `size` alias for `module_count` for cleaner API.
|
12
18
|
- Added proper documentation explaining error correction level encoding from ISO/IEC 18004.
|
19
|
+
- Added getting started guide with comprehensive usage examples.
|
13
20
|
- Improved code organization with `QRCode::Encoder` namespace for all encoding classes.
|
14
21
|
- Removed QR prefix from encoder file and class names for cleaner codebase.
|
data.tar.gz.sig
ADDED
metadata
CHANGED
@@ -1,16 +1,16 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: qrcode
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Duncan Robertson
|
8
8
|
- Björn Blomqvist
|
9
9
|
- Gioele Barabucci
|
10
10
|
- Sam Sayer
|
11
|
+
- Samuel Williams
|
11
12
|
- Fabio Napoleoni
|
12
13
|
- xn
|
13
|
-
- Samuel Williams
|
14
14
|
- Tonči Damjanić
|
15
15
|
- Bjorn Blomqvist
|
16
16
|
- Christopher Lord
|
@@ -39,7 +39,36 @@ authors:
|
|
39
39
|
- Tore Darell
|
40
40
|
- dependabot[bot]
|
41
41
|
bindir: bin
|
42
|
-
cert_chain:
|
42
|
+
cert_chain:
|
43
|
+
- |
|
44
|
+
-----BEGIN CERTIFICATE-----
|
45
|
+
MIIE2DCCA0CgAwIBAgIBATANBgkqhkiG9w0BAQsFADBhMRgwFgYDVQQDDA9zYW11
|
46
|
+
ZWwud2lsbGlhbXMxHTAbBgoJkiaJk/IsZAEZFg1vcmlvbnRyYW5zZmVyMRIwEAYK
|
47
|
+
CZImiZPyLGQBGRYCY28xEjAQBgoJkiaJk/IsZAEZFgJuejAeFw0yMjA4MDYwNDUz
|
48
|
+
MjRaFw0zMjA4MDMwNDUzMjRaMGExGDAWBgNVBAMMD3NhbXVlbC53aWxsaWFtczEd
|
49
|
+
MBsGCgmSJomT8ixkARkWDW9yaW9udHJhbnNmZXIxEjAQBgoJkiaJk/IsZAEZFgJj
|
50
|
+
bzESMBAGCgmSJomT8ixkARkWAm56MIIBojANBgkqhkiG9w0BAQEFAAOCAY8AMIIB
|
51
|
+
igKCAYEAomvSopQXQ24+9DBB6I6jxRI2auu3VVb4nOjmmHq7XWM4u3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jvmH2wAfKtTTqB9CVKLCWEnCHyCaRVuKkrKjqhYCdmMBqCws
|
67
|
+
JkxfQWC+jBVeG9ZtPhQgZpfhvh+6hMhraUYRQ6XGyvBqEUe+yo6DKIT3MtGE2+CP
|
68
|
+
eX9i9ZWBydWb8/rvmwmX2kkcBbX0hZS1rcR593hGc61JR6lvkGYQ2MYskBveyaxt
|
69
|
+
Q2K9NVun/S785AP05vKkXZEFYxqG6EW012U4oLcFl5MySFajYXRYbuUpH6AY+HP8
|
70
|
+
voD0MPg1DssDLKwXyt1eKD/+Fq0bFWhwVM/1XiAXL7lyYUyOq24KHgQ2Csg=
|
71
|
+
-----END CERTIFICATE-----
|
43
72
|
date: 1980-01-02 00:00:00.000000000 Z
|
44
73
|
dependencies: []
|
45
74
|
executables: []
|
metadata.gz.sig
ADDED
Binary file
|