rails-ext 0.3.16 → 0.3.17

Sign up to get free protection for your applications and to get access to all the features.
data/.git/index CHANGED
Binary file
data/.git/logs/HEAD CHANGED
@@ -68,3 +68,5 @@ f7be86378738705bbd1f97dd8be92c3cc7d54a66 947bf4d6e7e81d5ca62a381caa8d761a9c43cf8
68
68
  e2df18fc21e446588205694aef1de7d63ca31b4f cda2dd4b5ecbc69fa1b1ebf09c580ba17bf69656 alex <alex@amac.local> 1272149564 +0400 commit: fix sunspot for MM
69
69
  cda2dd4b5ecbc69fa1b1ebf09c580ba17bf69656 268fe011dd9d01aa6e05c2004280b78e149ea29e alex <alex@amac.local> 1272149595 +0400 commit: fix sunspot for MM
70
70
  268fe011dd9d01aa6e05c2004280b78e149ea29e 4001df088dada11d1dc4f0a197f3ee74db62a376 alex <alex@amac.local> 1272706336 +0400 commit: upd
71
+ 4001df088dada11d1dc4f0a197f3ee74db62a376 6d8daa98dd7a0922a838ee0d274247693d7d9ac2 alex <alex@amac.local> 1272710100 +0400 commit: upd
72
+ 6d8daa98dd7a0922a838ee0d274247693d7d9ac2 3566bd5be950e4b626366b4cb2909838729bc66c alex <alex@amac.local> 1272710613 +0400 commit: upd
@@ -68,3 +68,5 @@ f7be86378738705bbd1f97dd8be92c3cc7d54a66 947bf4d6e7e81d5ca62a381caa8d761a9c43cf8
68
68
  e2df18fc21e446588205694aef1de7d63ca31b4f cda2dd4b5ecbc69fa1b1ebf09c580ba17bf69656 alex <alex@amac.local> 1272149564 +0400 commit: fix sunspot for MM
69
69
  cda2dd4b5ecbc69fa1b1ebf09c580ba17bf69656 268fe011dd9d01aa6e05c2004280b78e149ea29e alex <alex@amac.local> 1272149595 +0400 commit: fix sunspot for MM
70
70
  268fe011dd9d01aa6e05c2004280b78e149ea29e 4001df088dada11d1dc4f0a197f3ee74db62a376 alex <alex@amac.local> 1272706336 +0400 commit: upd
71
+ 4001df088dada11d1dc4f0a197f3ee74db62a376 6d8daa98dd7a0922a838ee0d274247693d7d9ac2 alex <alex@amac.local> 1272710100 +0400 commit: upd
72
+ 6d8daa98dd7a0922a838ee0d274247693d7d9ac2 3566bd5be950e4b626366b4cb2909838729bc66c alex <alex@amac.local> 1272710613 +0400 commit: upd
@@ -54,3 +54,5 @@ f7be86378738705bbd1f97dd8be92c3cc7d54a66 947bf4d6e7e81d5ca62a381caa8d761a9c43cf8
54
54
  e2df18fc21e446588205694aef1de7d63ca31b4f cda2dd4b5ecbc69fa1b1ebf09c580ba17bf69656 alex <alex@amac.local> 1272149569 +0400 update by push
55
55
  cda2dd4b5ecbc69fa1b1ebf09c580ba17bf69656 268fe011dd9d01aa6e05c2004280b78e149ea29e alex <alex@amac.local> 1272149600 +0400 update by push
56
56
  268fe011dd9d01aa6e05c2004280b78e149ea29e 4001df088dada11d1dc4f0a197f3ee74db62a376 alex <alex@amac.local> 1272706342 +0400 update by push
57
+ 4001df088dada11d1dc4f0a197f3ee74db62a376 6d8daa98dd7a0922a838ee0d274247693d7d9ac2 alex <alex@amac.local> 1272710105 +0400 update by push
58
+ 6d8daa98dd7a0922a838ee0d274247693d7d9ac2 3566bd5be950e4b626366b4cb2909838729bc66c alex <alex@amac.local> 1272710619 +0400 update by push
@@ -0,0 +1,3 @@
1
+ x��A
2
+ 1 E]�� Ҧ�&��I"
3
+ 3� �������<���2Ϗ��C_�a,lCIeh�"�D3դ��NC���G/Y�١�Hc3���3�GC*X��ld{�l��� ����ݫ̢�iQ�.���R�)�1���~u������<�
@@ -1 +1 @@
1
- 4001df088dada11d1dc4f0a197f3ee74db62a376
1
+ 3566bd5be950e4b626366b4cb2909838729bc66c
@@ -1 +1 @@
1
- 4001df088dada11d1dc4f0a197f3ee74db62a376
1
+ 3566bd5be950e4b626366b4cb2909838729bc66c
data/Rakefile CHANGED
@@ -18,7 +18,7 @@ require 'fileutils'
18
18
 
19
19
  spec = Gem::Specification.new do |s|
20
20
  s.name = "rails-ext"
21
- s.version = "0.3.16"
21
+ s.version = "0.3.17"
22
22
  s.summary = "Set of common Ruby on Rails extensions"
23
23
  s.description = "Set of common Ruby on Rails extensions"
24
24
  s.author = "Alexey Petrushin"
@@ -0,0 +1,44 @@
1
+ # Measures MongoDB requests time and adds it to log
2
+
3
+ if defined?(Rails) and RAILS_ENV == 'development'
4
+ Mongo::Connection.class_eval do
5
+ def send_message_with_time operation, message, log_message=nil
6
+ begin
7
+ logger = @logger
8
+ @logger = nil
9
+ t = Time.now
10
+ send_message_without_time operation, message, log_message
11
+ ensure
12
+ logger.debug(" MONGODB (#{Time.now - t}) #{log_message || message}") if logger
13
+ @logger = logger
14
+ end
15
+ end
16
+ alias_method_chain :send_message, :time
17
+
18
+ def send_message_with_safe_check_with_time operation, message, db_name, log_message=nil
19
+ begin
20
+ logger = @logger
21
+ @logger = nil
22
+ t = Time.now
23
+ send_message_with_safe_check_without_time operation, message, db_name, log_message
24
+ ensure
25
+ logger.debug(" MONGODB (#{Time.now - t}) #{log_message || message}") if logger
26
+ @logger = logger
27
+ end
28
+ end
29
+ alias_method_chain :send_message_with_safe_check, :time
30
+
31
+ def receive_message_with_time operation, message, log_message=nil, socket=nil
32
+ begin
33
+ logger = @logger
34
+ @logger = nil
35
+ t = Time.now
36
+ receive_message_without_time operation, message, log_message, socket
37
+ ensure
38
+ logger.debug(" MONGODB (#{Time.now - t}) #{log_message || message}") if logger
39
+ @logger = logger
40
+ end
41
+ end
42
+ alias_method_chain :receive_message, :time
43
+ end
44
+ end
@@ -2,8 +2,8 @@ require 'mongo_mapper'
2
2
 
3
3
 
4
4
  [
5
- 'fixes',
6
- 'support',
5
+ 'hacks/fixes',
6
+ 'hacks/time_measuring',
7
7
  'migration',
8
8
  'mongo_mapper',
9
9
  'view_helpers',
metadata CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
5
5
  segments:
6
6
  - 0
7
7
  - 3
8
- - 16
9
- version: 0.3.16
8
+ - 17
9
+ version: 0.3.17
10
10
  platform: ruby
11
11
  authors:
12
12
  - Alexey Petrushin
@@ -67,6 +67,7 @@ files:
67
67
  - .git/objects/00/fd8045e0953bb11a521248dc27d4af2336c6d5
68
68
  - .git/objects/02/12d2da342b1ab3c0e7a7f2770686a7bb5d7806
69
69
  - .git/objects/02/469b717b4bd61ad27a3fe664ce0646a8325399
70
+ - .git/objects/03/3c38dc100f22a049c8be12ab9209245c9bd91e
70
71
  - .git/objects/03/9e318355ab5ab32c3b6bc634d3d8e64f444ef8
71
72
  - .git/objects/04/cd62e7f8158fe54d21e6f63617c43b593b8b59
72
73
  - .git/objects/05/0098e3b05f41a672127d5e730d322cec84e21c
@@ -177,6 +178,7 @@ files:
177
178
  - .git/objects/33/9755448515fb77f691d6197bd65d5b5d53fc24
178
179
  - .git/objects/34/e6093e9cd6ecc08b1a1834418e83bb277e8887
179
180
  - .git/objects/35/0b6a89c8f9704cb4f1e037ea638e952a487017
181
+ - .git/objects/35/66bd5be950e4b626366b4cb2909838729bc66c
180
182
  - .git/objects/35/a5ef969e9dd65a06260954e2b66f7a7f107568
181
183
  - .git/objects/35/d78424bc393bb5acc12c52c031129aa3ceb8c5
182
184
  - .git/objects/36/66d56066f3aeb0f9fc342de42f25e298341a61
@@ -299,6 +301,7 @@ files:
299
301
  - .git/objects/6c/e5f7ee8ecbaa20a264bb2f2fb2fd821b5ad478
300
302
  - .git/objects/6d/6bfb690cccf36d947eaafd79a19b0974afb65a
301
303
  - .git/objects/6d/85efe0589aa745a632d38314b7b5902a8874c0
304
+ - .git/objects/6d/8daa98dd7a0922a838ee0d274247693d7d9ac2
302
305
  - .git/objects/6d/f725e3519872a75bc763045f00d8844eb890cf
303
306
  - .git/objects/6e/219f25648b06b04f407a66b40a818c7fccfb29
304
307
  - .git/objects/6e/5b3a02689a2990455d28c514d8e2885d004fdb
@@ -329,6 +332,7 @@ files:
329
332
  - .git/objects/7a/d62f1e2a8e4af39d293ce70c5dca999263ab4e
330
333
  - .git/objects/7b/469d63569dcc92c82f90fc7a48793c31365f9a
331
334
  - .git/objects/7b/5c4d98eb195890b76abb20b73014d23554e655
335
+ - .git/objects/7b/797f342ba8dfa60c25492c142ddd7499243de0
332
336
  - .git/objects/7b/f12fa27542b09a968ac9b1ceedc1a71bfd6ce8
333
337
  - .git/objects/7c/d6496ed2dbb6dc550d2080954a5485bff16e7f
334
338
  - .git/objects/7c/ecdf8b52167f490bafb6948b0413855923e3d4
@@ -340,6 +344,7 @@ files:
340
344
  - .git/objects/80/4a20e92f38623945cdb50ed8864d014632cf44
341
345
  - .git/objects/81/156e1461b12b90f0dc2604458317ca8f5d45c0
342
346
  - .git/objects/81/d4aa3b627dfc7397ce3f71577a8307324b8289
347
+ - .git/objects/81/e506fe8796b432c7d3aa075a5f5844c839a23a
343
348
  - .git/objects/82/0190b802ed213aab7a56a928a09db06e2a90a2
344
349
  - .git/objects/82/03c2c6cdd29e1e20e88fbb81e63b7ea1ec2899
345
350
  - .git/objects/82/4ac01aecaa766ea8a7b10ef9d9f67810fdff40
@@ -361,6 +366,7 @@ files:
361
366
  - .git/objects/8a/d2c8f5ee0627cf48aa39d5f10578f929bfc2c5
362
367
  - .git/objects/8b/7fd3b87e0f2fce82705c50e7c48f9496b7666e
363
368
  - .git/objects/8c/4648d7c914e9d60dc387ff801c97b2d19c97f7
369
+ - .git/objects/8c/4e121b4974d4af5345bf2e8f13bff7c7b494a1
364
370
  - .git/objects/8c/b356ae2ff8011edfa68c9683ffeca358213d12
365
371
  - .git/objects/8d/4dcde8df4da8f53f5f5313757b907e9aa1af66
366
372
  - .git/objects/8e/3cfb391de711b5fecfbdf2860fa37b019e8036
@@ -407,6 +413,7 @@ files:
407
413
  - .git/objects/9e/a42bcef6b76af65d741384e13c24b8072637d1
408
414
  - .git/objects/9f/0f3e54458d429dd2a1c04e4671398cfa37d595
409
415
  - .git/objects/9f/51dc5633e91af5d39c5eb1603fb090a4124fff
416
+ - .git/objects/9f/7e8cf81f84ab806192de77a3351b4523fcd057
410
417
  - .git/objects/9f/91a2fdd59ecdfb4f8f5025fdbe590eb536e96f
411
418
  - .git/objects/9f/9e3b465a61007276d8fb8246f19fb9700a2667
412
419
  - .git/objects/a0/90ab2a9e739787b6090c187acf95fdd763afef
@@ -456,6 +463,7 @@ files:
456
463
  - .git/objects/b4/0345153922bfcdbbc4785cc3146e9e7c60dbbd
457
464
  - .git/objects/b4/228251babf3a84ac181d462fdd383816bd23b8
458
465
  - .git/objects/b4/343d9284a89e2971022f8d4acf7865d8341c6d
466
+ - .git/objects/b4/8d541459e8aa79ac3761cec8ce7567f89e8ebe
459
467
  - .git/objects/b4/eb909dd819bf870d2445bddc0d7f00678b11b6
460
468
  - .git/objects/b5/15828bb32356501aa81bb4e808ea5d7d77f068
461
469
  - .git/objects/b5/33c1c1bca9eae5b7e75c639fff8ec2c2f9fea1
@@ -536,6 +544,7 @@ files:
536
544
  - .git/objects/dc/773412a3a73c02f34edfaeadc89473cfe61c40
537
545
  - .git/objects/dc/d404a6183c1b2160add042127ada7ff83c9b7c
538
546
  - .git/objects/dc/e1fc65f9462792558151feab3fa64abf3a229f
547
+ - .git/objects/dd/3a0aa57ce643ce2ab757237040de6fb4692fc9
539
548
  - .git/objects/dd/a1f7a239fae8c8a259b10eebb45003194a840b
540
549
  - .git/objects/dd/ad36d883dd04cb1b68f0f81d5b3fa98b8551e3
541
550
  - .git/objects/de/10bee1e91cfbd53ccaa073aada68cbfeac22d8
@@ -556,6 +565,7 @@ files:
556
565
  - .git/objects/e3/c22b30641292e851811969cbc0f9ceb5b1ac05
557
566
  - .git/objects/e3/cde2715e3e3870a5d7312cac9bbf6e24259e0f
558
567
  - .git/objects/e4/1d46e33f52e07b836b966d58677fc2a864a4a4
568
+ - .git/objects/e4/61e9a3d5ca734705d0af309b72b4725687256e
559
569
  - .git/objects/e4/d7cacac2d7e66df5a7c21eaae71c0a90f1439d
560
570
  - .git/objects/e5/18de391d5b9dee87ec6f749900785f3b24dad0
561
571
  - .git/objects/e5/7fa5fd7f10f6f532742b0cc2dc3edaed6c0763
@@ -639,7 +649,8 @@ files:
639
649
  - lib/interface_builder/view_helper.rb
640
650
  - lib/interface_builder.rb
641
651
  - lib/mongo_mapper_ext/db_config.rb
642
- - lib/mongo_mapper_ext/fixes.rb
652
+ - lib/mongo_mapper_ext/hacks/fixes.rb
653
+ - lib/mongo_mapper_ext/hacks/time_measuring.rb
643
654
  - lib/mongo_mapper_ext/micelaneous.rb
644
655
  - lib/mongo_mapper_ext/migrate.rake
645
656
  - lib/mongo_mapper_ext/migration.rb
@@ -648,7 +659,6 @@ files:
648
659
  - lib/mongo_mapper_ext/plugins/default_scope.rb
649
660
  - lib/mongo_mapper_ext/plugins/micelaneous.rb
650
661
  - lib/mongo_mapper_ext/spec_helper.rb
651
- - lib/mongo_mapper_ext/support.rb
652
662
  - lib/mongo_mapper_ext/view_helpers.rb
653
663
  - lib/mongo_mapper_ext.rb
654
664
  - lib/rails_ext/action_controller/global_path_prefix.rb
@@ -1,42 +0,0 @@
1
- # Log also operation time time to logs
2
-
3
- Mongo::Connection.class_eval do
4
- def send_message_with_time operation, message, log_message=nil
5
- begin
6
- logger = @logger
7
- @logger = nil
8
- t = Time.now
9
- send_message_without_time operation, message, log_message
10
- ensure
11
- logger.debug(" MONGODB (#{Time.now - t}) #{log_message || message}") if logger
12
- @logger = logger
13
- end
14
- end
15
- alias_method_chain :send_message, :time
16
-
17
- def send_message_with_safe_check_with_time operation, message, db_name, log_message=nil
18
- begin
19
- logger = @logger
20
- @logger = nil
21
- t = Time.now
22
- send_message_with_safe_check_without_time operation, message, db_name, log_message
23
- ensure
24
- logger.debug(" MONGODB (#{Time.now - t}) #{log_message || message}") if logger
25
- @logger = logger
26
- end
27
- end
28
- alias_method_chain :send_message_with_safe_check, :time
29
-
30
- def receive_message_with_time operation, message, log_message=nil, socket=nil
31
- begin
32
- logger = @logger
33
- @logger = nil
34
- t = Time.now
35
- receive_message_without_time operation, message, log_message, socket
36
- ensure
37
- logger.debug(" MONGODB (#{Time.now - t}) #{log_message || message}") if logger
38
- @logger = logger
39
- end
40
- end
41
- alias_method_chain :receive_message, :time
42
- end
File without changes