risky 0.1.3 → 0.1.4

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 +26 -0
  3. metadata +11 -17
data/lib/risky/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  class Risky
2
- VERSION = "0.1.3"
2
+ VERSION = "0.1.4"
3
3
  end
data/lib/risky.rb CHANGED
@@ -132,6 +132,24 @@ class Risky
132
132
  def self.get_or_new(*args)
133
133
  self[*args] or new(args.first)
134
134
  end
135
+
136
+ # Iterate over all keys.
137
+ def self.keys(*a)
138
+ if block_given?
139
+ bucket.keys(*a) do |keys|
140
+ # This API is currently inconsistent from protobuffs to http
141
+ if keys.kind_of? Array
142
+ keys.each do |key|
143
+ yield key
144
+ end
145
+ else
146
+ yield keys
147
+ end
148
+ end
149
+ else
150
+ bucket.keys(*a)
151
+ end
152
+ end
135
153
 
136
154
  # Establishes methods for manipulating a single link with a given tag.
137
155
  def self.link(tag)
@@ -236,6 +254,14 @@ class Risky
236
254
  end
237
255
  end
238
256
 
257
+ # Forces this model and thread's Riak client to be reset.
258
+ # If your @riak proc can choose between multiple hosts, calling this on
259
+ # failure will allow subsequent requests to proceed on another host.
260
+ def self.riak!
261
+ Thread.current["self.riak"] = nil
262
+ riak
263
+ end
264
+
239
265
  # Sets the Riak Client backing this model class. If client is a lambda (or
240
266
  # anything responding to #call), it will be invoked to generate a new client
241
267
  # every time Risky feels it is appropriate. Clients are stored in
metadata CHANGED
@@ -1,13 +1,12 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: risky
3
3
  version: !ruby/object:Gem::Version
4
- hash: 29
5
4
  prerelease: false
6
5
  segments:
7
6
  - 0
8
7
  - 1
9
- - 3
10
- version: 0.1.3
8
+ - 4
9
+ version: 0.1.4
11
10
  platform: ruby
12
11
  authors:
13
12
  - Kyle Kingsbury
@@ -15,23 +14,22 @@ autorequire:
15
14
  bindir: bin
16
15
  cert_chain: []
17
16
 
18
- date: 2011-04-25 00:00:00 -07:00
17
+ date: 2011-05-17 00:00:00 -07:00
19
18
  default_executable:
20
19
  dependencies:
21
20
  - !ruby/object:Gem::Dependency
22
21
  name: riak-client
23
22
  prerelease: false
24
23
  requirement: &id001 !ruby/object:Gem::Requirement
25
- none: false
26
24
  requirements:
27
25
  - - ~>
28
26
  - !ruby/object:Gem::Version
29
- hash: 23
30
27
  segments:
31
28
  - 1
32
29
  - 0
33
30
  - 0
34
- version: 1.0.0
31
+ - pre
32
+ version: 1.0.0.pre
35
33
  type: :runtime
36
34
  version_requirements: *id001
37
35
  description:
@@ -43,14 +41,14 @@ extensions: []
43
41
  extra_rdoc_files: []
44
42
 
45
43
  files:
46
- - lib/risky.rb
47
- - lib/risky/version.rb
48
- - lib/risky/not_found.rb
49
- - lib/risky/indexes.rb
50
44
  - lib/risky/invalid.rb
51
- - lib/risky/timestamps.rb
45
+ - lib/risky/not_found.rb
52
46
  - lib/risky/threadsafe.rb
47
+ - lib/risky/version.rb
48
+ - lib/risky/timestamps.rb
49
+ - lib/risky/indexes.rb
53
50
  - lib/risky/cron_list.rb
51
+ - lib/risky.rb
54
52
  - LICENSE
55
53
  - README.markdown
56
54
  has_rdoc: true
@@ -63,29 +61,25 @@ rdoc_options: []
63
61
  require_paths:
64
62
  - lib
65
63
  required_ruby_version: !ruby/object:Gem::Requirement
66
- none: false
67
64
  requirements:
68
65
  - - ">="
69
66
  - !ruby/object:Gem::Version
70
- hash: 59
71
67
  segments:
72
68
  - 1
73
69
  - 8
74
70
  - 6
75
71
  version: 1.8.6
76
72
  required_rubygems_version: !ruby/object:Gem::Requirement
77
- none: false
78
73
  requirements:
79
74
  - - ">="
80
75
  - !ruby/object:Gem::Version
81
- hash: 3
82
76
  segments:
83
77
  - 0
84
78
  version: "0"
85
79
  requirements: []
86
80
 
87
81
  rubyforge_project: risky
88
- rubygems_version: 1.3.7
82
+ rubygems_version: 1.3.6
89
83
  signing_key:
90
84
  specification_version: 3
91
85
  summary: A Ruby ORM for the Riak distributed database.