rqrcode-with-patches 0.5.4 → 0.5.5
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
- data/CHANGELOG +5 -0
- data/README.md +7 -0
- data/lib/rqrcode/qrcode/qr_code.rb +2 -2
- data/lib/rqrcode/qrcode/qr_rs_block.rb +2 -1
- data/lib/rqrcode/version.rb +1 -1
- data/test/test_regresions.rb +21 -0
- metadata +5 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a9837d6427a26ac797834219b246f4e9efd5e59a
|
4
|
+
data.tar.gz: dfa07d676b0084f75aac78ae13d51ab6b23cfdfa
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e2b433a5481255b1fc13f46194274af6d994969794b47860aa06aedc8f9a4918ffaccc5f68329636892d977b1004e48058bca50f36f2e5236e296fc1712f03e0
|
7
|
+
data.tar.gz: b5ac381cfc7e18301be81f86eeb446c1408fa97000c2c64da38bf9c2d2c1e5f6202027a644fbd0273256da4d9fbf1da3eaa450534ced13984e49b9a73b08d033
|
data/CHANGELOG
CHANGED
data/README.md
CHANGED
@@ -3,6 +3,13 @@
|
|
3
3
|
I have republished this gem as rqrcode-with-patches as Duncan seams to have abandoned the project.
|
4
4
|
You can find the original project here: http://github.com/whomwah/rqrcode
|
5
5
|
|
6
|
+
## Short changelog
|
7
|
+
|
8
|
+
*0.5.5* (Apr 25, 2015)
|
9
|
+
|
10
|
+
- Fixed major bug. The rs block data was missing resulting in qr codes failing to be generated.
|
11
|
+
*Upgrade highly recomended!!*
|
12
|
+
|
6
13
|
## Overview
|
7
14
|
|
8
15
|
rQRCode is a library for encoding QR Codes in Ruby. It has a simple interface with all the standard qrcode options. It was adapted from the Javascript library by Kazuhiko Arase.
|
@@ -52,7 +52,7 @@ module RQRCode #:nodoc:
|
|
52
52
|
QRPOSITIONPATTERNLENGTH = (7 + 1) * 2 + 1
|
53
53
|
QRFORMATINFOLENGTH = 15
|
54
54
|
|
55
|
-
#http://www.denso-wave.com/qrcode/vertable1-e.html
|
55
|
+
#http://web.archive.org/web/20110710094955/http://www.denso-wave.com/qrcode/vertable1-e.html
|
56
56
|
QRMAXDIGITS = {
|
57
57
|
:l => {:mode_number => [41, 77, 127, 187, 255, 322, 370, 461, 552, 652],
|
58
58
|
:mode_alpha_numk => [25, 47, 77, 114, 154, 195, 224, 279, 335, 395],
|
@@ -371,7 +371,7 @@ module RQRCode #:nodoc:
|
|
371
371
|
def smallest_size_for(string, max_size_array) #:nodoc:
|
372
372
|
l = string.bytesize
|
373
373
|
ver = max_size_array.index{|i| i >= l}
|
374
|
-
raise QRCodeRunTimeError,"code length overflow. (#{
|
374
|
+
raise QRCodeRunTimeError,"code length overflow. (#{l} digits > any version capacity)" unless ver
|
375
375
|
ver + 1
|
376
376
|
end
|
377
377
|
|
@@ -19,6 +19,7 @@ module RQRCode #:nodoc:
|
|
19
19
|
@data_count = data_count
|
20
20
|
end
|
21
21
|
|
22
|
+
# http://www.thonky.com/qr-code-tutorial/error-correction-table/
|
22
23
|
RQRCode::QRRSBlock::RS_BLOCK_TABLE = [
|
23
24
|
|
24
25
|
# L
|
@@ -114,7 +115,7 @@ RQRCode::QRRSBlock::RS_BLOCK_TABLE = [
|
|
114
115
|
[5, 109, 87, 1, 110, 88],
|
115
116
|
[5, 65, 41, 5, 66, 42],
|
116
117
|
[5, 54, 24, 7, 55, 25],
|
117
|
-
[11, 36, 12],
|
118
|
+
[11, 36, 12, 7, 37, 13],
|
118
119
|
|
119
120
|
# 16
|
120
121
|
[5, 122, 98, 1, 123, 99],
|
data/lib/rqrcode/version.rb
CHANGED
@@ -0,0 +1,21 @@
|
|
1
|
+
# encoding: utf-8
|
2
|
+
require "test/unit"
|
3
|
+
|
4
|
+
# fix for require_relative in < 1.9
|
5
|
+
unless Kernel.respond_to?(:require_relative)
|
6
|
+
module Kernel
|
7
|
+
def require_relative(path)
|
8
|
+
require File.join(File.dirname(caller[0]), path.to_str)
|
9
|
+
end
|
10
|
+
end
|
11
|
+
end
|
12
|
+
|
13
|
+
require_relative "../lib/rqrcode"
|
14
|
+
class RegresionTests < Test::Unit::TestCase
|
15
|
+
|
16
|
+
# Rs block information was incomplete.
|
17
|
+
def test_code_length_overflow_bug
|
18
|
+
RQRCode::QRCode.new('s' * 220)
|
19
|
+
RQRCode::QRCode.new('s' * 195)
|
20
|
+
end
|
21
|
+
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rqrcode-with-patches
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.5.
|
4
|
+
version: 0.5.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Bjorn Blomqvist and others
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date:
|
12
|
+
date: 2015-04-25 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: chunky_png
|
@@ -93,6 +93,7 @@ files:
|
|
93
93
|
- lib/rqrcode/version.rb
|
94
94
|
- rqrcode.gemspec
|
95
95
|
- test/data.rb
|
96
|
+
- test/test_regresions.rb
|
96
97
|
- test/test_rqrcode.rb
|
97
98
|
- test/test_rqrcode_export.rb
|
98
99
|
homepage: https://github.com/bjornblomqvist/rqrcode
|
@@ -114,11 +115,12 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
114
115
|
version: 1.3.6
|
115
116
|
requirements: []
|
116
117
|
rubyforge_project:
|
117
|
-
rubygems_version: 2.
|
118
|
+
rubygems_version: 2.1.11
|
118
119
|
signing_key:
|
119
120
|
specification_version: 4
|
120
121
|
summary: A library to encode QR Codes
|
121
122
|
test_files:
|
122
123
|
- test/data.rb
|
124
|
+
- test/test_regresions.rb
|
123
125
|
- test/test_rqrcode.rb
|
124
126
|
- test/test_rqrcode_export.rb
|