progressor 0.1.1 → 0.1.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 5751855299f7f98b9c33f3879c3b83e745712eae9cbfab5c3176412c24f02f88
4
- data.tar.gz: b04700d468828f7064dd8e4a0cee16456260fadde98a360c219814dc74c6eb11
3
+ metadata.gz: 54e39588afa295d9501f32e4a183834d030b536cb902fbc133be2e61d2b97745
4
+ data.tar.gz: 5732a7f82cd05f0ced057785595d2d4724264ddef570c69fca086823b76318fd
5
5
  SHA512:
6
- metadata.gz: 204b64154e475433e4d4abc2328ca4ec13cdced9dbcfa345aeef56beeb9126e1e01a1cd8bcd00e901b7299ed77e16d86420c2f0da4ae917415b72dcea45a96ad
7
- data.tar.gz: 766492edd69e86084aa2683f86ab6644f41da58ad1414b794f16a01e8f907b5685a2a6e908f99e88f4a77790e6f9f2f1289742bd6602876f613d2bdb75188bfd
6
+ metadata.gz: e9339fc8632bdd3b0d1c0ab47d5c95d987e6db3f5383f59541511341735c105ebce68a6544eed20a0614f8ee12974d91f9fc65dfe58f4d5e662d96a02746092a
7
+ data.tar.gz: 5b58b596f4596bccccb352ec2c8ec6949573ad898677b228fcd43073e8b141d561c397b428d5f16dfe53dd7134e2fdb430f2be51c1a0013a1537e95f98d724ae
@@ -61,7 +61,7 @@ class Progressor
61
61
  end
62
62
 
63
63
  # Outputs a textual representation of the current state of the
64
- # UnlimitedSequence. Shows:
64
+ # LimitedSequence. Shows:
65
65
  #
66
66
  # - the current number of iterations and the total count
67
67
  # - completion level in percentage
@@ -117,6 +117,14 @@ class Progressor
117
117
  remaining_time.round(2)
118
118
  end
119
119
 
120
+ # Returns the time since the object was instantiated, formatted like all
121
+ # the other durations. Useful for a final message to compare initial
122
+ # estimation to actual elapsed time.
123
+ #
124
+ def elapsed_time
125
+ format_time(Time.now - @start_time)
126
+ end
127
+
120
128
  private
121
129
 
122
130
  def average(collection)
@@ -71,7 +71,7 @@ class Progressor
71
71
 
72
72
  [
73
73
  "#{@current + 1}",
74
- "t: #{format_time(Time.now - @start_time)}",
74
+ "t: #{elapsed_time}",
75
75
  "t/i: #{format_time(per_iteration)}",
76
76
  ].join(', ')
77
77
  end
@@ -95,6 +95,13 @@ class Progressor
95
95
  # No estimation possible
96
96
  end
97
97
 
98
+ # Returns the time since the object was instantiated, formatted like all
99
+ # the other durations.
100
+ #
101
+ def elapsed_time
102
+ format_time(Time.now - @start_time)
103
+ end
104
+
98
105
  private
99
106
 
100
107
  def average(collection)
@@ -1,3 +1,3 @@
1
1
  class Progressor
2
- VERSION = '0.1.1'
2
+ VERSION = '0.1.2'
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: progressor
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Andrew Radev
8
- autorequire:
8
+ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-06-14 00:00:00.000000000 Z
11
+ date: 2022-04-03 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rake
@@ -16,14 +16,14 @@ dependencies:
16
16
  requirements:
17
17
  - - "~>"
18
18
  - !ruby/object:Gem::Version
19
- version: '10.0'
19
+ version: 12.3.3
20
20
  type: :development
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - "~>"
25
25
  - !ruby/object:Gem::Version
26
- version: '10.0'
26
+ version: 12.3.3
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: rspec
29
29
  requirement: !ruby/object:Gem::Requirement
@@ -74,7 +74,7 @@ homepage: https://github.com/AndrewRadev/progressor
74
74
  licenses:
75
75
  - MIT
76
76
  metadata: {}
77
- post_install_message:
77
+ post_install_message:
78
78
  rdoc_options: []
79
79
  require_paths:
80
80
  - lib
@@ -89,8 +89,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
89
89
  - !ruby/object:Gem::Version
90
90
  version: '0'
91
91
  requirements: []
92
- rubygems_version: 3.0.3
93
- signing_key:
92
+ rubygems_version: 3.1.6
93
+ signing_key:
94
94
  specification_version: 4
95
95
  summary: Measure iterations in a long-running task
96
96
  test_files: []