with_progress 1.0.0 → 1.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +15 -7
- data/README.md +9 -2
- data/lib/with_progress.rb +0 -1
- data/lib/with_progress/extensions/enumerable.rb +1 -1
- data/lib/with_progress/version.rb +1 -1
- data/spec/manual_spec.rb +1 -0
- data/with_progress.gemspec +1 -1
- metadata +79 -61
checksums.yaml
CHANGED
@@ -1,7 +1,15 @@
|
|
1
|
-
---
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
1
|
+
---
|
2
|
+
!binary "U0hBMQ==":
|
3
|
+
metadata.gz: !binary |-
|
4
|
+
NWQ4ZDJhZmIyZjAwNjBlMDliOTA2MjczYmEwOWVhOWE0ZTM0Y2VjZA==
|
5
|
+
data.tar.gz: !binary |-
|
6
|
+
YzhhMGM4M2E2MThkY2VjZDM1MmMwZWEyYTYyNTQ4M2VkNDYzYzgxZA==
|
7
|
+
SHA512:
|
8
|
+
metadata.gz: !binary |-
|
9
|
+
N2M5NDhiZjNiYTMwMWQ5ZmZkMjNhMjI4NjJlZjg1ODU3YzNlZDM1ZjI2YWY3
|
10
|
+
NDY5YjVjYzc5ZTA1NjAyMTkwYjVjZDEwNWZjYzdiNTExYzljY2YzZWM2NzY0
|
11
|
+
MWI0MWVjODMxNzljOWQ4NzQwNDVlYzU5MDc4OGY5YTk4NDdiZDE=
|
12
|
+
data.tar.gz: !binary |-
|
13
|
+
MWRlYzBmMTc2YWY1MTIxNWZlOTM5ZTJkOTA0ODAzMDJkZTJiMzFlMjU3Y2Iz
|
14
|
+
M2YzYmYyMTMxNzdjNGUxMmY3YmQ4YmQ5OWQ1YTQ3YzYwYTlmMGY5OTU1ZTVi
|
15
|
+
NjI4MWNjYjVmNjFjMWJjZGRjN2M0MmY2YmUwOTkxZjA3MzI4YTI=
|
data/README.md
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
# with_progress [
|
1
|
+
# with_progress [![Build Status](https://travis-ci.org/marcandre/with_progress.png?branch=master)](https://travis-ci.org/marcandre/with_progress) [![Gem Version](https://badge.fury.io/rb/with_progress.png)](http://badge.fury.io/rb/with_progress)
|
2
2
|
|
3
3
|
Brings the great [ruby-progressbar](https://github.com/jfelchner/ruby-progressbar) to `Enumerable`.
|
4
4
|
|
@@ -12,7 +12,14 @@ It uses the [ruby-progressbar](https://github.com/jfelchner/ruby-progressbar) ge
|
|
12
12
|
|
13
13
|
In Ruby 2.0+, most enumerables return a size, so `with_progress` uses that to deduce the `total`, there's no need to specify it:
|
14
14
|
|
15
|
-
42.times.with_progress { do_something }
|
15
|
+
42.times.with_progress { do_something }
|
16
|
+
# Will create the progress bar, provide the {total: 42} option
|
17
|
+
# (in Ruby 2.0+) and call increment after each do_something
|
18
|
+
|
19
|
+
For Ruby older than 2.0.0, some enumerators won't work, so progression will only show the elapsed time but won't be able to guess the remaining time. You can require some [backports](https://github.com/marcandre/backports) to improve the situation, for example:
|
20
|
+
|
21
|
+
require 'backports/2.0.0/range/size'
|
22
|
+
(10...42).with_progress { do_something } # will calculate the remaining time, even in old Rubies
|
16
23
|
|
17
24
|
## Installation
|
18
25
|
|
data/lib/with_progress.rb
CHANGED
@@ -4,7 +4,7 @@ module Enumerable
|
|
4
4
|
|
5
5
|
options = WithProgress::DEFAULTS.merge(options)
|
6
6
|
unless options.has_key?(:total)
|
7
|
-
options[:total] = size rescue
|
7
|
+
options[:total] = size rescue nil
|
8
8
|
end
|
9
9
|
|
10
10
|
bar = ProgressBar.create(options)
|
data/spec/manual_spec.rb
CHANGED
data/with_progress.gemspec
CHANGED
@@ -19,7 +19,7 @@ Gem::Specification.new do |spec|
|
|
19
19
|
spec.require_paths = ["lib"]
|
20
20
|
|
21
21
|
spec.add_dependency 'ruby-progressbar', '~> 1.4'
|
22
|
-
spec.
|
22
|
+
spec.add_development_dependency 'backports', '~> 3.5'
|
23
23
|
|
24
24
|
spec.add_development_dependency "bundler", "~> 1.3"
|
25
25
|
spec.add_development_dependency "rake"
|
metadata
CHANGED
@@ -1,75 +1,92 @@
|
|
1
|
-
--- !ruby/object:Gem::Specification
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
2
|
name: with_progress
|
3
|
-
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 1.0.1
|
5
5
|
platform: ruby
|
6
|
-
authors:
|
6
|
+
authors:
|
7
7
|
- Marc-Andre Lafortune
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
- !ruby/object:Gem::Dependency
|
11
|
+
date: 2014-10-08 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
15
14
|
name: ruby-progressbar
|
16
|
-
|
17
|
-
requirements:
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
18
17
|
- - ~>
|
19
|
-
- !ruby/object:Gem::Version
|
20
|
-
version:
|
21
|
-
prerelease: false
|
22
|
-
requirement: *id001
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '1.4'
|
23
20
|
type: :runtime
|
24
|
-
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - ~>
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: '1.4'
|
27
|
+
- !ruby/object:Gem::Dependency
|
25
28
|
name: backports
|
26
|
-
|
27
|
-
requirements:
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
28
31
|
- - ~>
|
29
|
-
- !ruby/object:Gem::Version
|
30
|
-
version:
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '3.5'
|
34
|
+
type: :development
|
31
35
|
prerelease: false
|
32
|
-
|
33
|
-
|
34
|
-
-
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - ~>
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '3.5'
|
41
|
+
- !ruby/object:Gem::Dependency
|
35
42
|
name: bundler
|
36
|
-
|
37
|
-
requirements:
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
38
45
|
- - ~>
|
39
|
-
- !ruby/object:Gem::Version
|
40
|
-
version:
|
41
|
-
prerelease: false
|
42
|
-
requirement: *id003
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: '1.3'
|
43
48
|
type: :development
|
44
|
-
- !ruby/object:Gem::Dependency
|
45
|
-
name: rake
|
46
|
-
version_requirements: &id004 !ruby/object:Gem::Requirement
|
47
|
-
requirements:
|
48
|
-
- &id005
|
49
|
-
- ">="
|
50
|
-
- !ruby/object:Gem::Version
|
51
|
-
version: "0"
|
52
49
|
prerelease: false
|
53
|
-
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - ~>
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '1.3'
|
55
|
+
- !ruby/object:Gem::Dependency
|
56
|
+
name: rake
|
57
|
+
requirement: !ruby/object:Gem::Requirement
|
58
|
+
requirements:
|
59
|
+
- - ! '>='
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: '0'
|
54
62
|
type: :development
|
55
|
-
- !ruby/object:Gem::Dependency
|
56
|
-
name: rspec
|
57
|
-
version_requirements: &id006 !ruby/object:Gem::Requirement
|
58
|
-
requirements:
|
59
|
-
- *id005
|
60
63
|
prerelease: false
|
61
|
-
|
64
|
+
version_requirements: !ruby/object:Gem::Requirement
|
65
|
+
requirements:
|
66
|
+
- - ! '>='
|
67
|
+
- !ruby/object:Gem::Version
|
68
|
+
version: '0'
|
69
|
+
- !ruby/object:Gem::Dependency
|
70
|
+
name: rspec
|
71
|
+
requirement: !ruby/object:Gem::Requirement
|
72
|
+
requirements:
|
73
|
+
- - ! '>='
|
74
|
+
- !ruby/object:Gem::Version
|
75
|
+
version: '0'
|
62
76
|
type: :development
|
77
|
+
prerelease: false
|
78
|
+
version_requirements: !ruby/object:Gem::Requirement
|
79
|
+
requirements:
|
80
|
+
- - ! '>='
|
81
|
+
- !ruby/object:Gem::Version
|
82
|
+
version: '0'
|
63
83
|
description: progressbar for enumerables
|
64
|
-
email:
|
84
|
+
email:
|
65
85
|
- github@marc-andre.ca
|
66
86
|
executables: []
|
67
|
-
|
68
87
|
extensions: []
|
69
|
-
|
70
88
|
extra_rdoc_files: []
|
71
|
-
|
72
|
-
files:
|
89
|
+
files:
|
73
90
|
- .gitignore
|
74
91
|
- .travis.yml
|
75
92
|
- CHANGELOG.rdoc
|
@@ -84,28 +101,29 @@ files:
|
|
84
101
|
- spec/with_progress_spec.rb
|
85
102
|
- with_progress.gemspec
|
86
103
|
homepage: http://github.com/marcandre/with_progress
|
87
|
-
licenses:
|
104
|
+
licenses:
|
88
105
|
- MIT
|
89
106
|
metadata: {}
|
90
|
-
|
91
107
|
post_install_message:
|
92
108
|
rdoc_options: []
|
93
|
-
|
94
|
-
require_paths:
|
109
|
+
require_paths:
|
95
110
|
- lib
|
96
|
-
required_ruby_version: !ruby/object:Gem::Requirement
|
97
|
-
requirements:
|
98
|
-
-
|
99
|
-
|
100
|
-
|
101
|
-
|
111
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
112
|
+
requirements:
|
113
|
+
- - ! '>='
|
114
|
+
- !ruby/object:Gem::Version
|
115
|
+
version: '0'
|
116
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
117
|
+
requirements:
|
118
|
+
- - ! '>='
|
119
|
+
- !ruby/object:Gem::Version
|
120
|
+
version: '0'
|
102
121
|
requirements: []
|
103
|
-
|
104
122
|
rubyforge_project:
|
105
|
-
rubygems_version: 2.
|
123
|
+
rubygems_version: 2.2.1
|
106
124
|
signing_key:
|
107
125
|
specification_version: 4
|
108
126
|
summary: progressbar for enumerables
|
109
|
-
test_files:
|
127
|
+
test_files:
|
110
128
|
- spec/manual_spec.rb
|
111
129
|
- spec/with_progress_spec.rb
|