quicky 0.2.0 → 0.4.0

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.
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- quicky (0.2.0)
4
+ quicky (0.3.0)
5
5
 
6
6
  GEM
7
7
  remote: https://rubygems.org/
@@ -1 +1 @@
1
- require_relative 'quicky/timer'
1
+ require 'quicky/timer'
@@ -24,7 +24,7 @@ module Quicky
24
24
  def merge!(rh)
25
25
  rh.each_pair do |k, v|
26
26
  # v is a TimeCollector
27
- if self.has_key?(k)
27
+ if self.has_key?(k)
28
28
  self[k].merge!(v)
29
29
  else
30
30
  self[k] = v
@@ -1,4 +1,4 @@
1
- require_relative 'results_hash'
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
- name: self.name,
90
- count: self.count,
91
- duration: self.duration,
92
- total_duration: self.total_duration,
93
- max_duration: self.max_duration,
94
- min_duration: self.min_duration
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
 
@@ -1,3 +1,3 @@
1
1
  module Quicky
2
- VERSION = "0.2.0"
2
+ VERSION = "0.4.0"
3
3
  end
@@ -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.9")
18
+ gem.required_ruby_version = Gem::Requirement.new(">= 1.8")
19
19
 
20
20
  gem.add_development_dependency "test-unit"
21
21
 
@@ -1,4 +1,3 @@
1
- gem 'test-unit'
2
1
  require 'test/unit'
3
2
  require 'yaml'
4
3
  begin
@@ -15,4 +14,7 @@ class TestBase < Test::Unit::TestCase
15
14
 
16
15
 
17
16
  end
17
+
18
+ def test_fake
19
+ end
18
20
  end
@@ -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
- require_relative 'test_base'
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 |i|
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 |i|
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.2.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: 2012-11-16 00:00:00.000000000 Z
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.9'
61
+ version: '1.8'
62
62
  required_rubygems_version: !ruby/object:Gem::Requirement
63
63
  none: false
64
64
  requirements: