Skip to content

Commit

Permalink
Update rqrcode dependency
Browse files Browse the repository at this point in the history
  • Loading branch information
toretore committed May 25, 2009
1 parent 8384d71 commit 354565b
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 14 deletions.
4 changes: 4 additions & 0 deletions vendor/rqrcode/CHANGELOG
@@ -1,3 +1,7 @@
*0.3.2* (Mar 15th, 2009)

* Ruby 1.9 fixes by [Tore Darell http://tore.darell.no] [Chris Mowforth http://blog.99th.st]

*0.3.1* (Nov 24th, 2008)

* expanded RS block table to QRcode version 40 [Vladislav Gorodetskiy]
Expand Down
2 changes: 1 addition & 1 deletion vendor/rqrcode/Rakefile
Expand Up @@ -6,7 +6,7 @@ require 'rake/rdoctask'
require 'rake/testtask'

NAME = "rqrcode"
VERS = "0.3.1"
VERS = "0.3.2"
CLEAN.include ['pkg', 'rdoc']

Gem::manage_gems
Expand Down
4 changes: 3 additions & 1 deletion vendor/rqrcode/lib/rqrcode/qrcode/qr_8bit_byte.rb
Expand Up @@ -27,7 +27,9 @@ def get_length

def write( buffer )
( 0...@data.size ).each do |i|
buffer.put( @data[i], 8 )
c = @data[i]
c = c.ord if c.respond_to?(:ord)#String#[] returns single-char string in 1.9, .ord gets ASCII pos
buffer.put( c, 8 )
end
end
end
Expand Down
24 changes: 12 additions & 12 deletions vendor/rqrcode/lib/rqrcode/qrcode/qr_util.rb
Expand Up @@ -137,10 +137,10 @@ def QRUtil.get_length_in_bits( mode, type )

# 1 - 9
case mode
when QRMODE[:mode_number] : 10
when QRMODE[:mode_alpha_num] : 9
when QRMODE[:mode_8bit_byte] : 8
when QRMODE[:mode_kanji] : 8
when QRMODE[:mode_number] then 10
when QRMODE[:mode_alpha_num] then 9
when QRMODE[:mode_8bit_byte] then 8
when QRMODE[:mode_kanji] then 8
else
raise QRCodeRunTimeError, "mode: #{mode}"
end
Expand All @@ -149,10 +149,10 @@ def QRUtil.get_length_in_bits( mode, type )

# 10 -26
case mode
when QRMODE[:mode_number] : 12
when QRMODE[:mode_alpha_num] : 11
when QRMODE[:mode_8bit_byte] : 16
when QRMODE[:mode_kanji] : 10
when QRMODE[:mode_number] then 12
when QRMODE[:mode_alpha_num] then 11
when QRMODE[:mode_8bit_byte] then 16
when QRMODE[:mode_kanji] then 10
else
raise QRCodeRunTimeError, "mode: #{mode}"
end
Expand All @@ -161,10 +161,10 @@ def QRUtil.get_length_in_bits( mode, type )

# 27 - 40
case mode
when QRMODE[:mode_number] : 14
when QRMODE[:mode_alpha_num] : 13
when QRMODE[:mode_8bit_byte] : 16
when QRMODE[:mode_kanji] : 12
when QRMODE[:mode_number] then 14
when QRMODE[:mode_alpha_num] then 13
when QRMODE[:mode_8bit_byte] then 16
when QRMODE[:mode_kanji] then 12
else
raise QRCodeRunTimeError, "mode: #{mode}"
end
Expand Down

0 comments on commit 354565b

Please sign in to comment.