risky 0.1.7 → 0.1.8

Sign up to get free protection for your applications and to get access to all the features.
Files changed (3) hide show
  1. data/lib/risky/version.rb +1 -1
  2. data/lib/risky.rb +11 -12
  3. metadata +13 -11
data/lib/risky/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  class Risky
2
- VERSION = "0.1.7"
2
+ VERSION = "0.1.8"
3
3
  end
data/lib/risky.rb CHANGED
@@ -86,9 +86,9 @@ class Risky
86
86
  end
87
87
 
88
88
  # Counts the number of values in the bucket via key streaming
89
- def self.count(opts = {:reload => true})
89
+ def self.count
90
90
  count = 0
91
- bucket.keys(opts) do |keys|
91
+ bucket.keys do |keys|
92
92
  count += keys.length
93
93
  end
94
94
  count
@@ -103,7 +103,7 @@ class Risky
103
103
 
104
104
  # Iterate over all items using key streaming.
105
105
  def self.each
106
- bucket.keys(:reload => true) do |keys|
106
+ bucket.keys do |keys|
107
107
  keys.each do |key|
108
108
  if x = self[key]
109
109
  yield x
@@ -244,29 +244,28 @@ class Risky
244
244
 
245
245
  # The Riak::Client backing this model class.
246
246
  def self.riak
247
- if c = Thread.current["#{self}.riak"]
248
- c
247
+ if @riak_client
248
+ @riak_client
249
249
  elsif @riak and @riak.respond_to? :call
250
- Thread.current["#{self}.riak"] = @riak.call(self)
250
+ @riak_client = @riak.call(self)
251
251
  elsif @riak
252
- Thread.current["#{self}.riak"] = @riak
252
+ @riak_client = @riak
253
253
  else
254
254
  superclass.riak
255
255
  end
256
256
  end
257
257
 
258
- # Forces this model and thread's Riak client to be reset.
258
+ # Forces this model's Riak client to be reset.
259
259
  # If your @riak proc can choose between multiple hosts, calling this on
260
260
  # failure will allow subsequent requests to proceed on another host.
261
261
  def self.riak!
262
- Thread.current["#{self}.riak"] = nil
262
+ @riak_client = nil
263
263
  riak
264
264
  end
265
265
 
266
266
  # Sets the Riak Client backing this model class. If client is a lambda (or
267
267
  # anything responding to #call), it will be invoked to generate a new client
268
- # every time Risky feels it is appropriate. Clients are stored in
269
- # thread-local storage, under "Classname.riak".
268
+ # every time Risky feels it is appropriate.
270
269
  def self.riak=(client)
271
270
  @riak = client
272
271
  end
@@ -497,7 +496,7 @@ class Risky
497
496
  end
498
497
 
499
498
  @riak_object.raw_data = MultiJson.encode @values
500
- @riak_object.content_type = "application/json"
499
+ @riak_object.content_type = "application/json"
501
500
 
502
501
  store_opts = {}
503
502
  store_opts[:w] = opts[:w] if opts[:w]
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: risky
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.7
4
+ version: 0.1.8
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,11 +9,12 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2011-10-14 00:00:00.000000000Z
12
+ date: 2011-11-21 00:00:00.000000000 -08:00
13
+ default_executable:
13
14
  dependencies:
14
15
  - !ruby/object:Gem::Dependency
15
16
  name: riak-client
16
- requirement: &69243700 !ruby/object:Gem::Requirement
17
+ requirement: &14512980 !ruby/object:Gem::Requirement
17
18
  none: false
18
19
  requirements:
19
20
  - - ~>
@@ -21,25 +22,26 @@ dependencies:
21
22
  version: 1.0.0.beta
22
23
  type: :runtime
23
24
  prerelease: false
24
- version_requirements: *69243700
25
+ version_requirements: *14512980
25
26
  description:
26
27
  email: aphyr@aphyr.com
27
28
  executables: []
28
29
  extensions: []
29
30
  extra_rdoc_files: []
30
31
  files:
31
- - lib/risky/all.rb
32
- - lib/risky/invalid.rb
33
- - lib/risky/not_found.rb
32
+ - lib/risky.rb
34
33
  - lib/risky/resolver.rb
35
- - lib/risky/threadsafe.rb
36
34
  - lib/risky/version.rb
37
- - lib/risky/timestamps.rb
35
+ - lib/risky/invalid.rb
36
+ - lib/risky/all.rb
37
+ - lib/risky/not_found.rb
38
38
  - lib/risky/indexes.rb
39
+ - lib/risky/timestamps.rb
40
+ - lib/risky/threadsafe.rb
39
41
  - lib/risky/cron_list.rb
40
- - lib/risky.rb
41
42
  - LICENSE
42
43
  - README.markdown
44
+ has_rdoc: true
43
45
  homepage: https://github.com/aphyr/risky
44
46
  licenses: []
45
47
  post_install_message:
@@ -60,7 +62,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
60
62
  version: '0'
61
63
  requirements: []
62
64
  rubyforge_project: risky
63
- rubygems_version: 1.8.10
65
+ rubygems_version: 1.6.2
64
66
  signing_key:
65
67
  specification_version: 3
66
68
  summary: A Ruby ORM for the Riak distributed database.