oplog_event_handler 0.0.1 → 0.0.2
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.
- checksums.yaml +8 -8
- data/lib/oplog_event_handler.rb +10 -2
- metadata +4 -3
checksums.yaml
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
---
|
|
2
2
|
!binary "U0hBMQ==":
|
|
3
3
|
metadata.gz: !binary |-
|
|
4
|
-
|
|
4
|
+
YmM3NGYxNzRkYmExNzI4MWFlM2UzOGMyOTlkMzUyY2U4NzhjNjdmNw==
|
|
5
5
|
data.tar.gz: !binary |-
|
|
6
|
-
|
|
6
|
+
MzQyMGM2MTIzMTU2ZDUyNWRhYWEwZjBjODQ0ZDgyZDgyNGQwMGQxNA==
|
|
7
7
|
!binary "U0hBNTEy":
|
|
8
8
|
metadata.gz: !binary |-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
9
|
+
NDUyYjljYWUxNzZjZTYwN2YzNGY3NDA0ZmQ1OTg4MWZiOGU1ZWFlNzU0ZGMz
|
|
10
|
+
OTQ4OTQwYTI3YTM0N2I0MmIzMmM3MGVlMmEzODQwNDdkNWZkZGY1ZDAzODA3
|
|
11
|
+
Y2U2ZTdhNjQxZjI1NGQyOWQxMjk0ODk2MDFkYzY4YjE4MmJiMmU=
|
|
12
12
|
data.tar.gz: !binary |-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
13
|
+
ZjlmZDBjNmJlM2Q2ZDg4NDhiZGNmMmYwOTlhMTk1YzEyOWVkYTI1NmMyNzk0
|
|
14
|
+
NDJlY2RlODhkZmViMDY1YTJhN2JlYTljYjQ4OWJlYWNmZTViY2IxYTg0NDAz
|
|
15
|
+
ZDZiN2ZkOTIzZjI4Zjk0MjEzZDQzN2RlNjIwMmQ4MGU5ZjkyNTk=
|
data/lib/oplog_event_handler.rb
CHANGED
|
@@ -31,6 +31,14 @@ module OplogEventHandler
|
|
|
31
31
|
@db_name
|
|
32
32
|
end
|
|
33
33
|
|
|
34
|
+
def set_oplog_name(name)
|
|
35
|
+
@oplog_name = name
|
|
36
|
+
end
|
|
37
|
+
|
|
38
|
+
def oplog_name
|
|
39
|
+
@oplog_name || 'oplog.rs'
|
|
40
|
+
end
|
|
41
|
+
|
|
34
42
|
def for_db(db)
|
|
35
43
|
@db_name = db
|
|
36
44
|
yield
|
|
@@ -148,7 +156,7 @@ module OplogEventHandler
|
|
|
148
156
|
end
|
|
149
157
|
|
|
150
158
|
def tail
|
|
151
|
-
oplog_coll = Mongo::Connection.new(self.class.host, self.class.port)['local'][
|
|
159
|
+
oplog_coll = Mongo::Connection.new(self.class.host, self.class.port)['local'][self.class.oplog_name]
|
|
152
160
|
start = oplog_coll.count
|
|
153
161
|
tailable_oplog = Mongo::Cursor.new(oplog_coll, :timeout => false, :tailable => true).skip(start)
|
|
154
162
|
while not tailable_oplog.closed?
|
|
@@ -160,4 +168,4 @@ module OplogEventHandler
|
|
|
160
168
|
end
|
|
161
169
|
end
|
|
162
170
|
end
|
|
163
|
-
end
|
|
171
|
+
end
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: oplog_event_handler
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.0.
|
|
4
|
+
version: 0.0.2
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Mathieu Laporte
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date:
|
|
11
|
+
date: 2014-01-14 00:00:00.000000000 Z
|
|
12
12
|
dependencies: []
|
|
13
13
|
description: Just parse the oplog
|
|
14
14
|
email: mathieu.laporte+rubygem@gmail.com
|
|
@@ -36,8 +36,9 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
36
36
|
version: '0'
|
|
37
37
|
requirements: []
|
|
38
38
|
rubyforge_project:
|
|
39
|
-
rubygems_version: 2.0.
|
|
39
|
+
rubygems_version: 2.0.6
|
|
40
40
|
signing_key:
|
|
41
41
|
specification_version: 4
|
|
42
42
|
summary: oplog parser
|
|
43
43
|
test_files: []
|
|
44
|
+
has_rdoc:
|