Sha256: a62a8298656eaec79b664db6fa1baa31972b8088bb262d83536770e477da092b

Contents?: true

Size: 1.99 KB

Versions: 4

Compression:

Stored size: 1.99 KB

Contents

= progress

* http://github.com/toy/progress/tree/master

== DESCRIPTION:

Class to show progress during console script run

== FEATURES:

* Progress
* Enclosed progress

== SYNOPSIS:

  1000.times_with_progress('Wait') do |time|
    puts time
  end

  [1, 2, 3].with_progress('Wait').each do |i|
    puts i
  end

  (1..100).with_progress('Wait').each do |i|
    puts i
  end

  {
    :a => 'a',
    :b => 'b',
    :c => 'c',
    :d => 'd',
  }.with_progress('Wait').each do |k, v|
    puts "#{k} => #{v}"
  end

  (1..10).with_progress('Outer').map do |a|
    (1..10).with_progress('Middle').map do |b|
      (1..10).with_progress('Inner').map do |c|
        [a, b, c]
      end
    end
  end

  symbols = []
  Progress.start('Input 100 symbols', 100) do
    while symbols.length < 100
      input = gets.scan(/\S/)
      symbols += input
      Progress.step input.length
    end
  end

== REQUIREMENTS:

* ruby )))

== INSTALL:

* sudo gem install progress

== LICENSE:

(The MIT License)

Copyright (c) 2008 toy

Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
'Software'), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:

The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
progress-0.1.0.3 README.rdoc
progress-0.1.0.0 README.rdoc
progress-0.1.0.2 README.rdoc
progress-0.1.0.1 README.rdoc