quicky 0.2.0 → 0.4.0
Sign up to get free protection for your applications and to get access to all the features.
- data/Gemfile.lock +1 -1
- data/lib/quicky.rb +1 -1
- data/lib/quicky/results_hash.rb +1 -1
- data/lib/quicky/timer.rb +10 -8
- data/lib/quicky/version.rb +1 -1
- data/quicky.gemspec +1 -1
- data/test/test_base.rb +3 -1
- data/test/test_basics.rb +3 -4
- metadata +3 -3
data/Gemfile.lock
CHANGED
data/lib/quicky.rb
CHANGED
@@ -1 +1 @@
|
|
1
|
-
|
1
|
+
require 'quicky/timer'
|
data/lib/quicky/results_hash.rb
CHANGED
data/lib/quicky/timer.rb
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
|
1
|
+
require 'quicky/results_hash'
|
2
2
|
|
3
3
|
module Quicky
|
4
4
|
|
@@ -56,7 +56,7 @@ module Quicky
|
|
56
56
|
class TimeCollector
|
57
57
|
INT_MAX = ((2 ** (32 - 2)) - 1)
|
58
58
|
|
59
|
-
attr_accessor :name, :total_duration, :count, :max_duration, :min_duration
|
59
|
+
attr_accessor :created_at, :name, :total_duration, :count, :max_duration, :min_duration
|
60
60
|
|
61
61
|
def initialize(name)
|
62
62
|
@name = name
|
@@ -65,6 +65,7 @@ module Quicky
|
|
65
65
|
@max_duration = 0.0
|
66
66
|
@min_duration = INT_MAX
|
67
67
|
@count = 0
|
68
|
+
@created_at = Time.now
|
68
69
|
end
|
69
70
|
|
70
71
|
def <<(val)
|
@@ -86,12 +87,13 @@ module Quicky
|
|
86
87
|
|
87
88
|
def to_hash
|
88
89
|
{
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
90
|
+
:created_at => self.created_at,
|
91
|
+
:name => self.name,
|
92
|
+
:count => self.count,
|
93
|
+
:duration => self.duration,
|
94
|
+
:total_duration => self.total_duration,
|
95
|
+
:max_duration => self.max_duration,
|
96
|
+
:min_duration => self.min_duration
|
95
97
|
}
|
96
98
|
end
|
97
99
|
|
data/lib/quicky/version.rb
CHANGED
data/quicky.gemspec
CHANGED
@@ -15,7 +15,7 @@ Gem::Specification.new do |gem|
|
|
15
15
|
gem.version = Quicky::VERSION
|
16
16
|
|
17
17
|
gem.required_rubygems_version = ">= 1.3.6"
|
18
|
-
gem.required_ruby_version = Gem::Requirement.new(">= 1.
|
18
|
+
gem.required_ruby_version = Gem::Requirement.new(">= 1.8")
|
19
19
|
|
20
20
|
gem.add_development_dependency "test-unit"
|
21
21
|
|
data/test/test_base.rb
CHANGED
data/test/test_basics.rb
CHANGED
@@ -1,9 +1,8 @@
|
|
1
1
|
# Put config.yml file in ~/Dropbox/configs/ironmq_gem/test/config.yml
|
2
2
|
|
3
|
-
gem 'test-unit'
|
4
3
|
require 'test/unit'
|
5
4
|
require 'yaml'
|
6
|
-
|
5
|
+
require 'test_base'
|
7
6
|
|
8
7
|
class TestBasics < TestBase
|
9
8
|
def setup
|
@@ -19,7 +18,7 @@ class TestBasics < TestBase
|
|
19
18
|
assert quicky.results(:test1).duration > 2
|
20
19
|
|
21
20
|
quicky = Quicky::Timer.new
|
22
|
-
quicky.loop(:test2, 10) do
|
21
|
+
quicky.loop(:test2, 10) do
|
23
22
|
puts 'sleeping'
|
24
23
|
sleep 1
|
25
24
|
end
|
@@ -29,7 +28,7 @@ class TestBasics < TestBase
|
|
29
28
|
assert quicky.results(:test2).total_duration >= 10
|
30
29
|
|
31
30
|
quicky = Quicky::Timer.new
|
32
|
-
quicky.loop_for(:test3, 10) do
|
31
|
+
quicky.loop_for(:test3, 10) do
|
33
32
|
puts 'sleeping'
|
34
33
|
sleep 0.5
|
35
34
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: quicky
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.4.0
|
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:
|
12
|
+
date: 2013-01-14 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: test-unit
|
@@ -58,7 +58,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
58
58
|
requirements:
|
59
59
|
- - ! '>='
|
60
60
|
- !ruby/object:Gem::Version
|
61
|
-
version: '1.
|
61
|
+
version: '1.8'
|
62
62
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
63
63
|
none: false
|
64
64
|
requirements:
|