moped 1.0.0.beta → 1.0.0.rc
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of moped might be problematic. Click here for more details.
- data/LICENSE +20 -0
- data/README.md +11 -8
- data/lib/moped/bson.rb +17 -0
- data/lib/moped/bson/extensions/hash.rb +2 -2
- data/lib/moped/bson/extensions/regexp.rb +2 -2
- data/lib/moped/bson/extensions/symbol.rb +13 -3
- data/lib/moped/cluster.rb +96 -39
- data/lib/moped/collection.rb +54 -31
- data/lib/moped/connection.rb +152 -47
- data/lib/moped/cursor.rb +91 -34
- data/lib/moped/database.rb +52 -20
- data/lib/moped/errors.rb +52 -22
- data/lib/moped/indexes.rb +53 -27
- data/lib/moped/logging.rb +35 -2
- data/lib/moped/node.rb +316 -126
- data/lib/moped/protocol/delete.rb +1 -0
- data/lib/moped/protocol/get_more.rb +1 -0
- data/lib/moped/protocol/insert.rb +1 -0
- data/lib/moped/protocol/kill_cursors.rb +1 -0
- data/lib/moped/protocol/message.rb +0 -2
- data/lib/moped/protocol/query.rb +1 -0
- data/lib/moped/protocol/update.rb +1 -0
- data/lib/moped/query.rb +183 -113
- data/lib/moped/session.rb +148 -96
- data/lib/moped/threaded.rb +41 -5
- data/lib/moped/version.rb +1 -1
- metadata +5 -5
- data/MIT_LICENSE +0 -19
data/lib/moped/threaded.rb
CHANGED
@@ -9,22 +9,58 @@ module Moped
|
|
9
9
|
module Threaded
|
10
10
|
extend self
|
11
11
|
|
12
|
-
# Begin a thread
|
12
|
+
# Begin entry into a named thread local stack.
|
13
|
+
#
|
14
|
+
# @example Begin entry into the stack.
|
15
|
+
# Threaded.begin(:create)
|
16
|
+
#
|
17
|
+
# @param [ String ] name The name of the stack.
|
18
|
+
#
|
19
|
+
# @return [ true ] True.
|
20
|
+
#
|
21
|
+
# @since 1.0.0
|
13
22
|
def begin(name)
|
14
|
-
stack(name).push
|
23
|
+
stack(name).push(true)
|
15
24
|
end
|
16
25
|
|
17
|
-
#
|
26
|
+
# Are in the middle of executing the named stack
|
27
|
+
#
|
28
|
+
# @example Are we in the stack execution?
|
29
|
+
# Threaded.executing?(:create)
|
30
|
+
#
|
31
|
+
# @param [ Symbol ] name The name of the stack.
|
32
|
+
#
|
33
|
+
# @return [ true ] If the stack is being executed.
|
34
|
+
#
|
35
|
+
# @since 1.0.0
|
18
36
|
def executing?(name)
|
19
37
|
!stack(name).empty?
|
20
38
|
end
|
21
39
|
|
22
|
-
#
|
40
|
+
# Exit from a named thread local stack.
|
41
|
+
#
|
42
|
+
# @example Exit from the stack.
|
43
|
+
# Threaded.end(:create)
|
44
|
+
#
|
45
|
+
# @param [ Symbol ] name The name of the stack
|
46
|
+
#
|
47
|
+
# @return [ true ] True.
|
48
|
+
#
|
49
|
+
# @since 1.0.0
|
23
50
|
def end(name)
|
24
51
|
stack(name).pop
|
25
52
|
end
|
26
53
|
|
27
|
-
#
|
54
|
+
# Get the named stack.
|
55
|
+
#
|
56
|
+
# @example Get a stack by name
|
57
|
+
# Threaded.stack(:create)
|
58
|
+
#
|
59
|
+
# @param [ Symbol ] name The name of the stack
|
60
|
+
#
|
61
|
+
# @return [ Array ] The stack.
|
62
|
+
#
|
63
|
+
# @since 1.0.0
|
28
64
|
def stack(name)
|
29
65
|
Thread.current["[moped]:#{name}-stack"] ||= []
|
30
66
|
end
|
data/lib/moped/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: moped
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.0.
|
4
|
+
version: 1.0.0.rc
|
5
5
|
prerelease: 6
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2012-
|
12
|
+
date: 2012-05-28 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rspec
|
@@ -99,7 +99,7 @@ files:
|
|
99
99
|
- lib/moped/threaded.rb
|
100
100
|
- lib/moped/version.rb
|
101
101
|
- lib/moped.rb
|
102
|
-
-
|
102
|
+
- LICENSE
|
103
103
|
- README.md
|
104
104
|
homepage: http://mongoid.org/moped
|
105
105
|
licenses: []
|
@@ -115,7 +115,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
115
115
|
version: '0'
|
116
116
|
segments:
|
117
117
|
- 0
|
118
|
-
hash:
|
118
|
+
hash: 300852990070970581
|
119
119
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
120
120
|
none: false
|
121
121
|
requirements:
|
@@ -124,7 +124,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
124
124
|
version: 1.3.1
|
125
125
|
requirements: []
|
126
126
|
rubyforge_project:
|
127
|
-
rubygems_version: 1.8.
|
127
|
+
rubygems_version: 1.8.24
|
128
128
|
signing_key:
|
129
129
|
specification_version: 3
|
130
130
|
summary: A MongoDB driver for Ruby.
|
data/MIT_LICENSE
DELETED
@@ -1,19 +0,0 @@
|
|
1
|
-
Copyright (C) 2011 Bernerd Schaefer
|
2
|
-
|
3
|
-
Permission is hereby granted, free of charge, to any person obtaining a copy of
|
4
|
-
this software and associated documentation files (the "Software"), to deal in
|
5
|
-
the Software without restriction, including without limitation the rights to
|
6
|
-
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
|
7
|
-
of the Software, and to permit persons to whom the Software is furnished to do
|
8
|
-
so, subject to the following conditions:
|
9
|
-
|
10
|
-
The above copyright notice and this permission notice shall be included in all
|
11
|
-
copies or substantial portions of the Software.
|
12
|
-
|
13
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
14
|
-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
15
|
-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
16
|
-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
17
|
-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
18
|
-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
19
|
-
SOFTWARE.
|