infobar 0.1.1 → 0.2.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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: e8c8f993617ff8a2aaaf6772a076586cc6417e4f
4
- data.tar.gz: 89c8686e3820d1ceffd0f3ea350fdf38c7fc442e
3
+ metadata.gz: 0be5272638347ca61146d7e2896a77d93f255718
4
+ data.tar.gz: dece81f98dd6f4ebcc75018f8e2671ea1ee8aad1
5
5
  SHA512:
6
- metadata.gz: 0d689e48ee7427ae6aab9329a86ae33e86648688e5d950b42265f44594d621ba076f6cf278018204e2c3d6006210f1ec6003ef9a4d4a3f4b4ae7e1a15fa9a5f6
7
- data.tar.gz: 28e212eb31cefce7158ba8cb200c2785b42bb774f13832b1ad3f64e44a727c02e5e10e1d048e36f45b5181775e5492a02c2923691e7331be335435556331d1fa
6
+ metadata.gz: 30e7d15b2ebdc70f40736b486089edab521ce736edd8c6f430b7989c74c7ff0a1c2f89fd3dcf698a23523d75c3b908f9810914481b0dc986eb8c825480e16c3c
7
+ data.tar.gz: a3e2fd36c622f755a8e8210dae2cb73ca42a9630f4cbe7f7e12a6845d8ba08796c5b825b4846f90b2da4ad4351d6668d2e20d4a1670dc6f02d7504b0b207a352
data/README.md CHANGED
@@ -21,6 +21,11 @@ Display progress of computations and additional information to the terminal.
21
21
 
22
22
  ## Changes
23
23
 
24
+ * 2017-05-24 Release 0.2.0
25
+ - Allow setting of input/output on initial call.
26
+
27
+
28
+
24
29
  * 2017-03-24 Release 0.0.6
25
30
  - Add busybar functionality via Infobar.busy { … } call
26
31
 
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.1.1
1
+ 0.2.0
data/infobar.gemspec CHANGED
@@ -1,14 +1,14 @@
1
1
  # -*- encoding: utf-8 -*-
2
- # stub: infobar 0.1.1 ruby lib
2
+ # stub: infobar 0.2.0 ruby lib
3
3
 
4
4
  Gem::Specification.new do |s|
5
5
  s.name = "infobar".freeze
6
- s.version = "0.1.1"
6
+ s.version = "0.2.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-05-04"
11
+ s.date = "2017-05-24"
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]
@@ -124,8 +124,8 @@ class Infobar::Display
124
124
 
125
125
  delegate :called, to: :frequency, as: :updates
126
126
 
127
- def reset
128
- clear
127
+ def reset(clear: true)
128
+ clear && self.clear
129
129
  self.style = self.class.default_style
130
130
  self
131
131
  end
@@ -1,6 +1,6 @@
1
1
  class Infobar
2
2
  # Infobar version
3
- VERSION = '0.1.1'
3
+ VERSION = '0.2.0'
4
4
  VERSION_ARRAY = VERSION.split('.').map(&:to_i) # :nodoc:
5
5
  VERSION_MAJOR = VERSION_ARRAY[0] # :nodoc:
6
6
  VERSION_MINOR = VERSION_ARRAY[1] # :nodoc:
data/lib/infobar.rb CHANGED
@@ -53,6 +53,10 @@ class Infobar
53
53
 
54
54
  delegate :as_styles=, to: :display
55
55
 
56
+ delegate :input=, to: :display
57
+
58
+ delegate :output=, to: :display
59
+
56
60
  def call(
57
61
  total:,
58
62
  current: 0,
@@ -62,17 +66,20 @@ class Infobar
62
66
  style: cc.infobar?&.style?&.to_h,
63
67
  frequency: cc.infobar?&.frequency?,
64
68
  update: false,
65
- finish: nil,
66
- as_styles: nil
69
+ as_styles: nil,
70
+ input: $stdin,
71
+ output: $stdout
67
72
  )
68
73
  self.label = label
69
74
  counter.reset(total: total, current: current)
70
- display.reset
75
+ display.reset clear: false
71
76
  @message = convert_to_message(message)
72
77
  show.nil? or self.show = show
73
78
  frequency.nil? or display.frequency = frequency
74
79
  style.nil? or self.style = style
75
80
  self.as_styles = as_styles
81
+ self.input = input
82
+ self.output = output
76
83
  update and update(message: @message, force: true)
77
84
  self
78
85
  end
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.1.1
4
+ version: 0.2.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-05-04 00:00:00.000000000 Z
11
+ date: 2017-05-24 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: gem_hadar