rqrcode 0.3.1 → 0.3.2

Sign up to get free protection for your applications and to get access to all the features.
data/CHANGELOG CHANGED
@@ -1,3 +1,7 @@
1
+ *0.3.2* (Mar 15th, 2009)
2
+
3
+ * Ruby 1.9 fixes by [Tore Darell http://tore.darell.no] [Chris Mowforth http://blog.99th.st]
4
+
1
5
  *0.3.1* (Nov 24th, 2008)
2
6
 
3
7
  * expanded RS block table to QRcode version 40 [Vladislav Gorodetskiy]
@@ -27,7 +27,9 @@ module RQRCode
27
27
 
28
28
  def write( buffer )
29
29
  ( 0...@data.size ).each do |i|
30
- buffer.put( @data[i], 8 )
30
+ c = @data[i]
31
+ c = c.ord if c.respond_to?(:ord)#String#[] returns single-char string in 1.9, .ord gets ASCII pos
32
+ buffer.put( c, 8 )
31
33
  end
32
34
  end
33
35
  end
@@ -137,10 +137,10 @@ module RQRCode #:nodoc:
137
137
 
138
138
  # 1 - 9
139
139
  case mode
140
- when QRMODE[:mode_number] : 10
141
- when QRMODE[:mode_alpha_num] : 9
142
- when QRMODE[:mode_8bit_byte] : 8
143
- when QRMODE[:mode_kanji] : 8
140
+ when QRMODE[:mode_number] then 10
141
+ when QRMODE[:mode_alpha_num] then 9
142
+ when QRMODE[:mode_8bit_byte] then 8
143
+ when QRMODE[:mode_kanji] then 8
144
144
  else
145
145
  raise QRCodeRunTimeError, "mode: #{mode}"
146
146
  end
@@ -149,10 +149,10 @@ module RQRCode #:nodoc:
149
149
 
150
150
  # 10 -26
151
151
  case mode
152
- when QRMODE[:mode_number] : 12
153
- when QRMODE[:mode_alpha_num] : 11
154
- when QRMODE[:mode_8bit_byte] : 16
155
- when QRMODE[:mode_kanji] : 10
152
+ when QRMODE[:mode_number] then 12
153
+ when QRMODE[:mode_alpha_num] then 11
154
+ when QRMODE[:mode_8bit_byte] then 16
155
+ when QRMODE[:mode_kanji] then 10
156
156
  else
157
157
  raise QRCodeRunTimeError, "mode: #{mode}"
158
158
  end
@@ -161,10 +161,10 @@ module RQRCode #:nodoc:
161
161
 
162
162
  # 27 - 40
163
163
  case mode
164
- when QRMODE[:mode_number] : 14
165
- when QRMODE[:mode_alpha_num] : 13
166
- when QRMODE[:mode_8bit_byte] : 16
167
- when QRMODE[:mode_kanji] : 12
164
+ when QRMODE[:mode_number] then 14
165
+ when QRMODE[:mode_alpha_num] then 13
166
+ when QRMODE[:mode_8bit_byte] then 16
167
+ when QRMODE[:mode_kanji] then 12
168
168
  else
169
169
  raise QRCodeRunTimeError, "mode: #{mode}"
170
170
  end
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.3.1
4
+ version: 0.3.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Duncan Robertson
@@ -9,7 +9,7 @@ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
 
12
- date: 2008-11-24 00:00:00 +00:00
12
+ date: 2009-03-15 00:00:00 +00:00
13
13
  default_executable:
14
14
  dependencies: []
15
15
 
@@ -70,7 +70,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
70
70
  requirements: []
71
71
 
72
72
  rubyforge_project: rqrcode
73
- rubygems_version: 1.0.1
73
+ rubygems_version: 1.3.1
74
74
  signing_key:
75
75
  specification_version: 2
76
76
  summary: A library to encode QR Codes