popro 0.1.3 → 0.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG +1 -0
- data/lib/popro.rb +1 -2
- data/lib/popro/progress.rb +5 -6
- metadata +6 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 953431a63b91d3bb07e70cf638262c74dbbca5ced53020b5f6ba4b0b87b4a19f
|
4
|
+
data.tar.gz: 9658ac180fa9259438c95ab264c19d0588da7c959187ddbf169ea130f639296d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f04c243ad12db54726a87e17527d031adcea1f8229d8e815768c5e9416132c9c14b65e4ba324e0733bd15fb7a8773942499caa9aafa8566f97b7d39848f43091
|
7
|
+
data.tar.gz: a6c71eec92cc09a69742cb4c9dba2fec469595804589a12d468d5093ae8b3a7d316aad639b0091ead3f0f5fa7bea694cf6dcb996b3ded7922e79d9762ef75916
|
data/CHANGELOG
CHANGED
data/lib/popro.rb
CHANGED
@@ -7,7 +7,7 @@ module Popro
|
|
7
7
|
|
8
8
|
require_relative 'popro/progress'
|
9
9
|
|
10
|
-
def self.new(total, **options, &block)
|
10
|
+
def self.new(total=0, **options, &block)
|
11
11
|
raise ConfigError, 'using :total is not supported in new' if options.key?(:total) && (options[:total] != total)
|
12
12
|
|
13
13
|
options[:total] = total
|
@@ -15,7 +15,6 @@ module Popro
|
|
15
15
|
end
|
16
16
|
|
17
17
|
def self.each(obj, total = nil, **options, &block)
|
18
|
-
options[:step] = 0 unless options.key? :step
|
19
18
|
new(0, **options).each(obj, total, &block).done
|
20
19
|
end
|
21
20
|
|
data/lib/popro/progress.rb
CHANGED
@@ -9,20 +9,19 @@ module Popro
|
|
9
9
|
DEFAULT_OPTIONS ||= {
|
10
10
|
total: 0,
|
11
11
|
current: 0,
|
12
|
+
indicator: Indicator.default
|
12
13
|
}.freeze
|
13
14
|
|
14
15
|
attr_reader :context
|
15
16
|
|
16
17
|
def initialize(**options)
|
17
|
-
options.merge!(DEFAULT_OPTIONS)
|
18
|
-
|
19
18
|
@started = false
|
20
19
|
|
21
|
-
|
22
|
-
|
23
|
-
|
20
|
+
options = DEFAULT_OPTIONS
|
21
|
+
.merge(step: block_given? ? 0 : 1)
|
22
|
+
.merge(options)
|
24
23
|
|
25
|
-
|
24
|
+
@info = Info.new(total: options.delete(:total), current: options.delete(:current))
|
26
25
|
|
27
26
|
options.merge!(progress: self, info: @info)
|
28
27
|
@context = Context.new(**options)
|
metadata
CHANGED
@@ -1,17 +1,17 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: popro
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- MikeSmithEU
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-
|
11
|
+
date: 2020-09-16 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: The Poor-Man's Progress Indicator
|
14
|
-
email:
|
14
|
+
email:
|
15
15
|
executables: []
|
16
16
|
extensions: []
|
17
17
|
extra_rdoc_files: []
|
@@ -31,7 +31,7 @@ homepage: https://rubygems.org/gems/popro
|
|
31
31
|
licenses:
|
32
32
|
- MIT
|
33
33
|
metadata: {}
|
34
|
-
post_install_message:
|
34
|
+
post_install_message:
|
35
35
|
rdoc_options: []
|
36
36
|
require_paths:
|
37
37
|
- lib
|
@@ -47,7 +47,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
47
47
|
version: '0'
|
48
48
|
requirements: []
|
49
49
|
rubygems_version: 3.1.2
|
50
|
-
signing_key:
|
50
|
+
signing_key:
|
51
51
|
specification_version: 4
|
52
52
|
summary: Po'Pro
|
53
53
|
test_files: []
|