conscriptor 0.1.0 → 0.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/conscriptor.rb +2 -2
- data/lib/conscriptor/event_counter.rb +2 -2
- data/lib/conscriptor/progress_reporter.rb +2 -2
- data/lib/conscriptor/simple_logger.rb +9 -0
- data/lib/conscriptor/version.rb +1 -1
- metadata +2 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 813e5ddcaf6c0f60392cce10af1a7fc2a19d8ca6cb00c841e84a47a270b37c32
|
4
|
+
data.tar.gz: 93613e8f1f1289eb0b3051d570620dadf24eb58758a729d3833eec70382d5cca
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 693c6ec028d4d6b57359cf841432b27a48e0897c7dfc40579d4fee5fe84f24bac04d62d6f371c46e60e8dba8dc6681f7c8566865059bcd4d01dcab77f0894b1a
|
7
|
+
data.tar.gz: 503c1413da9063b4a8031060a7917240ce2fa0038897cd71515b10f41d0fb070c4624822c02bfa1124a7b9c3927048c70943232961a5655cd867a6c7a3efed19
|
data/lib/conscriptor.rb
CHANGED
@@ -88,8 +88,8 @@ module Conscriptor
|
|
88
88
|
|
89
89
|
# usage:
|
90
90
|
# start_timer total: Lesson.count, report_every: 100
|
91
|
-
def start_timer(name: nil, total: nil, report_every: nil,
|
92
|
-
@progress = Conscriptor::ProgressReporter.new(name: name, total: total, report_every: report_every,
|
91
|
+
def start_timer(name: nil, total: nil, report_every: nil, logger: nil)
|
92
|
+
@progress = Conscriptor::ProgressReporter.new(name: name, total: total, report_every: report_every, logger: logger)
|
93
93
|
end
|
94
94
|
|
95
95
|
def inc_timer(by: 1)
|
@@ -1,11 +1,11 @@
|
|
1
1
|
require_relative './histogram'
|
2
|
-
|
2
|
+
require_relative './simple_logger'
|
3
3
|
|
4
4
|
module Conscriptor
|
5
5
|
class EventCounter
|
6
6
|
include Histogram
|
7
7
|
|
8
|
-
def initialize(logger=
|
8
|
+
def initialize(logger=simple_logger)
|
9
9
|
@logger = logger
|
10
10
|
clear
|
11
11
|
end
|
@@ -1,4 +1,4 @@
|
|
1
|
-
|
1
|
+
require_relative './simple_logger'
|
2
2
|
|
3
3
|
module Conscriptor
|
4
4
|
class ProgressReporter
|
@@ -8,7 +8,7 @@ module Conscriptor
|
|
8
8
|
@name = name
|
9
9
|
@total = total
|
10
10
|
@report_every = report_every || 1
|
11
|
-
@logger = logger ||
|
11
|
+
@logger = logger || simple_logger
|
12
12
|
@count = 0
|
13
13
|
@start_time = Time.now
|
14
14
|
end
|
data/lib/conscriptor/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: conscriptor
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jeremy Lightsmith
|
@@ -25,6 +25,7 @@ files:
|
|
25
25
|
- lib/conscriptor/histogram.rb
|
26
26
|
- lib/conscriptor/progress_reporter.rb
|
27
27
|
- lib/conscriptor/say.rb
|
28
|
+
- lib/conscriptor/simple_logger.rb
|
28
29
|
- lib/conscriptor/version.rb
|
29
30
|
homepage: https://github.com/jeremylightsmith/conscriptor
|
30
31
|
licenses:
|