rqrcode 0.8.0 → 0.8.1

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 46c6e005cfad5a06130d1057cb3339a9536876d7
4
- data.tar.gz: 43052e7598d0ca24b55ccdac80c112d110d6023f
3
+ metadata.gz: d79bac6074e479dbd18a88328133cba3e52b3d48
4
+ data.tar.gz: 34b195a360c9808970ab2974b3669a51182afdb2
5
5
  SHA512:
6
- metadata.gz: 4da648696490c9dea757030a8f1a33ec731532704bca8707dac941729791bb1f4c7d68a39dc83bbeab0df39becc719b3b70b383c1ae88a4600ec7a6742f36a10
7
- data.tar.gz: ed6067dc3533be6f1ebdbd3eea7e34a4caca62d868a469ad09f7dbb963a72c13c1dc75ab3f29385f27317e9601a7e0e156d91cc95c9c757fe9719f7a595003fc
6
+ metadata.gz: f0187bf0225b92e48658168b19be5d369faf9de61582886a3ff7ce79221732e5607aa72cc59a75a4c2d7a3b67527df813c6a9128a181a6f974dcbeb16146d08e
7
+ data.tar.gz: b7e2cfc5496a9ff45008b8e56f0c1189d51a6a0d5cf79ab380dc0febf4d4a23ff162686cea280dfeb9b02c96d2bafbd54e556ff9977660d7051f787e45cbd72d
data/CHANGELOG CHANGED
@@ -1,3 +1,8 @@
1
+ *0.8.1* (Jan 3, 2016)
2
+
3
+ - Remove active support specific `present?`.
4
+ - Fix so that all tests are run.
5
+
1
6
  *0.8.0* (Dec 18, 2015)
2
7
 
3
8
  - Added numeric QR code support
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
@@ -7,7 +7,7 @@ desc "Run tests"
7
7
  Rake::TestTask.new do |t|
8
8
  t.libs << "lib"
9
9
  t.libs << "test"
10
- t.test_files = FileList['test/test_*.rb']
10
+ t.pattern = "test/**/test_*.rb"
11
11
  t.verbose = true
12
12
  end
13
13
 
@@ -33,11 +33,11 @@ module RQRCode
33
33
  if i % 3 == 0
34
34
  chars = @data[i]
35
35
 
36
- if @data[i + 1].present?
36
+ if @data[i + 1]
37
37
  chars << @data[i + 1]
38
38
  end
39
39
 
40
- if @data[i + 2].present?
40
+ if @data[i + 2]
41
41
  chars << @data[i + 2]
42
42
  end
43
43
 
@@ -1,3 +1,3 @@
1
1
  module RQRCode
2
- VERSION = "0.8.0"
2
+ VERSION = "0.8.1"
3
3
  end
@@ -0,0 +1,9 @@
1
+ require 'rqrcode'
2
+
3
+ require 'minitest/spec'
4
+ require 'minitest/autorun'
5
+
6
+ require 'rqrcode/export/png'
7
+ require 'rqrcode/export/svg'
8
+ require 'rqrcode/export/html'
9
+
@@ -1,17 +1,6 @@
1
- # encoding: utf-8
2
- require "test/unit"
1
+ require 'helper'
3
2
 
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
3
+ class RegresionTests < Minitest::Test
15
4
 
16
5
  # Rs block information was incomplete.
17
6
  def test_code_length_overflow_bug
@@ -1,27 +1,15 @@
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"
1
+ require 'helper'
14
2
 
15
- class QRCodeTest < Test::Unit::TestCase
3
+ class QRCodeTest < Minitest::Test
16
4
  require_relative "data"
17
5
 
18
6
  def test_no_data_given
19
- assert_raise(RQRCode::QRCodeArgumentError) {
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
- assert_raise(RQRCode::QRCodeRunTimeError) {
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
- assert_raise RQRCode::QRCodeArgumentError do
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
- assert_raise(RQRCode::QRCodeArgumentError) {
113
+ assert_raises(RQRCode::QRCodeArgumentError) {
126
114
  RQRCode::QRCode.new( "duncan", :level => ltr.to_sym )
127
115
  }
128
116
  end
@@ -1,23 +1,6 @@
1
- require 'minitest/spec'
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.0
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: 2015-12-18 00:00:00.000000000 Z
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