Module: ProgressBar::Depreciable
- Included in:
- Base
- Defined in:
- lib/progress_bar/depreciable.rb
Constant Summary collapse
- DEPRECATION_DATE =
"June 30th, 2013"
Instance Method Summary collapse
- #backwards_compatible_args_to_options_conversion(args) ⇒ Object
- #bar_mark=(mark) ⇒ Object
- #current ⇒ Object
- #file_transfer_mode ⇒ Object
- #format=(value) ⇒ Object
- #format_arguments=(value) ⇒ Object
- #halt ⇒ Object
- #inc(value = nil) ⇒ Object
- #set(new_value) ⇒ Object
- #smoothing ⇒ Object
- #smoothing=(value) ⇒ Object
- #start_time ⇒ Object
- #start_time=(value) ⇒ Object
- #title_width ⇒ Object
- #title_width=(value) ⇒ Object
Instance Method Details
#backwards_compatible_args_to_options_conversion(args) ⇒ Object
5 6 7 8 9 10 11 12 13 14 15 16 17 18 |
# File 'lib/progress_bar/depreciable.rb', line 5 def (args) = {} if args.size > 1 puts "DEPRECATION WARNING: Creating progress bars using ProgressBar.new(title, total, output_io) has been deprecated and will be removed on or after #{DEPRECATION_DATE}. Please use ProgressBar.create(:title => title, :total => total, :output => output_io) instead. The full list of options can be found here: https://github.com/jfelchner/ruby-progressbar." [:title] = args[0] [:total] = args[1] [:output] = args[2] else = args[0] end end |
#bar_mark=(mark) ⇒ Object
44 45 46 47 48 |
# File 'lib/progress_bar/depreciable.rb', line 44 def (mark) 'bar_mark=', 'progress_mark=' progress_mark = mark end |
#current ⇒ Object
76 77 78 79 80 |
# File 'lib/progress_bar/depreciable.rb', line 76 def current 'current', 'progress' @bar.progress end |
#file_transfer_mode ⇒ Object
90 91 92 |
# File 'lib/progress_bar/depreciable.rb', line 90 def file_transfer_mode 'file_transfer_mode', 'We will be implementing a much better file transfer progress bar in the upcoming version however it has been removed for v1.0. If you still require this functionality, you should remain at v0.11.0' end |
#format=(value) ⇒ Object
68 69 70 |
# File 'lib/progress_bar/depreciable.rb', line 68 def format=(value) 'format=', 'The formatter has been completely rewriten for v1.0. Please use `#format(format_string)`. See https://github.com/jfelchner/ruby-progressbar for all the formatting options.' end |
#format_arguments=(value) ⇒ Object
72 73 74 |
# File 'lib/progress_bar/depreciable.rb', line 72 def format_arguments=(value) 'format_arguments=', 'The formatter has been completely rewriten for v1.0. Please use `#format(format_string)`. See https://github.com/jfelchner/ruby-progressbar for all the formatting options.' end |
#halt ⇒ Object
38 39 40 41 42 |
# File 'lib/progress_bar/depreciable.rb', line 38 def halt 'halt', 'stop' stop end |
#inc(value = nil) ⇒ Object
20 21 22 23 24 25 26 27 28 29 30 |
# File 'lib/progress_bar/depreciable.rb', line 20 def inc(value = nil) if value.nil? 'inc', 'increment' increment else 'inc', 'Rather than passing a step increment to the new #increment method, you can simply do `my_progress_bar.progress += step`.' progress = progress + value.to_i end end |
#set(new_value) ⇒ Object
32 33 34 35 36 |
# File 'lib/progress_bar/depreciable.rb', line 32 def set(new_value) 'set', 'progress=' progress = new_value end |
#smoothing ⇒ Object
82 83 84 |
# File 'lib/progress_bar/depreciable.rb', line 82 def smoothing 'smoothing' end |
#smoothing=(value) ⇒ Object
86 87 88 |
# File 'lib/progress_bar/depreciable.rb', line 86 def smoothing=(value) 'smoothing=', 'This value can only be set via the options hash when creating a new progress bar like so: ProgressBar.create(:smoothing => 0.2)' end |
#start_time ⇒ Object
58 59 60 61 62 |
# File 'lib/progress_bar/depreciable.rb', line 58 def start_time 'start_time' @elapsed_time.instance_variable_get(:@started_at) end |
#start_time=(value) ⇒ Object
64 65 66 |
# File 'lib/progress_bar/depreciable.rb', line 64 def start_time=(value) 'start_time=', 'It is no longer appropriate to set the start time of the bar. Using #start, #stop, #pause and #resume all work as expected.' end |
#title_width ⇒ Object
50 51 52 |
# File 'lib/progress_bar/depreciable.rb', line 50 def title_width 'title_width', 'The formatter is now smart enough to handle any title you use. Set the format for the bar as described here: https://github.com/jfelchner/ruby-progressbar' end |
#title_width=(value) ⇒ Object
54 55 56 |
# File 'lib/progress_bar/depreciable.rb', line 54 def title_width=(value) 'title_width=', 'The formatter is now smart enough to handle any title you use. Set the format for the bar as described here: https://github.com/jfelchner/ruby-progressbar' end |