Skip to content
Browse files

Fix: Open state file in binary mode (http://github.com/assaf/uuid/iss…

  • Loading branch information...
1 parent de10af1 commit 053e94be93bc540737f745ed92504df104a3b9f1 @assaf assaf committed May 7, 2010
Showing with 9 additions and 8 deletions.
  1. +3 −0 CHANGELOG
  2. +1 −2 Gemfile
  3. +2 −3 Rakefile
  4. +2 −2 lib/uuid.rb
  5. +1 −1 uuid.gemspec
View
3 CHANGELOG
@@ -1,3 +1,6 @@
+2.3.1 (2010-05-07)
+* Fix: Open state file in binary mode (http://github.com/assaf/uuid/issues#issue/8)
+
2.3.0 (2010-04-07)
* Added: UUID.generator returns the current UUID generator. Particularly useful for calling
next_sequence on the generator when forking a process.
View
3 Gemfile
@@ -1,5 +1,4 @@
-source "http://gemcutter.org"
-gem "gemcutter"
+source :rubygems
gem "macaddr"
gem "rake"
gem "yard"
View
5 Rakefile
@@ -23,7 +23,7 @@ end
-desc "Push new release to gemcutter and git tag"
+desc "Push new release to rubyforge and git tag"
task :push do
sh "git push"
puts "Tagging version #{spec.version} .."
@@ -37,6 +37,5 @@ end
desc "Install #{spec.name} locally"
task :install do
sh "gem build #{spec.name}.gemspec"
- sudo = "sudo" unless File.writable?( Gem::ConfigMap[:bindir])
- sh "#{sudo} gem install #{spec.name}-#{spec.version}.gem"
+ sh "gem install #{spec.name}-#{spec.version}.gem"
end
View
4 lib/uuid.rb
@@ -210,7 +210,7 @@ def initialize
@sequence = rand 0x10000
if state_file
- open_lock 'w' do |io|
+ open_lock 'wb' do |io|
write_state io
end
end
@@ -269,7 +269,7 @@ def generate(format = :default)
# Updates the state file with a new sequence number.
def next_sequence
if self.class.state_file
- open_lock 'r+' do |io|
+ open_lock 'rb+' do |io|
@mac, @sequence, @last_clock = read_state(io)
io.rewind
View
2 uuid.gemspec
@@ -1,6 +1,6 @@
spec = Gem::Specification.new do |spec|
spec.name = 'uuid'
- spec.version = '2.3.0'
+ spec.version = '2.3.1'
spec.summary = "UUID generator"
spec.description = <<-EOF
UUID generator for producing universally unique identifiers based on RFC 4122

0 comments on commit 053e94b

Please sign in to comment.
Something went wrong with that request. Please try again.