Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Fixed issue with Ruby 1.9 compatibility.

  • Loading branch information...
commit 784e694bae3d19451826e6808ff24f2fdc08dbbc 1 parent 66be2a1
@sporkmonger sporkmonger authored
Showing with 9 additions and 1 deletion.
  1. +2 −0  CHANGELOG
  2. +6 −0 lib/uuidtools.rb
  3. +1 −1  lib/uuidtools/version.rb
View
2  CHANGELOG
@@ -1,3 +1,5 @@
+== UUIDTools 2.1.1
+ * fixed issue with Ruby 1.9 compatibility
== UUIDTools 2.1.0
* completely reworked the MAC address detection code
* added additional parsing methods
View
6 lib/uuidtools.rb
@@ -587,6 +587,9 @@ def self.create_from_hash(hash_class, namespace, name) #:nodoc:
def self.convert_int_to_byte_string(integer, size) #:nodoc:
byte_string = ""
+ if byte_string.respond_to?(:force_encoding)
+ byte_string.force_encoding(Encoding::ASCII_8BIT)
+ end
for i in 0..(size - 1)
byte_string << ((integer >> (((size - 1) - i) * 8)) & 0xFF)
end
@@ -594,6 +597,9 @@ def self.convert_int_to_byte_string(integer, size) #:nodoc:
end
def self.convert_byte_string_to_int(byte_string) #:nodoc:
+ if byte_string.respond_to?(:force_encoding)
+ byte_string.force_encoding(Encoding::ASCII_8BIT)
+ end
integer = 0
size = byte_string.size
for i in 0..(size - 1)
View
2  lib/uuidtools/version.rb
@@ -27,7 +27,7 @@ class UUID
module VERSION #:nodoc:
MAJOR = 2
MINOR = 1
- TINY = 0
+ TINY = 1
STRING = [MAJOR, MINOR, TINY].join('.')
end
Please sign in to comment.
Something went wrong with that request. Please try again.