glimpse-redis 1.0.0 → 1.0.1

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.
data/CHANGELOG.md ADDED
@@ -0,0 +1,7 @@
1
+ # 1.0.0
2
+
3
+ - Initial release.
4
+
5
+ # 1.0.1
6
+
7
+ - Fixed a bug where Redis::Client may have a block passed to some methods and if not passed would return 0 instead of true or false.
@@ -17,5 +17,6 @@ Gem::Specification.new do |gem|
17
17
  gem.test_files = gem.files.grep(%r{^(test|spec|features)/})
18
18
  gem.require_paths = ['lib']
19
19
 
20
+ gem.add_dependency 'glimpse'
20
21
  gem.add_dependency 'redis'
21
22
  end
@@ -8,9 +8,9 @@ class Redis::Client
8
8
  self.query_count = 0
9
9
  self.query_time = 0
10
10
 
11
- def call_with_timing(*args)
11
+ def call_with_timing(*args, &block)
12
12
  start = Time.now
13
- call_without_timing(*args)
13
+ call_without_timing(*args, &block)
14
14
  ensure
15
15
  Redis::Client.query_time += (Time.now - start)
16
16
  Redis::Client.query_count += 1
@@ -26,7 +26,12 @@ module Glimpse
26
26
  end
27
27
 
28
28
  def formatted_duration
29
- "%.2fms" % (duration * 1000)
29
+ ms = duration * 1000
30
+ if ms >= 1000
31
+ "%.2fms" % ms
32
+ else
33
+ "%.0fms" % ms
34
+ end
30
35
  end
31
36
 
32
37
  def calls
@@ -1,5 +1,5 @@
1
1
  module Glimpse
2
2
  module Redis
3
- VERSION = '1.0.0'
3
+ VERSION = '1.0.1'
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: glimpse-redis
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0
4
+ version: 1.0.1
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,8 +9,24 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2013-03-09 00:00:00.000000000 Z
12
+ date: 2013-03-11 00:00:00.000000000 Z
13
13
  dependencies:
14
+ - !ruby/object:Gem::Dependency
15
+ name: glimpse
16
+ requirement: !ruby/object:Gem::Requirement
17
+ none: false
18
+ requirements:
19
+ - - ! '>='
20
+ - !ruby/object:Gem::Version
21
+ version: '0'
22
+ type: :runtime
23
+ prerelease: false
24
+ version_requirements: !ruby/object:Gem::Requirement
25
+ none: false
26
+ requirements:
27
+ - - ! '>='
28
+ - !ruby/object:Gem::Version
29
+ version: '0'
14
30
  - !ruby/object:Gem::Dependency
15
31
  name: redis
16
32
  requirement: !ruby/object:Gem::Requirement
@@ -35,6 +51,7 @@ extensions: []
35
51
  extra_rdoc_files: []
36
52
  files:
37
53
  - .gitignore
54
+ - CHANGELOG.md
38
55
  - Gemfile
39
56
  - LICENSE.txt
40
57
  - README.md