rqrcode 0.10.1 → 2.1.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (47) hide show
  1. checksums.yaml +5 -5
  2. data/.github/workflows/ruby.yml +28 -0
  3. data/.gitignore +13 -0
  4. data/.rspec +2 -0
  5. data/CHANGELOG.md +60 -0
  6. data/Gemfile +4 -0
  7. data/Gemfile.lock +68 -0
  8. data/LICENSE.txt +21 -0
  9. data/README.md +223 -135
  10. data/Rakefile +10 -0
  11. data/_config.yml +1 -0
  12. data/bin/console +14 -0
  13. data/images/ansi-screen-shot.png +0 -0
  14. data/images/github-qrcode.png +0 -0
  15. data/images/github-qrcode.svg +32 -0
  16. data/lib/rqrcode/export/ansi.rb +22 -25
  17. data/lib/rqrcode/export/html.rb +8 -10
  18. data/lib/rqrcode/export/png.rb +62 -45
  19. data/lib/rqrcode/export/svg.rb +180 -24
  20. data/lib/rqrcode/export.rb +6 -0
  21. data/lib/rqrcode/qrcode/qrcode.rb +17 -0
  22. data/lib/rqrcode/qrcode.rb +3 -4
  23. data/lib/rqrcode/version.rb +3 -1
  24. data/lib/rqrcode.rb +8 -19
  25. data/rqrcode.gemspec +39 -0
  26. metadata +90 -60
  27. data/CHANGELOG +0 -97
  28. data/LICENSE +0 -19
  29. data/lib/rqrcode/core_ext/array/behavior.rb +0 -12
  30. data/lib/rqrcode/core_ext/array.rb +0 -5
  31. data/lib/rqrcode/core_ext/integer/bitwise.rb +0 -13
  32. data/lib/rqrcode/core_ext/integer.rb +0 -5
  33. data/lib/rqrcode/core_ext.rb +0 -5
  34. data/lib/rqrcode/qrcode/qr_8bit_byte.rb +0 -36
  35. data/lib/rqrcode/qrcode/qr_alphanumeric.rb +0 -47
  36. data/lib/rqrcode/qrcode/qr_bit_buffer.rb +0 -99
  37. data/lib/rqrcode/qrcode/qr_code.rb +0 -585
  38. data/lib/rqrcode/qrcode/qr_math.rb +0 -63
  39. data/lib/rqrcode/qrcode/qr_numeric.rb +0 -57
  40. data/lib/rqrcode/qrcode/qr_polynomial.rb +0 -78
  41. data/lib/rqrcode/qrcode/qr_rs_block.rb +0 -314
  42. data/lib/rqrcode/qrcode/qr_util.rb +0 -272
  43. data/test/data.rb +0 -25
  44. data/test/test_helper.rb +0 -5
  45. data/test/test_regresions.rb +0 -10
  46. data/test/test_rqrcode.rb +0 -155
  47. data/test/test_rqrcode_export.rb +0 -27
@@ -1,50 +1,206 @@
1
+ # frozen_string_literal: true
2
+
1
3
  # This class creates a SVG files.
2
- # Code from: https://github.com/samvincent/rqrcode-rails3
4
+ # Initial code from: https://github.com/samvincent/rqrcode-rails3
3
5
  module RQRCode
4
6
  module Export
5
-
6
7
  module SVG
8
+ class BaseOutputSVG
9
+ attr_reader :result
10
+
11
+ def initialize(qrcode)
12
+ @qrcode = qrcode
13
+ @result = []
14
+ end
15
+ end
16
+
17
+ class Path < BaseOutputSVG
18
+ def build(module_size, offset, color)
19
+ modules_array = @qrcode.modules
20
+ matrix_width = matrix_height = modules_array.length + 1
21
+ empty_row = [Array.new(matrix_width - 1, false)]
22
+ edge_matrix = Array.new(matrix_height) { Array.new(matrix_width) }
23
+
24
+ (empty_row + modules_array + empty_row).each_cons(2).with_index do |row_pair, row_index|
25
+ first_row, second_row = row_pair
26
+
27
+ # horizontal edges
28
+ first_row.zip(second_row).each_with_index do |cell_pair, column_index|
29
+ edge = case cell_pair
30
+ when [true, false] then Edge.new column_index + 1, row_index, :left
31
+ when [false, true] then Edge.new column_index, row_index, :right
32
+ end
33
+
34
+ (edge_matrix[edge.start_y][edge.start_x] ||= []) << edge if edge
35
+ end
36
+
37
+ # vertical edges
38
+ ([false] + second_row + [false]).each_cons(2).each_with_index do |cell_pair, column_index|
39
+ edge = case cell_pair
40
+ when [true, false] then Edge.new column_index, row_index, :down
41
+ when [false, true] then Edge.new column_index, row_index + 1, :up
42
+ end
43
+
44
+ (edge_matrix[edge.start_y][edge.start_x] ||= []) << edge if edge
45
+ end
46
+ end
47
+
48
+ edge_count = edge_matrix.flatten.compact.count
49
+ path = []
50
+
51
+ while edge_count > 0
52
+ edge_loop = []
53
+ next_matrix_cell = edge_matrix.find(&:any?).find { |cell| cell&.any? }
54
+ edge = next_matrix_cell.first
55
+
56
+ while edge
57
+ edge_loop << edge
58
+ matrix_cell = edge_matrix[edge.start_y][edge.start_x]
59
+ matrix_cell.delete edge
60
+ edge_matrix[edge.start_y][edge.start_x] = nil if matrix_cell.empty?
61
+ edge_count -= 1
62
+
63
+ # try to find an edge continuing the current edge
64
+ edge = edge_matrix[edge.end_y][edge.end_x]&.first
65
+ end
66
+
67
+ first_edge = edge_loop.first
68
+ edge_loop_string = SVG_PATH_COMMANDS[:move]
69
+ edge_loop_string += "#{first_edge.start_x} #{first_edge.start_y}"
7
70
 
71
+ edge_loop.chunk(&:direction).to_a[0...-1].each do |direction, edges|
72
+ edge_loop_string << "#{SVG_PATH_COMMANDS[direction]}#{edges.length}"
73
+ end
74
+ edge_loop_string << SVG_PATH_COMMANDS[:close]
75
+
76
+ path << edge_loop_string
77
+ end
78
+
79
+ # Prefix hexadecimal colors unless using a named color (symbol)
80
+ color = "##{color}" unless color.is_a?(Symbol)
81
+
82
+ @result << %{<path d="#{path.join}" fill="#{color}" transform="translate(#{offset},#{offset}) scale(#{module_size})"/>}
83
+ end
84
+ end
85
+
86
+ class Rect < BaseOutputSVG
87
+ def build(module_size, offset, color)
88
+ # Prefix hexadecimal colors unless using a named color (symbol)
89
+ color = "##{color}" unless color.is_a?(Symbol)
90
+
91
+ @qrcode.modules.each_index do |c|
92
+ tmp = []
93
+ @qrcode.modules.each_index do |r|
94
+ y = c * module_size + offset
95
+ x = r * module_size + offset
96
+
97
+ next unless @qrcode.checked?(c, r)
98
+ tmp << %(<rect width="#{module_size}" height="#{module_size}" x="#{x}" y="#{y}" fill="#{color}"/>)
99
+ end
100
+
101
+ @result << tmp.join
102
+ end
103
+ end
104
+ end
105
+
106
+ class Edge < Struct.new(:start_x, :start_y, :direction)
107
+ def end_x
108
+ case direction
109
+ when :right then start_x + 1
110
+ when :left then start_x - 1
111
+ else start_x
112
+ end
113
+ end
114
+
115
+ def end_y
116
+ case direction
117
+ when :down then start_y + 1
118
+ when :up then start_y - 1
119
+ else start_y
120
+ end
121
+ end
122
+ end
123
+
124
+ DEFAULT_SVG_ATTRIBUTES = [
125
+ %(version="1.1"),
126
+ %(xmlns="http://www.w3.org/2000/svg"),
127
+ %(xmlns:xlink="http://www.w3.org/1999/xlink"),
128
+ %(xmlns:ev="http://www.w3.org/2001/xml-events")
129
+ ]
130
+
131
+ SVG_PATH_COMMANDS = {
132
+ move: "M",
133
+ up: "v-",
134
+ down: "v",
135
+ left: "h-",
136
+ right: "h",
137
+ close: "z"
138
+ }
139
+
140
+ #
8
141
  # Render the SVG from the Qrcode.
9
142
  #
10
143
  # Options:
11
- # offset - Padding around the QR Code (e.g. 10)
12
- # fill - Background color (e.g "ffffff" or :white)
13
- # color - Foreground color for the code (e.g. "000000" or :black)
14
- # module_size - The Pixel size of each module (e.g. 11)
15
- # shape_rendering - Defaults to crispEdges
144
+ # offset - Padding around the QR Code in pixels
145
+ # (default 0)
146
+ # fill - Background color e.g "ffffff"
147
+ # (default none)
148
+ # color - Foreground color e.g "000"
149
+ # (default "000")
150
+ # module_size - The Pixel size of each module
151
+ # (defaults 11)
152
+ # shape_rendering - SVG Attribute: auto | optimizeSpeed | crispEdges | geometricPrecision
153
+ # (defaults crispEdges)
154
+ # standalone - Whether to make this a full SVG file, or only an svg to embed in other svg
155
+ # (default true)
156
+ # use_path - Use <path> to render SVG rather than <rect> to significantly reduce size
157
+ # and quality. This will become the default in future versions.
158
+ # (default false)
159
+ # viewbox - replace `width` and `height` in <svg> with a viewBox, allows CSS scaling
160
+ # (default false)
161
+ # svg_attributes - A optional hash of custom <svg> attributes. Existing attributes will remain.
162
+ # (default {})
16
163
  #
17
- def as_svg(options={})
164
+ def as_svg(options = {})
165
+ fill = options[:fill]
166
+ use_path = options[:use_path]
18
167
  offset = options[:offset].to_i || 0
19
168
  color = options[:color] || "000"
20
169
  shape_rendering = options[:shape_rendering] || "crispEdges"
21
170
  module_size = options[:module_size] || 11
171
+ standalone = options[:standalone].nil? ? true : options[:standalone]
172
+ viewbox = options[:viewbox].nil? ? false : options[:viewbox]
173
+ svg_attributes = options[:svg_attributes] || {}
22
174
 
23
175
  # height and width dependent on offset and QR complexity
24
- dimension = (self.module_count*module_size) + (2*offset)
176
+ dimension = (@qrcode.module_count * module_size) + (2 * offset)
177
+ # use dimensions differently if we are using a viewBox
178
+ dimensions_attr = viewbox ? %(viewBox="0 0 #{dimension} #{dimension}") : %(width="#{dimension}" height="#{dimension}")
25
179
 
26
- xml_tag = %{<?xml version="1.0" standalone="yes"?>}
27
- open_tag = %{<svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:ev="http://www.w3.org/2001/xml-events" width="#{dimension}" height="#{dimension}" shape-rendering="#{shape_rendering}">}
180
+ svg_tag_attributes = (DEFAULT_SVG_ATTRIBUTES + [
181
+ dimensions_attr,
182
+ %(shape-rendering="#{shape_rendering}")
183
+ ] + svg_attributes.map { |k, v| %(#{k}="#{v}") }).join(" ")
184
+
185
+ xml_tag = %(<?xml version="1.0" standalone="yes"?>)
186
+ open_tag = %(<svg #{svg_tag_attributes}>)
28
187
  close_tag = "</svg>"
29
188
 
30
- result = []
31
- self.modules.each_index do |c|
32
- tmp = []
33
- self.modules.each_index do |r|
34
- y = c*module_size + offset
35
- x = r*module_size + offset
189
+ output_tag = (use_path ? Path : Rect).new(@qrcode)
190
+ output_tag.build(module_size, offset, color)
36
191
 
37
- next unless self.is_dark(c, r)
38
- tmp << %{<rect width="#{module_size}" height="#{module_size}" x="#{x}" y="#{y}" style="fill:##{color}"/>}
39
- end
40
- result << tmp.join
192
+ if fill
193
+ # Prefix hexadecimal colors unless using a named color (symbol)
194
+ fill = "##{fill}" unless fill.is_a?(Symbol)
195
+ output_tag.result.unshift %(<rect width="#{dimension}" height="#{dimension}" x="0" y="0" fill="#{fill}"/>)
41
196
  end
42
197
 
43
- if options[:fill]
44
- result.unshift %{<rect width="#{dimension}" height="#{dimension}" x="0" y="0" style="fill:##{options[:fill]}"/>}
198
+ if standalone
199
+ output_tag.result.unshift(xml_tag, open_tag)
200
+ output_tag.result << close_tag
45
201
  end
46
202
 
47
- [xml_tag, open_tag, result, close_tag].flatten.join("\n")
203
+ output_tag.result.join
48
204
  end
49
205
  end
50
206
  end
@@ -0,0 +1,6 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "rqrcode/export/ansi"
4
+ require "rqrcode/export/html"
5
+ require "rqrcode/export/png"
6
+ require "rqrcode/export/svg"
@@ -0,0 +1,17 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "forwardable"
4
+
5
+ module RQRCode # :nodoc:
6
+ class QRCode
7
+ extend Forwardable
8
+ def_delegators :@qrcode, :to_s
9
+ def_delegators :@qrcode, :modules # deprecated
10
+
11
+ attr_reader :qrcode
12
+
13
+ def initialize(string, *args)
14
+ @qrcode = RQRCodeCore::QRCode.new(string, *args)
15
+ end
16
+ end
17
+ end
@@ -1,4 +1,3 @@
1
- Dir[File.dirname(__FILE__) + "/qrcode/*.rb"].sort.each do |path|
2
- filename = File.basename(path)
3
- require "rqrcode/qrcode/#{filename}"
4
- end
1
+ # frozen_string_literal: true
2
+
3
+ require "rqrcode/qrcode/qrcode"
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module RQRCode
2
- VERSION = "0.10.1"
4
+ VERSION = "2.1.2"
3
5
  end
data/lib/rqrcode.rb CHANGED
@@ -1,19 +1,8 @@
1
- #!/usr/bin/env ruby
2
-
3
- #--
4
- # Copyright 2008 by Duncan Robertson (duncan@whomwah.com).
5
- # All rights reserved.
6
-
7
- # Permission is granted for use, copying, modification, distribution,
8
- # and distribution of modified versions of this work as long as the
9
- # above copyright notice is included.
10
- #++
11
-
12
- $LOAD_PATH.unshift(File.dirname(__FILE__))
13
-
14
- require "rqrcode/core_ext"
15
- require "rqrcode/qrcode"
16
- require 'rqrcode/export/png'
17
- require 'rqrcode/export/svg'
18
- require 'rqrcode/export/html'
19
- require 'rqrcode/export/ansi'
1
+ # frozen_string_literal: true
2
+
3
+ module RQRCode
4
+ require "rqrcode_core"
5
+ require "rqrcode/qrcode"
6
+ require "rqrcode/export"
7
+ require "rqrcode/version"
8
+ end
data/rqrcode.gemspec ADDED
@@ -0,0 +1,39 @@
1
+ lib = File.expand_path("../lib", __FILE__)
2
+ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
3
+ require "rqrcode/version"
4
+
5
+ Gem::Specification.new do |spec|
6
+ spec.name = "rqrcode"
7
+ spec.version = RQRCode::VERSION
8
+ spec.platform = Gem::Platform::RUBY
9
+ spec.authors = ["Duncan Robertson"]
10
+ spec.email = ["duncan@whomwah.com"]
11
+
12
+ spec.summary = "A library to encode QR Codes"
13
+ spec.description = <<~EOF
14
+ rqrcode is a library for encoding QR Codes. The simple
15
+ interface allows you to create QR Code data structures
16
+ and then render them in the way you choose.
17
+ EOF
18
+ spec.homepage = "https://github.com/whomwah/rqrcode"
19
+ spec.license = "MIT"
20
+ spec.metadata = {
21
+ "bug_tracker_uri" => "https://github.com/whomwah/rqrcode/issues",
22
+ "changelog_uri" => "https://github.com/whomwah/rqrcode/blob/master/CHANGELOG.md"
23
+ }
24
+
25
+ spec.files = Dir.chdir(File.expand_path("..", __FILE__)) do
26
+ `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
27
+ end
28
+ spec.bindir = "exe"
29
+ spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
30
+ spec.require_paths = ["lib"]
31
+
32
+ spec.required_ruby_version = ">= 2.3"
33
+ spec.add_dependency "rqrcode_core", "~> 1.0"
34
+ spec.add_dependency "chunky_png", "~> 1.0"
35
+ spec.add_development_dependency "bundler", "~> 2.0"
36
+ spec.add_development_dependency "rake", "~> 13.0"
37
+ spec.add_development_dependency "rspec", "~> 3.5"
38
+ spec.add_development_dependency "standardrb", "~> 1.0"
39
+ end
metadata CHANGED
@@ -1,126 +1,156 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rqrcode
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.10.1
4
+ version: 2.1.2
5
5
  platform: ruby
6
6
  authors:
7
- - Björn Blomqvist
8
7
  - Duncan Robertson
9
- autorequire:
10
- bindir: bin
8
+ autorequire:
9
+ bindir: exe
11
10
  cert_chain: []
12
- date: 2016-02-11 00:00:00.000000000 Z
11
+ date: 2022-07-26 00:00:00.000000000 Z
13
12
  dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: rqrcode_core
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - "~>"
18
+ - !ruby/object:Gem::Version
19
+ version: '1.0'
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - "~>"
25
+ - !ruby/object:Gem::Version
26
+ version: '1.0'
14
27
  - !ruby/object:Gem::Dependency
15
28
  name: chunky_png
16
29
  requirement: !ruby/object:Gem::Requirement
17
30
  requirements:
18
- - - ~>
31
+ - - "~>"
19
32
  - !ruby/object:Gem::Version
20
33
  version: '1.0'
21
34
  type: :runtime
22
35
  prerelease: false
23
36
  version_requirements: !ruby/object:Gem::Requirement
24
37
  requirements:
25
- - - ~>
38
+ - - "~>"
26
39
  - !ruby/object:Gem::Version
27
40
  version: '1.0'
41
+ - !ruby/object:Gem::Dependency
42
+ name: bundler
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - "~>"
46
+ - !ruby/object:Gem::Version
47
+ version: '2.0'
48
+ type: :development
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - "~>"
53
+ - !ruby/object:Gem::Version
54
+ version: '2.0'
28
55
  - !ruby/object:Gem::Dependency
29
56
  name: rake
30
57
  requirement: !ruby/object:Gem::Requirement
31
58
  requirements:
32
- - - '>='
59
+ - - "~>"
33
60
  - !ruby/object:Gem::Version
34
- version: '0'
61
+ version: '13.0'
35
62
  type: :development
36
63
  prerelease: false
37
64
  version_requirements: !ruby/object:Gem::Requirement
38
65
  requirements:
39
- - - '>='
66
+ - - "~>"
40
67
  - !ruby/object:Gem::Version
41
- version: '0'
68
+ version: '13.0'
42
69
  - !ruby/object:Gem::Dependency
43
- name: bundler
70
+ name: rspec
71
+ requirement: !ruby/object:Gem::Requirement
72
+ requirements:
73
+ - - "~>"
74
+ - !ruby/object:Gem::Version
75
+ version: '3.5'
76
+ type: :development
77
+ prerelease: false
78
+ version_requirements: !ruby/object:Gem::Requirement
79
+ requirements:
80
+ - - "~>"
81
+ - !ruby/object:Gem::Version
82
+ version: '3.5'
83
+ - !ruby/object:Gem::Dependency
84
+ name: standardrb
44
85
  requirement: !ruby/object:Gem::Requirement
45
86
  requirements:
46
- - - '>='
87
+ - - "~>"
47
88
  - !ruby/object:Gem::Version
48
- version: 1.0.0
89
+ version: '1.0'
49
90
  type: :development
50
91
  prerelease: false
51
92
  version_requirements: !ruby/object:Gem::Requirement
52
93
  requirements:
53
- - - '>='
94
+ - - "~>"
54
95
  - !ruby/object:Gem::Version
55
- version: 1.0.0
96
+ version: '1.0'
56
97
  description: |
57
- rQRCode is a library for encoding QR Codes. The simple
98
+ rqrcode is a library for encoding QR Codes. The simple
58
99
  interface allows you to create QR Code data structures
59
- ready to be displayed in the way you choose.
100
+ and then render them in the way you choose.
60
101
  email:
61
- - darwin@bits2life.com
102
+ - duncan@whomwah.com
62
103
  executables: []
63
104
  extensions: []
64
- extra_rdoc_files:
65
- - README.md
66
- - CHANGELOG
67
- - LICENSE
105
+ extra_rdoc_files: []
68
106
  files:
69
- - CHANGELOG
70
- - LICENSE
107
+ - ".github/workflows/ruby.yml"
108
+ - ".gitignore"
109
+ - ".rspec"
110
+ - CHANGELOG.md
111
+ - Gemfile
112
+ - Gemfile.lock
113
+ - LICENSE.txt
71
114
  - README.md
115
+ - Rakefile
116
+ - _config.yml
117
+ - bin/console
118
+ - images/ansi-screen-shot.png
119
+ - images/github-qrcode.png
120
+ - images/github-qrcode.svg
72
121
  - lib/rqrcode.rb
73
- - lib/rqrcode/core_ext.rb
74
- - lib/rqrcode/core_ext/array.rb
75
- - lib/rqrcode/core_ext/array/behavior.rb
76
- - lib/rqrcode/core_ext/integer.rb
77
- - lib/rqrcode/core_ext/integer/bitwise.rb
122
+ - lib/rqrcode/export.rb
78
123
  - lib/rqrcode/export/ansi.rb
79
124
  - lib/rqrcode/export/html.rb
80
125
  - lib/rqrcode/export/png.rb
81
126
  - lib/rqrcode/export/svg.rb
82
127
  - lib/rqrcode/qrcode.rb
83
- - lib/rqrcode/qrcode/qr_8bit_byte.rb
84
- - lib/rqrcode/qrcode/qr_alphanumeric.rb
85
- - lib/rqrcode/qrcode/qr_bit_buffer.rb
86
- - lib/rqrcode/qrcode/qr_code.rb
87
- - lib/rqrcode/qrcode/qr_math.rb
88
- - lib/rqrcode/qrcode/qr_numeric.rb
89
- - lib/rqrcode/qrcode/qr_polynomial.rb
90
- - lib/rqrcode/qrcode/qr_rs_block.rb
91
- - lib/rqrcode/qrcode/qr_util.rb
128
+ - lib/rqrcode/qrcode/qrcode.rb
92
129
  - lib/rqrcode/version.rb
93
- - test/data.rb
94
- - test/test_helper.rb
95
- - test/test_regresions.rb
96
- - test/test_rqrcode.rb
97
- - test/test_rqrcode_export.rb
130
+ - rqrcode.gemspec
98
131
  homepage: https://github.com/whomwah/rqrcode
99
- licenses: []
100
- metadata: {}
101
- post_install_message:
132
+ licenses:
133
+ - MIT
134
+ metadata:
135
+ bug_tracker_uri: https://github.com/whomwah/rqrcode/issues
136
+ changelog_uri: https://github.com/whomwah/rqrcode/blob/master/CHANGELOG.md
137
+ post_install_message:
102
138
  rdoc_options: []
103
139
  require_paths:
104
140
  - lib
105
141
  required_ruby_version: !ruby/object:Gem::Requirement
106
142
  requirements:
107
- - - '>='
143
+ - - ">="
108
144
  - !ruby/object:Gem::Version
109
- version: '0'
145
+ version: '2.3'
110
146
  required_rubygems_version: !ruby/object:Gem::Requirement
111
147
  requirements:
112
- - - '>='
148
+ - - ">="
113
149
  - !ruby/object:Gem::Version
114
- version: 1.3.6
150
+ version: '0'
115
151
  requirements: []
116
- rubyforge_project:
117
- rubygems_version: 2.4.8
118
- signing_key:
152
+ rubygems_version: 3.3.7
153
+ signing_key:
119
154
  specification_version: 4
120
155
  summary: A library to encode QR Codes
121
- test_files:
122
- - test/data.rb
123
- - test/test_helper.rb
124
- - test/test_regresions.rb
125
- - test/test_rqrcode.rb
126
- - test/test_rqrcode_export.rb
156
+ test_files: []
data/CHANGELOG DELETED
@@ -1,97 +0,0 @@
1
- *0.10.1* (Feb 11, 2016)
2
-
3
- - Changed so that gem wont include images and tests.
4
-
5
- *0.10.0* (Feb 11, 2016)
6
-
7
- - Merged as_ansi by [Andy Brody](https://github.com/ab)
8
-
9
- *0.8.2* (Jan 3, 2016)
10
-
11
- - Fix source encoding problem introduced in 0.8.1
12
-
13
- *0.9.0* (Jan 3, 2016)
14
-
15
- - Added support for auto selecting qrcode size up to level 40. (only worked up to level 10 before)
16
- - Added numeric support during auto selection of qrcode mode.
17
-
18
- *0.8.1* (Jan 3, 2016)
19
-
20
- - Remove active support specific `present?`.
21
- - Fix so that all tests are run.
22
-
23
- *0.8.0* (Dec 18, 2015)
24
-
25
- - Added numeric QR code support
26
- - Dropped Ruby v1.8 support
27
-
28
- *0.7.0* (Aug 15, 2015)
29
-
30
- - Added shape_rendering option for as_svg
31
-
32
- *0.6.0* (Jun 2, 2015)
33
-
34
- - Improved png rendering. Previous png rendering could result in hard to scan qrcodes.
35
- *Big thanks to Bart Jedrocha*
36
-
37
- *0.5.5* (Apr 25, 2015)
38
-
39
- - Fixed major bug. The rs block data was missing resulting in qr codes failing to be generated.
40
- *Upgrade highly recomended!!*
41
-
42
- *0.5.4* (Nov 11th, 2013)
43
-
44
- * Added as_html, Big thanks to Jon Evans!
45
-
46
- *0.4.2* (Sep 1st, 2011)
47
-
48
- * Proper namespace CoreExtensions and only extend when needed [https://github.com/metaskills]
49
- * fix for running tests on 1.9
50
-
51
- *0.4.1* (Aug 16th, 2011)
52
-
53
- * Compute common patterns only once (5% to 10% speedup) [https://github.com/gioele]
54
-
55
- *0.4.0* (Aug 13th, 2011)
56
-
57
- * Code optimization: 30% speedup [https://github.com/gioele]
58
- * refactor gem layout
59
-
60
- *0.3.4* (May 23rd, 2011)
61
-
62
- * add the more Rubyish QRCode#dark? alias for #is_dark [https://github.com/dasch]
63
-
64
- *0.3.3* (Feb 1st, 2011)
65
-
66
- * check to see if the level is valid
67
- * fix for 'rszf' bug by [Rob la Lau https://github.com/ohreally]
68
-
69
- *0.3.2* (Mar 15th, 2009)
70
-
71
- * Ruby 1.9 fixes by [Tore Darell http://tore.darell.no] [Chris Mowforth http://blog.99th.st]
72
-
73
- *0.3.1* (Nov 24th, 2008)
74
-
75
- * expanded RS block table to QRcode version 40 [Vladislav Gorodetskiy]
76
-
77
- *0.3.0* (Feb 28th, 2008)
78
-
79
- * added more documentation
80
- * changed to_console to to_s (what was I thinking)
81
- * add more tests
82
-
83
- *0.2.1* (Feb 24th, 2008)
84
-
85
- * small changes to rakefile and readme
86
- * small change to to_console method
87
- * make console_count method private (use modules.size instead)
88
- * slowy updating rdocs
89
-
90
- *0.2.0* (Feb 23rd, 2008)
91
-
92
- * Split files up [DR]
93
- * added rdoc comment ... more to do there
94
-
95
- *0.1.0* (Feb 22rd, 2008)
96
-
97
- * Initial Release [DR]
data/LICENSE DELETED
@@ -1,19 +0,0 @@
1
- Copyright (c) 2008 Duncan Robertson
2
-
3
- Permission is hereby granted, free of charge, to any person obtaining a copy
4
- of this software and associated documentation files (the "Software"), to
5
- deal in the Software without restriction, including without limitation the
6
- rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
7
- sell copies of the Software, and to permit persons to whom the Software is
8
- furnished to do so, subject to the following conditions:
9
-
10
- The above copyright notice and this permission notice shall be included in
11
- all copies or substantial portions of the Software.
12
-
13
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
16
- THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
17
- IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
18
- CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
19
-