progress_bar 1.3.0 → 1.3.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: c5f2f598c5284b8678b50fda6e658b779f762f2796015198e63e3575857b1781
4
- data.tar.gz: 7af1747e5b1891d1cfc8dab910eb70182b6e84fce4f78cd3c8e5e085c5d5b375
3
+ metadata.gz: ba9ff51571d8c5a4420d524d098f474ab3434bad617ceef86d67de8450832553
4
+ data.tar.gz: dd6e5b12b7fba8db09fc775b05d1e70baa5b2a4c72fbcce578a3c5b65743eb01
5
5
  SHA512:
6
- metadata.gz: 851c93c172aef835d875aec05ff5e120b620876bc6acdf7df3defc112d401e063d884b7fe07512e78b265b86bac2061c3d5c8680e3ffc655a202eb705058e21f
7
- data.tar.gz: a627440837335d3db73301deddc9896fc877df1fbdb0f3387e91618d93a6bfaf037a98d82044709c8a612aeab1c58e6a944b65197d47a4c282fe2a805a804542
6
+ metadata.gz: 663bd5538ea023b5153f24829f9ef009fd05c2e1a3d9034bb1e0887e8202c0f62bccb6e9e8898a11bf09e5cc153e21e1f52c46097a1a013df33308aea725ef48
7
+ data.tar.gz: 67bc5eef3c976f9533e0ca4d29edc8c0f298dd4869ec6f4d2978a1ad3f963c526c5e65536550253d6a4f9e746a1bfb94863c4934e2be8dc547743cfa8aaf8112
@@ -0,0 +1,12 @@
1
+ # These are supported funding model platforms
2
+
3
+ github: paul
4
+ patreon: # Replace with a single Patreon username
5
+ open_collective: # Replace with a single Open Collective username
6
+ ko_fi: # Replace with a single Ko-fi username
7
+ tidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel
8
+ community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry
9
+ liberapay: # Replace with a single Liberapay username
10
+ issuehunt: # Replace with a single IssueHunt username
11
+ otechie: # Replace with a single Otechie username
12
+ custom: # Replace with up to 4 custom sponsorship URLs e.g., ['link1', 'link2']
@@ -0,0 +1,32 @@
1
+ ---
2
+ name: Lint
3
+ "on": [pull_request]
4
+ jobs:
5
+ lint:
6
+ name: Pronto
7
+ runs-on: ubuntu-latest
8
+ steps:
9
+ - uses: actions/checkout@v1.0.0
10
+ - uses: actions/setup-ruby@v1
11
+ with:
12
+ ruby-version: '2.6'
13
+ - name: Install dependencies
14
+ run: |
15
+ sudo apt-get update -qq
16
+ sudo apt-get install -qqy --no-install-recommends yamllint jq
17
+ gem install bundler --no-document
18
+ bundle install
19
+ gem install --no-document \
20
+ pronto \
21
+ pronto-brakeman \
22
+ pronto-flay \
23
+ pronto-reek \
24
+ pronto-rubocop \
25
+ pronto-yamllint
26
+
27
+ - name: Pronto
28
+ env:
29
+ PRONTO_GITHUB_ACCESS_TOKEN: ${{ secrets.GITHUB_TOKEN }}
30
+ run: |
31
+ export PRONTO_PULL_REQUEST_ID=$(jq .number -r $GITHUB_EVENT_PATH)
32
+ pronto run -c origin/master -f github_status github_pr_review text
@@ -0,0 +1,26 @@
1
+ ---
2
+ name: Test
3
+ "on": [pull_request]
4
+ jobs:
5
+ rspec:
6
+ name: RSpec
7
+ runs-on: ubuntu-latest
8
+ strategy:
9
+ matrix:
10
+ ruby:
11
+ - 2.4
12
+ - 2.5
13
+ - 2.6
14
+ steps:
15
+ - uses: actions/checkout@v1.0.0
16
+ - uses: actions/setup-ruby@v1
17
+ with:
18
+ ruby-version: ${{ matrix.ruby }}
19
+ - name: Install dependencies
20
+ run: |
21
+ gem install bundler --no-document
22
+ bundle install
23
+
24
+ - name: RSpec
25
+ run: |
26
+ rspec
data/.gitignore CHANGED
@@ -2,3 +2,12 @@
2
2
  .bundle
3
3
  Gemfile.lock
4
4
  pkg/*
5
+
6
+ # Rubocop inherited configs
7
+ .rubocop-http*
8
+
9
+ # Editor junk
10
+ .DS_Store
11
+ .vscode
12
+ .idea
13
+
@@ -0,0 +1,51 @@
1
+ ---
2
+ exclude_paths:
3
+ - bin
4
+
5
+ detectors:
6
+ UtilityFunction:
7
+ public_methods_only: true
8
+
9
+ TooManyStatements:
10
+ exclude:
11
+ - initialize
12
+ max_statements: 8
13
+
14
+ RepeatedConditional:
15
+ max_ifs: 4
16
+
17
+ LongParameterList:
18
+ exclude:
19
+ - initialize
20
+
21
+ # This one just makes sure the Class/Module has a comment. Dumb.
22
+ IrresponsibleModule:
23
+ enabled: false
24
+
25
+ # Transaction result blocks are 3-deep
26
+ NestedIterators:
27
+ max_allowed_nesting: 3
28
+
29
+ UncommunicativeVariableName:
30
+ accept:
31
+ - i # array index
32
+ - c # config
33
+ - k # key
34
+ - v # value
35
+ - h # hash initializer (Hash.new { |h,k| h[k] = Hash.new })
36
+ - "_"
37
+ UncommunicativeModuleName:
38
+ accept:
39
+ - Auth0
40
+
41
+ # AS::Subscriber objects tend to rely heavily on `event` and `payload`, so its
42
+ # hard to avoid "Feature Envy", but is perfectly readable.
43
+ FeatureEnvy:
44
+ enabled: false
45
+
46
+ directories:
47
+ "spec/support":
48
+ UtilityFunction:
49
+ enabled: false
50
+
51
+ # vi:syntax=yaml
@@ -0,0 +1,113 @@
1
+ ---
2
+ inherit_from:
3
+ - https://relaxed.ruby.style/rubocop.yml
4
+
5
+ require:
6
+ - rubocop-rspec
7
+
8
+ Rails:
9
+ Enabled: true
10
+
11
+ AllCops:
12
+ DisplayCopNames: true
13
+ DisplayStyleGuide: true
14
+ TargetRubyVersion: 2.6
15
+
16
+ Exclude:
17
+ - "vendor/**/*"
18
+ - "spec/fixtures/**/*"
19
+ - "bin/**/*"
20
+ - "script/**/*"
21
+ - "tmp/**/*"
22
+
23
+ Layout/AlignHash:
24
+ EnforcedHashRocketStyle: table
25
+ EnforcedColonStyle: table
26
+ Lint/AmbiguousBlockAssociation:
27
+ Exclude:
28
+ - "spec/**/*" # `expect { }.to change { }` is fine
29
+ Lint/ShadowingOuterLocalVariable:
30
+ # Shadowing outer local variables with block parameters is often useful to
31
+ # not reinvent a new name for the same thing, it highlights the relation
32
+ # between the outer variable and the parameter. The cases where it's actually
33
+ # confusing are rare, and usually bad for other reasons already, for example
34
+ # because the method is too long.
35
+ Enabled: false
36
+ Metrics/BlockLength:
37
+ Exclude:
38
+ - Gemfile
39
+ - Guardfile
40
+ - shared_context
41
+ - feature
42
+ ExcludedMethods:
43
+ - configure
44
+ - context
45
+ - define
46
+ - describe
47
+ - factory
48
+ - it
49
+ - namespace
50
+ - specify
51
+ - task
52
+ - shared_examples_for
53
+ - shared_context
54
+ - feature
55
+ - define_type
56
+ Metrics/LineLength:
57
+ Enabled: true
58
+ Max: 120
59
+ Metrics/ClassLength:
60
+ Exclude:
61
+ - "spec/**/*_spec.rb"
62
+ Naming/RescuedExceptionsVariableName:
63
+ PreferredName: ex
64
+ Naming/FileName:
65
+ Enabled: false
66
+ Naming/UncommunicativeMethodParamName:
67
+ Enabled: false
68
+ Style/EmptyLiteral:
69
+ Enabled: false
70
+ Style/FormatStringToken:
71
+ Enabled: false
72
+ Style/FrozenStringLiteralComment:
73
+ Enabled: true
74
+ Style/HashSyntax:
75
+ Exclude:
76
+ - lib/tasks/**/*.rake
77
+ Style/NumericLiterals:
78
+ Enabled: false
79
+ Style/StringLiterals:
80
+ Enabled: true
81
+ EnforcedStyle: double_quotes
82
+ Style/SymbolArray:
83
+ MinSize: 4
84
+
85
+ # Rspec
86
+ Capybara/FeatureMethods:
87
+ Enabled: false
88
+ RSpec/ContextWording:
89
+ Enabled: false
90
+ RSpec/DescribeClass:
91
+ Enabled: false
92
+ RSpec/DescribedClass:
93
+ Enabled: false
94
+ RSpec/ExampleLength:
95
+ Max: 10
96
+ RSpec/ExampleWording:
97
+ Enabled: false
98
+ RSpec/ExpectChange:
99
+ EnforcedStyle: block
100
+ RSpec/ImplicitExpect:
101
+ Enabled: false
102
+ RSpec/LeadingSubject:
103
+ Enabled: false
104
+ RSpec/MultipleExpectations:
105
+ Max: 4
106
+ RSpec/NestedGroups:
107
+ Max: 4
108
+ RSpec/NotToNot:
109
+ Enabled: false
110
+ RSpec/ExpectInHook:
111
+ Enabled: false
112
+ RSpec/LetSetup:
113
+ Enabled: false
@@ -1,3 +1,7 @@
1
+ # 1.3.1
2
+
3
+ * Added support for passing bar options to `Enumerable#with_progress`
4
+ extension.
1
5
 
2
6
  # 1.3.0
3
7
 
data/README.mkd CHANGED
@@ -1,6 +1,6 @@
1
1
  # ProgressBar
2
2
 
3
- [![Build Status](https://travis-ci.org/paul/progress_bar.png?branch=master)](https://travis-ci.org/paul/progress_bar)[![Gem Version](https://badge.fury.io/rb/progress_bar.svg)](http://badge.fury.io/rb/progress_bar)
3
+ [![Build Status](https://github.com/paul/progress_bar/workflows/Test/badge.svg)](https://github.com/paul/progress_bar/actions)[![Gem Version](https://badge.fury.io/rb/progress_bar.svg)](http://badge.fury.io/rb/progress_bar)
4
4
 
5
5
  *ProgressBar* is a simple Ruby library for displaying progress of
6
6
  long-running tasks on the console. It is intended to be as simple to use
@@ -110,3 +110,9 @@ require 'progress_bar/core_ext/enumerable_with_progress'
110
110
 
111
111
  (1..400).with_progress.select{|i| (i % 2).zero?}
112
112
  ```
113
+
114
+ If you want to display only specific meters you can do it like so:
115
+
116
+ ```ruby
117
+ (1..400).with_progress(:bar, :elapsed).select{|i| (i % 2).zero?}
118
+ ```
@@ -1,3 +1,3 @@
1
1
  class ProgressBar
2
- VERSION = "1.3.0"
2
+ VERSION = "1.3.1"
3
3
  end
@@ -1,7 +1,7 @@
1
1
  class ProgressBar
2
2
  module WithProgress
3
- def each_with_progress(&block)
4
- bar = ProgressBar.new(count)
3
+ def each_with_progress(*args, &block)
4
+ bar = ProgressBar.new(count, *args)
5
5
  if block
6
6
  each{|obj| yield(obj).tap{bar.increment!}}
7
7
  else
@@ -10,6 +10,7 @@ Gem::Specification.new do |s|
10
10
  s.authors = ["Paul Sadauskas"]
11
11
  s.email = ["psadauskas@gmail.com"]
12
12
  s.homepage = "http://github.com/paul/progress_bar"
13
+ s.license = "WTFPL"
13
14
  s.summary = "Simple Progress Bar for output to a terminal"
14
15
  s.description = "Give people feedback about long-running tasks without overloading them with information: Use a progress bar, like Curl or Wget!"
15
16
 
@@ -19,7 +20,10 @@ Gem::Specification.new do |s|
19
20
  s.add_dependency("options", "~> 2.3.0")
20
21
 
21
22
  s.add_development_dependency("rake")
23
+ s.add_development_dependency("reek")
22
24
  s.add_development_dependency("rspec")
25
+ s.add_development_dependency("rubocop")
26
+ s.add_development_dependency("rubocop-rspec")
23
27
  s.add_development_dependency("timecop")
24
28
 
25
29
  s.files = `git ls-files`.split("\n")
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: progress_bar
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.3.0
4
+ version: 1.3.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Paul Sadauskas
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-09-21 00:00:00.000000000 Z
11
+ date: 2019-11-29 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: highline
@@ -58,6 +58,20 @@ dependencies:
58
58
  - - ">="
59
59
  - !ruby/object:Gem::Version
60
60
  version: '0'
61
+ - !ruby/object:Gem::Dependency
62
+ name: reek
63
+ requirement: !ruby/object:Gem::Requirement
64
+ requirements:
65
+ - - ">="
66
+ - !ruby/object:Gem::Version
67
+ version: '0'
68
+ type: :development
69
+ prerelease: false
70
+ version_requirements: !ruby/object:Gem::Requirement
71
+ requirements:
72
+ - - ">="
73
+ - !ruby/object:Gem::Version
74
+ version: '0'
61
75
  - !ruby/object:Gem::Dependency
62
76
  name: rspec
63
77
  requirement: !ruby/object:Gem::Requirement
@@ -72,6 +86,34 @@ dependencies:
72
86
  - - ">="
73
87
  - !ruby/object:Gem::Version
74
88
  version: '0'
89
+ - !ruby/object:Gem::Dependency
90
+ name: rubocop
91
+ requirement: !ruby/object:Gem::Requirement
92
+ requirements:
93
+ - - ">="
94
+ - !ruby/object:Gem::Version
95
+ version: '0'
96
+ type: :development
97
+ prerelease: false
98
+ version_requirements: !ruby/object:Gem::Requirement
99
+ requirements:
100
+ - - ">="
101
+ - !ruby/object:Gem::Version
102
+ version: '0'
103
+ - !ruby/object:Gem::Dependency
104
+ name: rubocop-rspec
105
+ requirement: !ruby/object:Gem::Requirement
106
+ requirements:
107
+ - - ">="
108
+ - !ruby/object:Gem::Version
109
+ version: '0'
110
+ type: :development
111
+ prerelease: false
112
+ version_requirements: !ruby/object:Gem::Requirement
113
+ requirements:
114
+ - - ">="
115
+ - !ruby/object:Gem::Version
116
+ version: '0'
75
117
  - !ruby/object:Gem::Dependency
76
118
  name: timecop
77
119
  requirement: !ruby/object:Gem::Requirement
@@ -94,8 +136,13 @@ executables: []
94
136
  extensions: []
95
137
  extra_rdoc_files: []
96
138
  files:
139
+ - ".github/FUNDING.yml"
140
+ - ".github/workflows/pronto.yml"
141
+ - ".github/workflows/rspec.yml"
97
142
  - ".gitignore"
143
+ - ".reek.yml"
98
144
  - ".rspec"
145
+ - ".rubocop.yml"
99
146
  - ".travis.yml"
100
147
  - Changelog.mkd
101
148
  - Gemfile
@@ -124,7 +171,8 @@ files:
124
171
  - spec/spec_helper.rb
125
172
  - spec/with_progress_spec.rb
126
173
  homepage: http://github.com/paul/progress_bar
127
- licenses: []
174
+ licenses:
175
+ - WTFPL
128
176
  metadata: {}
129
177
  post_install_message:
130
178
  rdoc_options: []
@@ -141,9 +189,18 @@ required_rubygems_version: !ruby/object:Gem::Requirement
141
189
  - !ruby/object:Gem::Version
142
190
  version: '0'
143
191
  requirements: []
144
- rubyforge_project: progress_bar
145
- rubygems_version: 2.7.6
192
+ rubygems_version: 3.0.3
146
193
  signing_key:
147
194
  specification_version: 4
148
195
  summary: Simple Progress Bar for output to a terminal
149
- test_files: []
196
+ test_files:
197
+ - spec/arguments_spec.rb
198
+ - spec/bar_spec.rb
199
+ - spec/counter_spec.rb
200
+ - spec/elapsed_spec.rb
201
+ - spec/eta_spec.rb
202
+ - spec/percentage_spec.rb
203
+ - spec/progress_bar_spec.rb
204
+ - spec/rate_spec.rb
205
+ - spec/spec_helper.rb
206
+ - spec/with_progress_spec.rb