mongoid-colors 0.3.1 → 0.3.2
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/mongoid-colors/colorizer.rb +13 -10
- data/lib/mongoid-colors/version.rb +1 -1
- metadata +2 -2
@@ -52,16 +52,19 @@ module MongoidColors::Colorizer
|
|
52
52
|
when /^ *MOPED: (\S+:\S+) (\S+) +database=(\S+)( collection=(\S+))? (.*[^)])( \((.*)ms\))?$/
|
53
53
|
res = {:host => $1, :operation => $2, :database => $3, :collection => $5, :query => $6, :duration => $8}
|
54
54
|
if res[:operation] == 'COMMAND'
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
55
|
+
begin
|
56
|
+
command = eval(res[:query])
|
57
|
+
if command[:count]
|
58
|
+
res[:operation] = 'COUNT'
|
59
|
+
res[:collection] = command.delete(:count)
|
60
|
+
res[:query] = command.inspect
|
61
|
+
end
|
62
|
+
if command[:findAndModify]
|
63
|
+
res[:operation] = 'FIND AND MODIFY'
|
64
|
+
res[:collection] = command.delete(:findAndModify)
|
65
|
+
res[:query] = command.inspect
|
66
|
+
end
|
67
|
+
rescue Exception
|
65
68
|
end
|
66
69
|
end
|
67
70
|
res
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: mongoid-colors
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.3.
|
4
|
+
version: 0.3.2
|
5
5
|
prerelease:
|
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: 2013-02-
|
12
|
+
date: 2013-02-24 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: mongoid
|