infobar 0.7.4 → 0.8.1

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: 7061fc3e99db0f8b76334df9af9de312198af014e153361f0d0d71775fced1b5
4
- data.tar.gz: dbf71fc58e10a6ea5bb5c7c3f6a2f93eda759a1dc8dc4e080ce11a7700784fa4
3
+ metadata.gz: 1d0b2e928a68a99137db85fa9d39b6c607fe4a1c5e951d108f83a2663227bce8
4
+ data.tar.gz: 40c78fa220a062940757f7bdbaca204830af757af54a147581df258e0dc35a47
5
5
  SHA512:
6
- metadata.gz: 30dd8616919176cfa34e184b8622fa4095ba53824ffb909e35d74bb7fb3efe3735b7eb4d4111cfc6bb333f726f5434fe52da7698da88437c3ec53c16fe4aac32
7
- data.tar.gz: 0e945992394da4592c6cd5b060e699a93b488fbfdeaff7338ad3d2efcc6895dbb51053f5da3372ed8665b12a5664e341d5afc27e2f08ec68be951fcbce173b85
6
+ metadata.gz: 63455a33afd3efaf55a9c3e3ae30d902a1e92c2ea112afc2eb67738874105ca376c573410f24b8b1792e8efad44c4f208f2011ac9ce1b181dd2a4cbad2388680
7
+ data.tar.gz: 470b3dda739a5768e3470c6e923a1e1acb87f137c9a3c300f6614b4cfae55994d68fc56d5ed471aa6038c0c0d543a4d5729298c2ebc8fad2a54d20288e57b0ef
data/.all_images.yml CHANGED
@@ -1,17 +1,18 @@
1
1
  dockerfile: |-
2
2
  RUN apk add --no-cache build-base git
3
- RUN gem update --system
4
- RUN gem install gem_hadar bundler
3
+
5
4
  script: &script |-
6
5
  echo -e "\e[1m"
7
6
  ruby -v
8
7
  echo -e "\e[0m"
9
- bundle
10
- rake spec
8
+ gem install bundler
9
+ bundle install --full-index
10
+ bundle exec rake spec
11
11
 
12
12
  fail_fast: true
13
13
 
14
14
  images:
15
+ ruby:3.3-alpine: *script
15
16
  ruby:3.2-alpine: *script
16
17
  ruby:3.1-alpine: *script
17
18
  ruby:3.0-alpine: *script
data/.gitignore CHANGED
@@ -1,7 +1,6 @@
1
1
  .*.sw[pon]
2
2
  .AppleDouble
3
3
  .DS_Store
4
- .byebug_history
5
4
  .rvmrc
6
5
  .tool-versions
7
6
  Gemfile.lock
data/CHANGES.md ADDED
@@ -0,0 +1,159 @@
1
+ # Changes
2
+
3
+ ## 2024-09-08 v0.8.1
4
+
5
+ * **Dependency Updates**:
6
+ + Update `all_images` Dockerfile and Gem installation
7
+ - Removed gem update and `gem_hadar/bundler` installation from Dockerfile
8
+ - Replaced RUN commands with bundle install and rake spec using bundler
9
+ + Upgrade `gem_hadar`
10
+ * **Refactor Infobar message formatting**
11
+ + Update `@message` assignment to use a conditional format string
12
+ * **Miscellaneous**:
13
+ + Bump version and dependencies
14
+ - Update `.all_images.yml` to use `bundle install --full-index`
15
+ - Remove `.byebug_history` from `.gitignore`
16
+ - Remove `gem 'byebug', platform: :mri'` from `Gemfile`
17
+ - Bump version in `VERSION`, `infobar.gemspec`, and `lib/infobar/version.rb`
18
+
19
+ ## 2024-09-01 v0.8.0
20
+
21
+ * **New Version:** 0.8.0
22
+ * **Significant Changes:**
23
+ + *Update all_images Dockerfile and Gem installation*
24
+ - Removed gem update and gem_hadar/bundler installation from Dockerfile
25
+ - Replaced RUN commands with bundle install and rake spec using bundler
26
+ + *Add string representation for Infobar::Counter*
27
+ - Added test for representing Infobar::Counter as a string
28
+ - Updated test to check progress method with different options
29
+ + *Update Infobar busy method to accept frames option*
30
+ - Update busy method to take an optional frames parameter with default value :circle1
31
+ - Change message format in busy method to use frames option instead of hardcoded :circle1 symbol
32
+
33
+ ## 2024-03-15 v0.7.4
34
+
35
+ * **Ruby Compatibility**: Skip testing Rubies less than 3.
36
+
37
+ ## 2024-03-15 v0.7.3
38
+
39
+ * **New Features**
40
+ + Updated homepage URL to use HTTPS
41
+ + Integrated latest `gem_hadar` gem
42
+ * **Changes**
43
+ + Homepage URL updated to secure protocol
44
+
45
+ ## 2023-10-09 v0.7.2
46
+
47
+ * Changed homepage link.
48
+
49
+ ## 2023-10-09 v0.7.1
50
+
51
+ * **New Feature**: Added `all_images` feature for testing purposes.
52
+ * **Bug Fix**: Reset is now performed before entering busy mode.
53
+
54
+ ## 2021-01-12 v0.7.0
55
+
56
+ * **New Features**
57
+ + Support for Ruby 3.0
58
+ * **Dependencies**
59
+ + Depend on the newest version of an unspecified library or framework
60
+
61
+ ## 2020-05-15 v0.6.2
62
+
63
+ * **Significant Changes**:
64
+ + Use keyword operator
65
+ + Upgrade bundler
66
+ + Test ruby 2.7
67
+ + Remove unnecessary code
68
+
69
+ ## 2019-04-11 v0.6.1
70
+
71
+ * **Output Counter Results**: The `to_s` method has been added to output the results of counters.
72
+
73
+ ## 2019-01-31 v0.6.0
74
+
75
+ * **Progressing with '-' allowed**: The code now allows progressing with a '-' character, treating it as equivalent to `false`.
76
+
77
+ ## 2018-11-01 v0.5.1
78
+
79
+ * **Allow busy bar message to be overwritten**
80
+ + Added functionality to overwrite the default busy bar message.
81
+
82
+ ## 2018-03-05 v0.5.0
83
+
84
+ * **New Feature:** Allow counter values to be formatted with units.
85
+
86
+ ## 2017-12-08 v0.4.0
87
+
88
+ * **New Feature**: Automatically iterate when `with_infobar` is passed a block.
89
+ + This change allows for more flexible usage of the `with_infobar` method.
90
+ * **Documentation**: Add COPYING file
91
+ + Provides licensing information for the project.
92
+
93
+ ## 2017-06-29 v0.3.0
94
+
95
+ * **New Feature:** Smart duration formatting is now used by default.
96
+ * **New Feature:** Long integers are separated with underscores by default.
97
+
98
+ ## 2017-05-24 v0.2.0
99
+
100
+ * **New Feature**: Allow setting of input/output on initial call.
101
+
102
+ ### Changes:
103
+
104
+ * Added functionality to set input and output streams on the first method call.
105
+
106
+ ## 2017-05-04 v0.1.1
107
+
108
+ * **Avoid outputting to display during instance init**:
109
+ * Prevent unnecessary output during instance initialization.
110
+
111
+ ## 2017-04-24 v0.1.0
112
+
113
+ * **New Features**
114
+ + Support for multiple colored progress bars
115
+ * **Bug Fixes**
116
+ + Ensure bar is always long enough
117
+ + Correct config environment settings
118
+
119
+ ## 2017-04-13 v0.0.7
120
+
121
+ * **New Feature:** Forced display of Infobar updates:
122
+ + When calling `Infobar.update`, the infobar will now always be displayed.
123
+
124
+ ## 2017-03-24 v0.0.6
125
+
126
+ * Added busy bar functionality.
127
+
128
+ ## 2017-03-10 v0.0.5
129
+
130
+ * **Always Provide Default Unit**: Added functionality to always provide a
131
+ default unit, ensuring consistency in output.
132
+
133
+ ## 2017-03-10 v0.0.4
134
+
135
+ * **Rate Validation**: Fixed issue where invalid rates were not handled
136
+ correctly at the beginning of a calculation.
137
+
138
+ ## 2017-03-09 v0.0.3
139
+
140
+ * **New Version Summary**
141
+ + Reset frequency when calling `clear`
142
+ + Added reminder to TODO list
143
+ + Fixed a typo
144
+
145
+ ## 2017-02-10 v0.0.2
146
+
147
+ * Added trend arrow to rate directive.
148
+
149
+ ## 2017-02-08 v0.0.1
150
+
151
+ * Added new features and functionality.
152
+
153
+ ### Significant Changes:
154
+
155
+ * **New Features**: Additional tasks were added to the system.
156
+
157
+ ## 2017-02-08 v0.0.0
158
+
159
+ * Start
data/Gemfile CHANGED
@@ -3,5 +3,3 @@
3
3
  source 'https://rubygems.org'
4
4
 
5
5
  gemspec
6
-
7
- gem 'byebug', platform: :mri
data/Rakefile CHANGED
@@ -12,7 +12,7 @@ GemHadar do
12
12
  module_type :class
13
13
  test_dir 'spec'
14
14
  ignore '.*.sw[pon]', 'pkg', 'Gemfile.lock', 'coverage', '.rvmrc',
15
- '.AppleDouble', 'tags', '.byebug_history', '.DS_Store', 'errors.lst', '.tool-versions'
15
+ '.AppleDouble', 'tags', '.DS_Store', 'errors.lst', '.tool-versions'
16
16
  readme 'README.md'
17
17
  title "#{name.camelize}"
18
18
 
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.7.4
1
+ 0.8.1
data/infobar.gemspec CHANGED
@@ -1,35 +1,35 @@
1
1
  # -*- encoding: utf-8 -*-
2
- # stub: infobar 0.7.4 ruby lib
2
+ # stub: infobar 0.8.1 ruby lib
3
3
 
4
4
  Gem::Specification.new do |s|
5
5
  s.name = "infobar".freeze
6
- s.version = "0.7.4"
6
+ s.version = "0.8.1".freeze
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 = "2024-03-15"
11
+ s.date = "2024-09-08"
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]
15
- s.files = [".all_images.yml".freeze, ".gitignore".freeze, ".rspec".freeze, ".travis.yml".freeze, ".utilsrc".freeze, "COPYING".freeze, "Gemfile".freeze, "README.md".freeze, "Rakefile".freeze, "TODO.md".freeze, "VERSION".freeze, "infobar.gemspec".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, "spec/config/infobar.yml".freeze, "spec/infobar/config_spec.rb".freeze, "spec/infobar/counter_spec.rb".freeze, "spec/infobar/display_spec.rb".freeze, "spec/infobar/duration_spec.rb".freeze, "spec/infobar/fifo_spec.rb".freeze, "spec/infobar/frequency_spec.rb".freeze, "spec/infobar/input_output_spec.rb".freeze, "spec/infobar/message_spec.rb".freeze, "spec/infobar/number_spec.rb".freeze, "spec/infobar/rate_spec.rb".freeze, "spec/infobar/spinner_spec.rb".freeze, "spec/infobar/timer_spec.rb".freeze, "spec/infobar/trend_spec.rb".freeze, "spec/infobar_spec.rb".freeze, "spec/spec_helper.rb".freeze]
15
+ s.files = [".all_images.yml".freeze, ".gitignore".freeze, ".rspec".freeze, ".travis.yml".freeze, ".utilsrc".freeze, "CHANGES.md".freeze, "COPYING".freeze, "Gemfile".freeze, "README.md".freeze, "Rakefile".freeze, "TODO.md".freeze, "VERSION".freeze, "infobar.gemspec".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, "spec/config/infobar.yml".freeze, "spec/infobar/config_spec.rb".freeze, "spec/infobar/counter_spec.rb".freeze, "spec/infobar/display_spec.rb".freeze, "spec/infobar/duration_spec.rb".freeze, "spec/infobar/fifo_spec.rb".freeze, "spec/infobar/frequency_spec.rb".freeze, "spec/infobar/input_output_spec.rb".freeze, "spec/infobar/message_spec.rb".freeze, "spec/infobar/number_spec.rb".freeze, "spec/infobar/rate_spec.rb".freeze, "spec/infobar/spinner_spec.rb".freeze, "spec/infobar/timer_spec.rb".freeze, "spec/infobar/trend_spec.rb".freeze, "spec/infobar_spec.rb".freeze, "spec/spec_helper.rb".freeze]
16
16
  s.homepage = "https://github.com/flori/infobar".freeze
17
17
  s.rdoc_options = ["--title".freeze, "Infobar".freeze, "--main".freeze, "README.md".freeze]
18
18
  s.required_ruby_version = Gem::Requirement.new(">= 2.3".freeze)
19
- s.rubygems_version = "3.4.19".freeze
19
+ s.rubygems_version = "3.5.18".freeze
20
20
  s.summary = "Gem to display information about computations.".freeze
21
21
  s.test_files = ["spec/infobar/config_spec.rb".freeze, "spec/infobar/counter_spec.rb".freeze, "spec/infobar/display_spec.rb".freeze, "spec/infobar/duration_spec.rb".freeze, "spec/infobar/fifo_spec.rb".freeze, "spec/infobar/frequency_spec.rb".freeze, "spec/infobar/input_output_spec.rb".freeze, "spec/infobar/message_spec.rb".freeze, "spec/infobar/number_spec.rb".freeze, "spec/infobar/rate_spec.rb".freeze, "spec/infobar/spinner_spec.rb".freeze, "spec/infobar/timer_spec.rb".freeze, "spec/infobar/trend_spec.rb".freeze, "spec/infobar_spec.rb".freeze, "spec/spec_helper.rb".freeze]
22
22
 
23
23
  s.specification_version = 4
24
24
 
25
- s.add_development_dependency(%q<gem_hadar>.freeze, ["~> 1.14.0"])
26
- s.add_development_dependency(%q<rake>.freeze, [">= 0"])
27
- s.add_development_dependency(%q<simplecov>.freeze, [">= 0"])
28
- s.add_development_dependency(%q<rspec>.freeze, [">= 0"])
29
- s.add_development_dependency(%q<debug>.freeze, [">= 0"])
30
- s.add_development_dependency(%q<all_images>.freeze, [">= 0"])
31
- s.add_runtime_dependency(%q<tins>.freeze, ["~> 1.0", ">= 1.28.0"])
32
- s.add_runtime_dependency(%q<term-ansicolor>.freeze, ["~> 1.4"])
33
- s.add_runtime_dependency(%q<complex_config>.freeze, ["~> 0.10"])
34
- s.add_runtime_dependency(%q<more_math>.freeze, [">= 0"])
25
+ s.add_development_dependency(%q<gem_hadar>.freeze, ["~> 1.17.0".freeze])
26
+ s.add_development_dependency(%q<rake>.freeze, [">= 0".freeze])
27
+ s.add_development_dependency(%q<simplecov>.freeze, [">= 0".freeze])
28
+ s.add_development_dependency(%q<rspec>.freeze, [">= 0".freeze])
29
+ s.add_development_dependency(%q<debug>.freeze, [">= 0".freeze])
30
+ s.add_development_dependency(%q<all_images>.freeze, [">= 0".freeze])
31
+ s.add_runtime_dependency(%q<tins>.freeze, ["~> 1.0".freeze, ">= 1.28.0".freeze])
32
+ s.add_runtime_dependency(%q<term-ansicolor>.freeze, ["~> 1.4".freeze])
33
+ s.add_runtime_dependency(%q<complex_config>.freeze, ["~> 0.10".freeze])
34
+ s.add_runtime_dependency(%q<more_math>.freeze, [">= 0".freeze])
35
35
  end
@@ -1,6 +1,6 @@
1
1
  class Infobar
2
2
  # Infobar version
3
- VERSION = '0.7.4'
3
+ VERSION = '0.8.1'
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
@@ -77,7 +77,9 @@ class Infobar
77
77
  self.label = label
78
78
  counter.reset(total: total, current: current)
79
79
  display.reset clear: false
80
- @message = convert_to_message(message)
80
+ @message = convert_to_message(
81
+ message.full? || '%l %c/%t in %te, ETA %e @%E %s'
82
+ )
81
83
  show.nil? or self.show = show
82
84
  frequency.nil? or display.frequency = frequency
83
85
  style.nil? or self.style = style
@@ -92,13 +94,13 @@ class Infobar
92
94
  instance.busy(**opts, &block)
93
95
  end
94
96
 
95
- def busy(**opts, &block)
97
+ def busy(frames: :circle1, **opts, &block)
96
98
  block_given? or raise ArgumentError, 'block is required as an argument'
97
99
  duration = opts.delete(:sleep) || 0.1
98
100
  reset
99
101
  call(**opts | {
100
102
  total: Float::INFINITY,
101
- message: { format: ' %l %te %s ', '%s' => { frames: :circle1 } },
103
+ message: { format: ' %l %te %s ', '%s' => { frames: frames } },
102
104
  })
103
105
  ib = Thread.new {
104
106
  loop do
@@ -19,6 +19,17 @@ describe Infobar::Counter do
19
19
  expect(counter.total).to eq 0
20
20
  end
21
21
 
22
+ it 'can be represented as string' do
23
+ expect(counter.progress(as: true)).to eq counter
24
+ expect(counter.progress(as: false)).to eq counter
25
+ expect(counter.progress(as: true)).to eq counter
26
+ expect(counter.to_s).to eq <<~end.chomp
27
+ default: 0
28
+ true: 2
29
+ false: 1
30
+ end
31
+ end
32
+
22
33
  it 'can progress by arbitrary value' do
23
34
  expect(counter.progress(by: 23)).to eq counter
24
35
  expect(counter).to be_started
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.7.4
4
+ version: 0.8.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Florian Frank
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2024-03-15 00:00:00.000000000 Z
11
+ date: 2024-09-08 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: gem_hadar
@@ -16,14 +16,14 @@ dependencies:
16
16
  requirements:
17
17
  - - "~>"
18
18
  - !ruby/object:Gem::Version
19
- version: 1.14.0
19
+ version: 1.17.0
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: 1.14.0
26
+ version: 1.17.0
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: rake
29
29
  requirement: !ruby/object:Gem::Requirement
@@ -184,6 +184,7 @@ files:
184
184
  - ".rspec"
185
185
  - ".travis.yml"
186
186
  - ".utilsrc"
187
+ - CHANGES.md
187
188
  - COPYING
188
189
  - Gemfile
189
190
  - README.md
@@ -244,7 +245,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
244
245
  - !ruby/object:Gem::Version
245
246
  version: '0'
246
247
  requirements: []
247
- rubygems_version: 3.4.19
248
+ rubygems_version: 3.5.18
248
249
  signing_key:
249
250
  specification_version: 4
250
251
  summary: Gem to display information about computations.