rqrcode 0.8.0 → 0.8.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG +5 -0
- data/README.md +7 -10
- data/Rakefile +1 -1
- data/lib/rqrcode/qrcode/qr_numeric.rb +2 -2
- data/lib/rqrcode/version.rb +1 -1
- data/test/helper.rb +9 -0
- data/test/test_regresions.rb +2 -13
- data/test/test_rqrcode.rb +10 -22
- data/test/test_rqrcode_export.rb +1 -18
- metadata +4 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d79bac6074e479dbd18a88328133cba3e52b3d48
|
4
|
+
data.tar.gz: 34b195a360c9808970ab2974b3669a51182afdb2
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f0187bf0225b92e48658168b19be5d369faf9de61582886a3ff7ce79221732e5607aa72cc59a75a4c2d7a3b67527df813c6a9128a181a6f974dcbeb16146d08e
|
7
|
+
data.tar.gz: b7e2cfc5496a9ff45008b8e56f0c1189d51a6a0d5cf79ab380dc0febf4d4a23ff162686cea280dfeb9b02c96d2bafbd54e556ff9977660d7051f787e45cbd72d
|
data/CHANGELOG
CHANGED
data/README.md
CHANGED
@@ -2,8 +2,15 @@
|
|
2
2
|
|
3
3
|
[![Build Status](https://travis-ci.org/whomwah/rqrcode.svg?branch=master)](https://travis-ci.org/whomwah/rqrcode)
|
4
4
|
|
5
|
+
**All users of rqrcode are highly recomended to upgrade to version 0.5.5 ore later!**
|
6
|
+
|
5
7
|
## Short changelog
|
6
8
|
|
9
|
+
*0.8.1* (Jan 3, 2016)
|
10
|
+
|
11
|
+
- Remove active support specific `present?`.
|
12
|
+
- Fix so that all tests are run.
|
13
|
+
|
7
14
|
*0.8.0* (Dec 18, 2015)
|
8
15
|
|
9
16
|
- Added numeric QR code support
|
@@ -13,16 +20,6 @@
|
|
13
20
|
|
14
21
|
- Added shape_rendering option for as_svg
|
15
22
|
|
16
|
-
*0.6.0* (Jun 2, 2015)
|
17
|
-
|
18
|
-
- Improved png rendering. Previous png rendering could result in hard to scan qrcodes.
|
19
|
-
*Big thanks to Bart Jedrocha*
|
20
|
-
|
21
|
-
*0.5.5* (Apr 25, 2015)
|
22
|
-
|
23
|
-
- Fixed major bug. The rs block data was missing resulting in qr codes failing to be generated.
|
24
|
-
*Upgrade highly recomended!!*
|
25
|
-
|
26
23
|
## Overview
|
27
24
|
|
28
25
|
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.
|
data/Rakefile
CHANGED
data/lib/rqrcode/version.rb
CHANGED
data/test/helper.rb
ADDED
data/test/test_regresions.rb
CHANGED
@@ -1,17 +1,6 @@
|
|
1
|
-
|
2
|
-
require "test/unit"
|
1
|
+
require 'helper'
|
3
2
|
|
4
|
-
|
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
|
3
|
+
class RegresionTests < Minitest::Test
|
15
4
|
|
16
5
|
# Rs block information was incomplete.
|
17
6
|
def test_code_length_overflow_bug
|
data/test/test_rqrcode.rb
CHANGED
@@ -1,27 +1,15 @@
|
|
1
|
-
|
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"
|
1
|
+
require 'helper'
|
14
2
|
|
15
|
-
class QRCodeTest < Test
|
3
|
+
class QRCodeTest < Minitest::Test
|
16
4
|
require_relative "data"
|
17
5
|
|
18
6
|
def test_no_data_given
|
19
|
-
|
7
|
+
assert_raises(RQRCode::QRCodeArgumentError) {
|
20
8
|
RQRCode::QRCode.new( :size => 1, :level => :h )
|
21
9
|
RQRCode::QRCode.new( :size => 1 )
|
22
10
|
RQRCode::QRCode.new
|
23
11
|
}
|
24
|
-
|
12
|
+
assert_raises(RQRCode::QRCodeRunTimeError) {
|
25
13
|
qr = RQRCode::QRCode.new('duncan')
|
26
14
|
qr.is_dark(0,999999)
|
27
15
|
}
|
@@ -87,18 +75,18 @@ class QRCodeTest < Test::Unit::TestCase
|
|
87
75
|
qr.to_s( :true => 'q', :false => 'n' )[0..21]
|
88
76
|
assert_equal "@@@@@@@ @@ @ @@@@@@@\n", qr.to_s( :true => '@' )[0..21]
|
89
77
|
end
|
90
|
-
|
78
|
+
|
91
79
|
def test_auto_alphanumeric
|
92
80
|
# Overflowws without the alpha version
|
93
81
|
assert RQRCode::QRCode.new( '1234567890', :size => 1, :level => :h )
|
94
|
-
|
82
|
+
|
95
83
|
qr = RQRCode::QRCode.new( 'DUNCAN', :size => 1, :level => :h )
|
96
84
|
assert_equal "xxxxxxx xxx xxxxxxx\n", qr.to_s[0..21]
|
97
85
|
end
|
98
86
|
|
99
87
|
def test_numeric_2_M
|
100
88
|
data = '279042272585972554922067893753871413584876543211601021503002'
|
101
|
-
|
89
|
+
|
102
90
|
qr = RQRCode::QRCode.new(data, size: 2, level: :m, mode: :number)
|
103
91
|
assert_equal "xxxxxxx x x x xxxxxxx\n", qr.to_s[0..25]
|
104
92
|
end
|
@@ -108,9 +96,9 @@ class QRCodeTest < Test::Unit::TestCase
|
|
108
96
|
assert RQRCode::QRCode.new("40952", :size => 1, :level => :h)
|
109
97
|
assert RQRCode::QRCode.new("40932", :size => 1, :level => :h)
|
110
98
|
end
|
111
|
-
|
99
|
+
|
112
100
|
def test_exceed_max_size
|
113
|
-
|
101
|
+
assert_raises RQRCode::QRCodeArgumentError do
|
114
102
|
RQRCode::QRCode.new( 'duncan', :size => 41 )
|
115
103
|
end
|
116
104
|
end
|
@@ -122,7 +110,7 @@ class QRCodeTest < Test::Unit::TestCase
|
|
122
110
|
assert RQRCode::QRCode.new("duncan", :level => :h)
|
123
111
|
|
124
112
|
%w(a b c d e f g i j k n o p r s t u v w x y z).each do |ltr|
|
125
|
-
|
113
|
+
assert_raises(RQRCode::QRCodeArgumentError) {
|
126
114
|
RQRCode::QRCode.new( "duncan", :level => ltr.to_sym )
|
127
115
|
}
|
128
116
|
end
|
data/test/test_rqrcode_export.rb
CHANGED
@@ -1,23 +1,6 @@
|
|
1
|
-
require '
|
2
|
-
require 'minitest/autorun'
|
3
|
-
|
4
|
-
require 'rqrcode/export/png'
|
5
|
-
require 'rqrcode/export/svg'
|
6
|
-
require 'rqrcode/export/html'
|
7
|
-
|
8
|
-
# fix for require_relative in < 1.9
|
9
|
-
unless Kernel.respond_to?(:require_relative)
|
10
|
-
module Kernel
|
11
|
-
def require_relative(path)
|
12
|
-
require File.join(File.dirname(caller[0]), path.to_str)
|
13
|
-
end
|
14
|
-
end
|
15
|
-
end
|
16
|
-
|
17
|
-
require_relative "../lib/rqrcode"
|
1
|
+
require 'helper'
|
18
2
|
|
19
3
|
describe :QRCodeExportTest do
|
20
|
-
# require_relative "data"
|
21
4
|
|
22
5
|
[:svg, :png, :html].each do |ext|
|
23
6
|
it "must respond_to #{ext}" do
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rqrcode
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.8.
|
4
|
+
version: 0.8.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Björn Blomqvist
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date:
|
12
|
+
date: 2016-01-03 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: chunky_png
|
@@ -96,6 +96,7 @@ files:
|
|
96
96
|
- lib/rqrcode/version.rb
|
97
97
|
- rqrcode.gemspec
|
98
98
|
- test/data.rb
|
99
|
+
- test/helper.rb
|
99
100
|
- test/test_regresions.rb
|
100
101
|
- test/test_rqrcode.rb
|
101
102
|
- test/test_rqrcode_export.rb
|
@@ -124,6 +125,7 @@ specification_version: 4
|
|
124
125
|
summary: A library to encode QR Codes
|
125
126
|
test_files:
|
126
127
|
- test/data.rb
|
128
|
+
- test/helper.rb
|
127
129
|
- test/test_regresions.rb
|
128
130
|
- test/test_rqrcode.rb
|
129
131
|
- test/test_rqrcode_export.rb
|