Skip to content

Commit

Permalink
I like parallel assignments
Browse files Browse the repository at this point in the history
  • Loading branch information
toy committed Jan 11, 2016
1 parent cf7e374 commit d5cdbbc
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
3 changes: 3 additions & 0 deletions .rubocop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,9 @@ Style/IfUnlessModifier:
Style/IndentHash:
EnforcedStyle: consistent

Style/ParallelAssignment:
Enabled: false

Style/PercentLiteralDelimiters:
PreferredDelimiters:
'%w': '[]'
Expand Down
3 changes: 1 addition & 2 deletions lib/progress.rb
Original file line number Diff line number Diff line change
Expand Up @@ -71,8 +71,7 @@ def to_f(inner)

def step(step, note)
unless step.is_a?(Numeric)
note = step
step = nil
step, note = nil, step
end
step = 1 if step.nil?

Expand Down
4 changes: 1 addition & 3 deletions lib/progress/with_progress.rb
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,7 @@ def self.new(*args, &block)
# initialize with object responding to each, title and optional length
# if block is provided, it is passed to each
def initialize(enum, title = nil, length = nil)
@enum = enum
@title = title
@length = length
@enum, @title, @length = enum, title, length
end

# returns self but changes title
Expand Down

0 comments on commit d5cdbbc

Please sign in to comment.