Skip to content

Commit

Permalink
add thread_safe for the storage hash and bump the version
Browse files Browse the repository at this point in the history
  • Loading branch information
saturnflyer committed Oct 2, 2013
1 parent 943372e commit 3eb7c92
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 2 deletions.
3 changes: 2 additions & 1 deletion lib/triad.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
require "triad/version"
require 'thread_safe'

class Triad
include Enumerable
Expand All @@ -10,7 +11,7 @@ class KeyNotPresent < StandardError; end

# stored as {key => ['Descriptor', value]}
def initialize(*args)
@storage = {}
@storage = ThreadSafe::Hash.new
end
attr_reader :storage
private :storage
Expand Down
2 changes: 1 addition & 1 deletion lib/triad/version.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
class Triad
VERSION = "0.1.2"
VERSION = "0.1.3"
end
2 changes: 2 additions & 0 deletions triad.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ Gem::Specification.new do |spec|
spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
spec.require_paths = ["lib"]

spec.add_dependency "thread_safe", "~> 0.1.3"

spec.add_development_dependency "bundler", "~> 1.3"
spec.add_development_dependency "rake"
end

0 comments on commit 3eb7c92

Please sign in to comment.