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.
@@ -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
- command = eval(res[:query])
56
- if command[:count]
57
- res[:operation] = 'COUNT'
58
- res[:collection] = command.delete(:count)
59
- res[:query] = command.inspect
60
- end
61
- if command[:findAndModify]
62
- res[:operation] = 'FIND AND MODIFY'
63
- res[:collection] = command.delete(:findAndModify)
64
- res[:query] = command.inspect
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
@@ -1,3 +1,3 @@
1
1
  module MongoidColors
2
- VERSION = '0.3.1'
2
+ VERSION = '0.3.2'
3
3
  end
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.1
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-22 00:00:00.000000000 Z
12
+ date: 2013-02-24 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: mongoid