progress 3.3.1 → 3.3.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,15 +1,7 @@
1
1
  ---
2
- !binary "U0hBMQ==":
3
- metadata.gz: !binary |-
4
- NDEzZWY4ZjY0NjcxOTdkZDAxN2I3MTEwNWQ1NWEzMTZhMGIxYjlkNg==
5
- data.tar.gz: !binary |-
6
- N2I5ZTMxMGE0MmQ1NThiZmQ0YjMxY2QxYWI0YmE1MTE4ZmY3NWI4ZQ==
2
+ SHA1:
3
+ metadata.gz: 64ca0726e8a2eb5bfd62828a9f9aeec7b0fc49b5
4
+ data.tar.gz: e7b15fed0cb040c622fc381a4922fd697c071ad5
7
5
  SHA512:
8
- metadata.gz: !binary |-
9
- MmI2NjIwZGYxMzMxZjgwMzEzZjhhY2YxMmM4NTlhNzVmNTk5YWRkNzFmODE2
10
- MDcxZGUwZjA5NmE2Y2M0NjFmZTRlM2QzNjYxNmU5OTdlODRiMzkwN2E2MTgx
11
- YWRkY2ExNzMzYTFkYjExNmZmOGJjNmNkYzQwNWE4M2IwOTFjYjM=
12
- data.tar.gz: !binary |-
13
- YjNjMjIzZDBjYThkYzMxZDU3ODQ1MjUyNDEzNjRkM2E2YzA1MTAwNzk0OWZi
14
- YTdkMDMyNjY1OGVhNTRkZTAzZjBkZWVjZWJhMmM1ZDdjZjMwYzg5NzI3YjRj
15
- ZWE1Nzg3NWE5YjU4YjAzMjdiMmRiZDc4MTA5ZmEwYjc0NTZiOWM=
6
+ metadata.gz: cda7bef90d61b0eed3af7397af5d2dc8a00fb8f2bf52539feef2edd9a5efc1d99ea9ea85d71465b8145f3fffad87cbe2ae43cc51ae3975f9475c681e110e647e
7
+ data.tar.gz: c20fd466c9d7a061035d4450a9c046d472f58c2bf43e49509c11717e9380bb28e04703aa8abcd810c1aeb8a2120ce6aabcd7083d9478a113c01329633c534c8e
@@ -2,6 +2,24 @@ AllCops:
2
2
  Exclude:
3
3
  - '*.gemspec'
4
4
 
5
+ Layout/AccessModifierIndentation:
6
+ EnforcedStyle: outdent
7
+
8
+ Layout/CaseIndentation:
9
+ EnforcedStyle: end
10
+
11
+ Layout/DotPosition:
12
+ EnforcedStyle: trailing
13
+
14
+ Layout/IndentHash:
15
+ EnforcedStyle: consistent
16
+
17
+ Layout/SpaceBeforeBlockBraces:
18
+ EnforcedStyle: no_space
19
+
20
+ Layout/SpaceInsideHashLiteralBraces:
21
+ EnforcedStyle: no_space
22
+
5
23
  Lint/EndAlignment:
6
24
  EnforcedStyleAlignWith: variable
7
25
 
@@ -27,8 +45,8 @@ Metrics/ModuleLength:
27
45
  Metrics/PerceivedComplexity:
28
46
  Max: 10
29
47
 
30
- Style/AccessModifierIndentation:
31
- EnforcedStyle: outdent
48
+ Performance/RedundantBlockCall:
49
+ Enabled: false
32
50
 
33
51
  Style/Alias:
34
52
  EnforcedStyle: prefer_alias_method
@@ -36,12 +54,6 @@ Style/Alias:
36
54
  Style/BracesAroundHashParameters:
37
55
  Enabled: false
38
56
 
39
- Style/CaseIndentation:
40
- EnforcedStyle: end
41
-
42
- Style/DotPosition:
43
- EnforcedStyle: trailing
44
-
45
57
  Style/DoubleNegation:
46
58
  Enabled: false
47
59
 
@@ -49,7 +61,7 @@ Style/EmptyCaseCondition:
49
61
  Enabled: false
50
62
 
51
63
  Style/Encoding:
52
- EnforcedStyle: when_needed
64
+ Enabled: false
53
65
 
54
66
  Style/HashSyntax:
55
67
  EnforcedStyle: hash_rockets
@@ -57,29 +69,15 @@ Style/HashSyntax:
57
69
  Style/IfUnlessModifier:
58
70
  MaxLineLength: 40
59
71
 
60
- Style/IndentHash:
61
- EnforcedStyle: consistent
62
-
63
72
  Style/NumericPredicate:
64
73
  Enabled: false
65
74
 
66
75
  Style/ParallelAssignment:
67
76
  Enabled: false
68
77
 
69
- Style/PercentLiteralDelimiters:
70
- PreferredDelimiters:
71
- '%w': '[]'
72
- '%W': '[]'
73
-
74
78
  Style/Semicolon:
75
79
  AllowAsExpressionSeparator: true
76
80
 
77
- Style/SpaceBeforeBlockBraces:
78
- EnforcedStyle: no_space
79
-
80
- Style/SpaceInsideHashLiteralBraces:
81
- EnforcedStyle: no_space
82
-
83
81
  Style/TrailingCommaInArguments:
84
82
  EnforcedStyleForMultiline: no_comma
85
83
 
@@ -7,19 +7,17 @@ rvm:
7
7
  - '1.9.3-p551'
8
8
  - '2.0.0-p648'
9
9
  - '2.1.10'
10
- - '2.2.6'
11
- - '2.3.3'
12
- - '2.4.0'
13
- - 'jruby-1.7.26'
10
+ - '2.2.8'
11
+ - '2.3.5'
12
+ - '2.4.2'
14
13
  - 'jruby-9.0.5.0'
15
- - 'jruby-9.1.5.0'
14
+ - 'jruby-9.1.9.0'
16
15
  script: bundle exec rspec
17
16
  matrix:
18
- fast_finish: true
19
17
  include:
20
18
  - env: RUBOCOP=✓
21
- rvm: '2'
19
+ rvm: '2.4.2'
22
20
  script: bundle exec rubocop
23
21
  - env: CHECK_RUBIES=✓
24
- rvm: '2'
22
+ rvm: '2.4.2'
25
23
  script: bundle exec travis_check_rubies
data/Gemfile CHANGED
@@ -2,4 +2,6 @@ source 'https://rubygems.org'
2
2
 
3
3
  gemspec
4
4
 
5
- gem 'travis_check_rubies', '~> 0.1'
5
+ if RUBY_VERSION >= '2.0'
6
+ gem 'travis_check_rubies', '~> 0.2'
7
+ end
@@ -26,7 +26,7 @@ class Progress
26
26
  # befriend with in_threads gem
27
27
  def in_threads(*args, &block)
28
28
  @enum.in_threads(*args).with_progress(@title, @length, &block)
29
- rescue
29
+ rescue NoMethodError
30
30
  super
31
31
  end
32
32
 
@@ -103,22 +103,22 @@ class Progress
103
103
  end
104
104
  end
105
105
 
106
- def run_with_length(enum, length, method, *args)
106
+ def run_with_length(enum, length, method, *args, &block)
107
107
  Progress.start(@title, length) do
108
- enum.send(method, *args) do |block_args|
108
+ enum.send(method, *args) do |*block_args|
109
109
  Progress.step do
110
- yield(block_args)
110
+ block.call(*block_args)
111
111
  end
112
112
  end
113
113
  end
114
114
  end
115
115
 
116
- def run_with_pos(io, method, *args)
116
+ def run_with_pos(io, method, *args, &block)
117
117
  size = io.respond_to?(:size) ? io.size : io.stat.size
118
118
  Progress.start(@title, size) do
119
- io.send(method, *args) do |block_args|
119
+ io.send(method, *args) do |*block_args|
120
120
  Progress.set(io.pos) do
121
- yield(block_args)
121
+ block.call(*block_args)
122
122
  end
123
123
  end
124
124
  end
@@ -2,7 +2,7 @@
2
2
 
3
3
  Gem::Specification.new do |s|
4
4
  s.name = 'progress'
5
- s.version = '3.3.1'
5
+ s.version = '3.3.2'
6
6
  s.summary = %q{Show progress of long running tasks}
7
7
  s.homepage = "http://github.com/toy/#{s.name}"
8
8
  s.authors = ['Ivan Kuchin']
@@ -52,8 +52,8 @@ describe Progress do
52
52
  it 'checks respond_to? methods of self and of Enumerable' do
53
53
  with_progress = [1, 2, 3].with_progress
54
54
 
55
- ([:each, :with_progress] + Enumerable.instance_methods).each do |method|
56
- expect(with_progress).to respond_to(method)
55
+ (%w[each with_progress] + Enumerable.instance_methods).each do |method|
56
+ expect(with_progress).to respond_to(method.to_sym)
57
57
  end
58
58
  end
59
59
 
@@ -95,6 +95,17 @@ describe Progress do
95
95
  expect{ reference.next }.to raise_error(StopIteration)
96
96
  end
97
97
 
98
+ it 'does not break each_with_index' do
99
+ reference = enum.each
100
+ counter = 0
101
+ enum.with_progress.each_with_index do |n, i|
102
+ expect(n).to eq(reference.next)
103
+ expect(i).to eq(counter)
104
+ counter += 1
105
+ end
106
+ expect{ reference.next }.to raise_error(StopIteration)
107
+ end
108
+
98
109
  it 'does not break find' do
99
110
  default = proc{ 'default' }
100
111
  expect(enum.with_progress.find{ |n| n == 100 }).
metadata CHANGED
@@ -1,38 +1,52 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: progress
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.3.1
4
+ version: 3.3.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ivan Kuchin
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-02-22 00:00:00.000000000 Z
11
+ date: 2017-10-08 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rspec
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - ~>
17
+ - - "~>"
18
18
  - !ruby/object:Gem::Version
19
19
  version: '3.0'
20
20
  type: :development
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
- - - ~>
24
+ - - "~>"
25
25
  - !ruby/object:Gem::Version
26
26
  version: '3.0'
27
+ - !ruby/object:Gem::Dependency
28
+ name: rubocop
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - "~>"
32
+ - !ruby/object:Gem::Version
33
+ version: '0.27'
34
+ type: :development
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - "~>"
39
+ - !ruby/object:Gem::Version
40
+ version: '0.27'
27
41
  description:
28
42
  email:
29
43
  executables: []
30
44
  extensions: []
31
45
  extra_rdoc_files: []
32
46
  files:
33
- - .gitignore
34
- - .rubocop.yml
35
- - .travis.yml
47
+ - ".gitignore"
48
+ - ".rubocop.yml"
49
+ - ".travis.yml"
36
50
  - Gemfile
37
51
  - LICENSE.txt
38
52
  - README.markdown
@@ -58,21 +72,20 @@ require_paths:
58
72
  - lib
59
73
  required_ruby_version: !ruby/object:Gem::Requirement
60
74
  requirements:
61
- - - ! '>='
75
+ - - ">="
62
76
  - !ruby/object:Gem::Version
63
77
  version: '0'
64
78
  required_rubygems_version: !ruby/object:Gem::Requirement
65
79
  requirements:
66
- - - ! '>='
80
+ - - ">="
67
81
  - !ruby/object:Gem::Version
68
82
  version: '0'
69
83
  requirements: []
70
84
  rubyforge_project: progress
71
- rubygems_version: 2.6.4
85
+ rubygems_version: 2.6.13
72
86
  signing_key:
73
87
  specification_version: 4
74
88
  summary: Show progress of long running tasks
75
89
  test_files:
76
90
  - spec/progress_spec.rb
77
91
  - spec/test.csv
78
- has_rdoc: