Skip to content

Commit

Permalink
Merge pull request sirupsen#32 from casperisfine/ruby-2.7
Browse files Browse the repository at this point in the history
Test against Ruby 2.7 and fix warnings
  • Loading branch information
maximebedard authored May 25, 2020
2 parents bc3a25a + d8a5198 commit 079ea92
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 5 deletions.
3 changes: 2 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ language: ruby
services:
- redis-server
rvm:
- 2.3
- 2.4
- 2.5
- 2.6
- 2.7
4 changes: 2 additions & 2 deletions lib/progressrus/core_ext/enumerable.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
module Enumerable
def with_progress(**args, &block)
def with_progress(args = {}, &block)
if block_given?
progresser = progress(args)
begin
Expand All @@ -25,7 +25,7 @@ def progress(args)
# Lazily read the size, for some enumerable this may be quite expensive and
# using this method should come with a warning in the documentation.
total = self.size unless args[:total]
@progress = Progressrus.new({total: total}.merge(args))
@progress = Progressrus.new(total: total, **args)
end
end
end
4 changes: 2 additions & 2 deletions lib/progressrus/store/redis.rb
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ def persist(progress, now: Time.now, force: false, expires_at: nil)
def scope(scope)
scope = redis.hgetall(key(scope))
scope.each_pair { |id, value|
scope[id] = Progressrus.new(deserialize(value))
scope[id] = Progressrus.new(**deserialize(value))
}
rescue *BACKEND_EXCEPTIONS => e
raise Progressrus::Store::BackendError.new(e)
Expand All @@ -41,7 +41,7 @@ def find(scope, id)
value = redis.hget(key(scope), id)
return unless value

Progressrus.new(deserialize(value))
Progressrus.new(**deserialize(value))
rescue *BACKEND_EXCEPTIONS => e
raise Progressrus::Store::BackendError.new(e)
end
Expand Down

0 comments on commit 079ea92

Please sign in to comment.