infobar 0.2.0 → 0.3.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Rakefile +1 -1
- data/VERSION +1 -1
- data/infobar.gemspec +6 -6
- data/lib/infobar/message.rb +9 -9
- data/lib/infobar/number.rb +5 -2
- data/lib/infobar/version.rb +1 -1
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7a0c747745053b3efed4f91fa65814dd018778e9
|
4
|
+
data.tar.gz: 7e9789d2145df62b2ef89a41d0f02e62b1ef5cac
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a611e03d678f785245d320b2289c3764d93914138ce445eb644fa56cbea05590d89c1e9e1f2cffa7b32d3e321a07fa2af4338aecc69d0d3fa37652d8241ad42d
|
7
|
+
data.tar.gz: dfd38f2927dd1c100c071a8a88495c17c54464273765989c4098bc9cb5772cd56be55d7445f9352272205ffafcdb5b53ef0fe03cdb2d0ea56588561d0fd3f9c2
|
data/Rakefile
CHANGED
@@ -17,7 +17,7 @@ GemHadar do
|
|
17
17
|
title "#{name.camelize}"
|
18
18
|
|
19
19
|
required_ruby_version '>= 2.3'
|
20
|
-
dependency 'tins', '~> 1.0', '>= 1.
|
20
|
+
dependency 'tins', '~> 1.0', '>= 1.15.0'
|
21
21
|
dependency 'term-ansicolor', '~> 1.4'
|
22
22
|
dependency 'complex_config', '~> 0.10'
|
23
23
|
dependency 'more_math'
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.
|
1
|
+
0.3.0
|
data/infobar.gemspec
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
# -*- encoding: utf-8 -*-
|
2
|
-
# stub: infobar 0.
|
2
|
+
# stub: infobar 0.3.0 ruby lib
|
3
3
|
|
4
4
|
Gem::Specification.new do |s|
|
5
5
|
s.name = "infobar".freeze
|
6
|
-
s.version = "0.
|
6
|
+
s.version = "0.3.0"
|
7
7
|
|
8
8
|
s.required_rubygems_version = Gem::Requirement.new(">= 0".freeze) if s.respond_to? :required_rubygems_version=
|
9
9
|
s.require_paths = ["lib".freeze]
|
10
10
|
s.authors = ["Florian Frank".freeze]
|
11
|
-
s.date = "2017-
|
11
|
+
s.date = "2017-06-29"
|
12
12
|
s.description = "This gem displays progress of computations and additional information to the terminal.".freeze
|
13
13
|
s.email = "flori@ping.de".freeze
|
14
14
|
s.extra_rdoc_files = ["README.md".freeze, "lib/infobar.rb".freeze, "lib/infobar/counter.rb".freeze, "lib/infobar/display.rb".freeze, "lib/infobar/duration.rb".freeze, "lib/infobar/fancy_interface.rb".freeze, "lib/infobar/fifo.rb".freeze, "lib/infobar/frequency.rb".freeze, "lib/infobar/input_output.rb".freeze, "lib/infobar/message.rb".freeze, "lib/infobar/number.rb".freeze, "lib/infobar/rate.rb".freeze, "lib/infobar/spinner.rb".freeze, "lib/infobar/timer.rb".freeze, "lib/infobar/trend.rb".freeze, "lib/infobar/version.rb".freeze]
|
@@ -28,7 +28,7 @@ Gem::Specification.new do |s|
|
|
28
28
|
s.add_development_dependency(%q<rake>.freeze, [">= 0"])
|
29
29
|
s.add_development_dependency(%q<simplecov>.freeze, [">= 0"])
|
30
30
|
s.add_development_dependency(%q<rspec>.freeze, [">= 0"])
|
31
|
-
s.add_runtime_dependency(%q<tins>.freeze, [">= 1.
|
31
|
+
s.add_runtime_dependency(%q<tins>.freeze, [">= 1.15.0", "~> 1.0"])
|
32
32
|
s.add_runtime_dependency(%q<term-ansicolor>.freeze, ["~> 1.4"])
|
33
33
|
s.add_runtime_dependency(%q<complex_config>.freeze, ["~> 0.10"])
|
34
34
|
s.add_runtime_dependency(%q<more_math>.freeze, [">= 0"])
|
@@ -37,7 +37,7 @@ Gem::Specification.new do |s|
|
|
37
37
|
s.add_dependency(%q<rake>.freeze, [">= 0"])
|
38
38
|
s.add_dependency(%q<simplecov>.freeze, [">= 0"])
|
39
39
|
s.add_dependency(%q<rspec>.freeze, [">= 0"])
|
40
|
-
s.add_dependency(%q<tins>.freeze, [">= 1.
|
40
|
+
s.add_dependency(%q<tins>.freeze, [">= 1.15.0", "~> 1.0"])
|
41
41
|
s.add_dependency(%q<term-ansicolor>.freeze, ["~> 1.4"])
|
42
42
|
s.add_dependency(%q<complex_config>.freeze, ["~> 0.10"])
|
43
43
|
s.add_dependency(%q<more_math>.freeze, [">= 0"])
|
@@ -47,7 +47,7 @@ Gem::Specification.new do |s|
|
|
47
47
|
s.add_dependency(%q<rake>.freeze, [">= 0"])
|
48
48
|
s.add_dependency(%q<simplecov>.freeze, [">= 0"])
|
49
49
|
s.add_dependency(%q<rspec>.freeze, [">= 0"])
|
50
|
-
s.add_dependency(%q<tins>.freeze, [">= 1.
|
50
|
+
s.add_dependency(%q<tins>.freeze, [">= 1.15.0", "~> 1.0"])
|
51
51
|
s.add_dependency(%q<term-ansicolor>.freeze, ["~> 1.4"])
|
52
52
|
s.add_dependency(%q<complex_config>.freeze, ["~> 0.10"])
|
53
53
|
s.add_dependency(%q<more_math>.freeze, [">= 0"])
|
data/lib/infobar/message.rb
CHANGED
@@ -25,18 +25,18 @@ class Infobar::Message
|
|
25
25
|
end
|
26
26
|
|
27
27
|
# current counter value of items
|
28
|
-
register
|
29
|
-
Infobar.counter.current
|
28
|
+
register('%c', format: '%d', separate: ?_) do |directive, opts|
|
29
|
+
Infobar::Number.new(Infobar.counter.current, **opts)
|
30
30
|
end
|
31
31
|
|
32
32
|
# total counter value of items
|
33
|
-
register
|
34
|
-
Infobar.counter.total
|
33
|
+
register('%t', format: '%d', separate: ?_) do |directive, opts|
|
34
|
+
Infobar::Number.new(Infobar.counter.total, **opts)
|
35
35
|
end
|
36
36
|
|
37
37
|
# number of items to go
|
38
|
-
register
|
39
|
-
Infobar.counter.to_go
|
38
|
+
register('%T', format: '%d', separate: ?_) do |directive, opts|
|
39
|
+
Infobar::Number.new(Infobar.counter.to_go, **opts)
|
40
40
|
end
|
41
41
|
|
42
42
|
# label of progress bar
|
@@ -65,17 +65,17 @@ class Infobar::Message
|
|
65
65
|
end
|
66
66
|
|
67
67
|
# time elapsed as a duration
|
68
|
-
register('%te', format: '%
|
68
|
+
register('%te', format: '%D') do |directive, opts|
|
69
69
|
Infobar::Duration.new(Infobar.counter.time_elapsed, **opts)
|
70
70
|
end
|
71
71
|
|
72
72
|
# total time as a duration
|
73
|
-
register('%tt', format: '%
|
73
|
+
register('%tt', format: '%D') do |directive, opts|
|
74
74
|
Infobar::Duration.new(Infobar.counter.total_time, **opts)
|
75
75
|
end
|
76
76
|
|
77
77
|
# ETA as a duration
|
78
|
-
register('%e', format: '%
|
78
|
+
register('%e', format: '%D') do |directive, opts|
|
79
79
|
Infobar::Duration.new(Infobar.counter.time_remaining, **opts)
|
80
80
|
end
|
81
81
|
|
data/lib/infobar/number.rb
CHANGED
@@ -1,7 +1,10 @@
|
|
1
1
|
class Infobar::Number
|
2
|
-
def initialize(value, format: nil)
|
2
|
+
def initialize(value, format: nil, separate: nil)
|
3
3
|
duration = Tins::Duration.new(value)
|
4
|
-
@string = format ?
|
4
|
+
@string = format ? format % value : value.to_s
|
5
|
+
if Integer === value && separate
|
6
|
+
@string.gsub!(/(\d)(?=(\d\d\d)+(?!\d))/, "\\1#{separate}")
|
7
|
+
end
|
5
8
|
end
|
6
9
|
|
7
10
|
def to_s
|
data/lib/infobar/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: infobar
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.3.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Florian Frank
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-
|
11
|
+
date: 2017-06-29 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: gem_hadar
|
@@ -75,7 +75,7 @@ dependencies:
|
|
75
75
|
version: '1.0'
|
76
76
|
- - ">="
|
77
77
|
- !ruby/object:Gem::Version
|
78
|
-
version: 1.
|
78
|
+
version: 1.15.0
|
79
79
|
type: :runtime
|
80
80
|
prerelease: false
|
81
81
|
version_requirements: !ruby/object:Gem::Requirement
|
@@ -85,7 +85,7 @@ dependencies:
|
|
85
85
|
version: '1.0'
|
86
86
|
- - ">="
|
87
87
|
- !ruby/object:Gem::Version
|
88
|
-
version: 1.
|
88
|
+
version: 1.15.0
|
89
89
|
- !ruby/object:Gem::Dependency
|
90
90
|
name: term-ansicolor
|
91
91
|
requirement: !ruby/object:Gem::Requirement
|