ruby-progressbar 1.7.1 → 1.7.5

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
  SHA1:
3
- metadata.gz: f7b639ec0747152725fee788709585fd801c1e96
4
- data.tar.gz: 17ff15869c3f7961637e7e2d1c83dd86b5ce12dd
3
+ metadata.gz: aaa7c9d09b31699a0a0c691ff78cd1ad04a0d713
4
+ data.tar.gz: 78cf941aaf62befd7ba3c78bddb928e565f758ed
5
5
  SHA512:
6
- metadata.gz: 30a80f66102830ee061b661a6267b05a7397047015c549b06ffdef091785e272a476465b0e551c27164faa8ce62b14d5352743c51acabac50efef62e6813a998
7
- data.tar.gz: 03173ee0ca1e2eb74813d77138674389b1f1a9c3783cbb20f4327b50f3ae5e2c1badfe69e3937f48dc902f76e9eb5be1afbb4555e07131a3c4289ff607258279
6
+ metadata.gz: b86096eca7c31d2a85692000180440289b56abda2ab04044ae488c44ceddf6fc662bb1894eab7633717df0f5c5d7d1605b8daac4c5f8d9dddf91bbbfa7fa6582
7
+ data.tar.gz: 5fe2dca98cf016eb5455a3e5496f068b36c41978024315558bc4a6703e6329cfd9b2536fce47895f2478d84e91fd4a419f7d321b193b9fc7321d9eda121069c0
@@ -1,8 +1,8 @@
1
1
  class ProgressBar
2
2
  module Calculators
3
3
  class Length
4
- attr_accessor :length_override,
5
- :current_length
4
+ attr_reader :length_override
5
+ attr_accessor :current_length
6
6
 
7
7
  def initialize(options)
8
8
  self.length_override = options[:length]
@@ -47,8 +47,8 @@ class Time
47
47
  estimated_with_elapsed_fallback
48
48
  end
49
49
 
50
- attr_accessor :out_of_bounds_time_format,
51
- :timer,
50
+ attr_reader :out_of_bounds_time_format
51
+ attr_accessor :timer,
52
52
  :progress
53
53
 
54
54
  def out_of_bounds_time_format=(format)
@@ -41,7 +41,7 @@ class NonTty < Output
41
41
 
42
42
  protected
43
43
 
44
- attr_accessor :last_update_length
44
+ attr_writer :last_update_length
45
45
  end
46
46
  end
47
47
  end
@@ -6,9 +6,10 @@ class Progress
6
6
  DEFAULT_BEGINNING_POSITION = 0
7
7
  DEFAULT_SMOOTHING = 0.1
8
8
 
9
- attr_accessor :total,
10
- :progress,
11
- :starting_position,
9
+ attr_reader :total,
10
+ :progress
11
+
12
+ attr_accessor :starting_position,
12
13
  :running_average,
13
14
  :smoothing
14
15
 
@@ -100,7 +101,7 @@ class Progress
100
101
  return 100.0 if total == 0
101
102
  return 0.0 if total.nil?
102
103
 
103
- format('%5.2f', (progress.to_f * 100.0 / total * 100.0).floor / 100.0)
104
+ '%5.2f' % [(progress.to_f * 100.0 / total * 100.0).floor / 100.0]
104
105
  end
105
106
 
106
107
  def absolute
@@ -1,3 +1,3 @@
1
1
  class ProgressBar
2
- VERSION = '1.7.1'
2
+ VERSION = '1.7.5'
3
3
  end
@@ -22,7 +22,7 @@ bar = ProgressBar.create(:output => output,
22
22
  :start => 0,
23
23
  :total => total)
24
24
 
25
- total.times do |i|
25
+ total.times do |_i|
26
26
  # bar.log i
27
27
  bar.increment
28
28
  end
@@ -2,6 +2,7 @@ require 'spec_helper'
2
2
  require 'support/time'
3
3
  require 'stringio'
4
4
 
5
+ # rubocop:disable Metrics/LineLength
5
6
  describe ProgressBar::Base do
6
7
  let(:output) do
7
8
  StringIO.new('', 'w+').tap do |io|
@@ -945,3 +946,4 @@ describe ProgressBar::Base do
945
946
  end
946
947
  end
947
948
  end
949
+ # rubocop:enable Metrics/LineLength
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ruby-progressbar
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.7.1
4
+ version: 1.7.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - thekompanee
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2014-12-22 00:00:00.000000000 Z
12
+ date: 2015-03-25 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rspec
@@ -171,7 +171,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
171
171
  version: '0'
172
172
  requirements: []
173
173
  rubyforge_project:
174
- rubygems_version: 2.2.2
174
+ rubygems_version: 2.4.6
175
175
  signing_key:
176
176
  specification_version: 4
177
177
  summary: Ruby/ProgressBar is a flexible text progress bar library for Ruby.
@@ -196,4 +196,3 @@ test_files:
196
196
  - spec/ruby-progressbar/timer_spec.rb
197
197
  - spec/spec_helper.rb
198
198
  - spec/support/time.rb
199
- has_rdoc: