Skip to content

Commit

Permalink
Update to latest standardrb, fix style issues
Browse files Browse the repository at this point in the history
  • Loading branch information
mperham committed Aug 28, 2019
1 parent 48fd615 commit 978ce8e
Show file tree
Hide file tree
Showing 8 changed files with 20 additions and 20 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
.rvmrc
.ruby-version
tags
gemfiles/*.lock
Gemfile.lock
*.swp
dump.rdb
.rbx
Expand Down
2 changes: 1 addition & 1 deletion lib/sidekiq.rb
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ def self.redis_info
end
rescue Redis::CommandError => ex
# 2850 return fake version when INFO command has (probably) been renamed
raise unless ex.message =~ /unknown command/
raise unless /unknown command/.match?(ex.message)
FAKE_INFO
end
end
Expand Down
8 changes: 4 additions & 4 deletions lib/sidekiq/api.rb
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ def fetch_stats!

s = processes.size
workers_size = pipe2_res[0...s].map(&:to_i).inject(0, &:+)
enqueued = pipe2_res[s..-1].map(&:to_i).inject(0, &:+)
enqueued = pipe2_res[s..-1].map(&:to_i).inject(0, &:+)

default_queue_latency = if (entry = pipe1_res[6].first)
job = begin
Expand Down Expand Up @@ -122,7 +122,7 @@ def fetch_stats!
end

def reset(*stats)
all = %w[failed processed]
all = %w[failed processed]
stats = stats.empty? ? all : all & stats.flatten.compact.map(&:to_s)

mset_args = []
Expand Down Expand Up @@ -274,7 +274,7 @@ def each

loop do
range_start = page * page_size - deleted_size
range_end = range_start + page_size - 1
range_end = range_start + page_size - 1
entries = Sidekiq.redis { |conn|
conn.lrange @rname, range_start, range_end
}
Expand Down Expand Up @@ -563,7 +563,7 @@ def each

loop do
range_start = page * page_size + offset_size
range_end = range_start + page_size - 1
range_end = range_start + page_size - 1
elements = Sidekiq.redis { |conn|
conn.zrange name, range_start, range_end, with_scores: true
}
Expand Down
2 changes: 1 addition & 1 deletion lib/sidekiq/middleware/chain.rb
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ class Entry

def initialize(klass, *args)
@klass = klass
@args = args
@args = args
end

def make_new
Expand Down
2 changes: 1 addition & 1 deletion lib/sidekiq/processor.rb
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ def dispatch(job_hash, queue)
# the Reloader. It handles code loading, db connection management, etc.
# Effectively this block denotes a "unit of work" to Rails.
@reloader.call do
klass = constantize(job_hash["class"])
klass = constantize(job_hash["class"])
worker = klass.new
worker.jid = job_hash["jid"]
@retrier.local(worker, pristine, queue) do
Expand Down
2 changes: 1 addition & 1 deletion lib/sidekiq/web/application.rb
Original file line number Diff line number Diff line change
Expand Up @@ -257,7 +257,7 @@ def self.set(key, val)

get "/stats" do
sidekiq_stats = Sidekiq::Stats.new
redis_stats = redis_info.select { |k, v| REDIS_KEYS.include? k }
redis_stats = redis_info.select { |k, v| REDIS_KEYS.include? k }
json(
sidekiq: {
processed: sidekiq_stats.processed,
Expand Down
2 changes: 1 addition & 1 deletion lib/sidekiq/web/helpers.rb
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ def user_preferred_languages
languages = env["HTTP_ACCEPT_LANGUAGE"]
languages.to_s.downcase.gsub(/\s+/, "").split(",").map { |language|
locale, quality = language.split(";q=", 2)
locale = nil if locale == "*" # Ignore wildcards
locale = nil if locale == "*" # Ignore wildcards
quality = quality ? quality.to_f : 1.0
[locale, quality]
}.sort { |(_, left), (_, right)|
Expand Down
20 changes: 10 additions & 10 deletions sidekiq.gemspec
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
require_relative "lib/sidekiq/version"

Gem::Specification.new do |gem|
gem.authors = ["Mike Perham"]
gem.email = ["[email protected]"]
gem.summary = "Simple, efficient background processing for Ruby"
gem.description = "Simple, efficient background processing for Ruby."
gem.homepage = "http://sidekiq.org"
gem.license = "LGPL-3.0"
gem.authors = ["Mike Perham"]
gem.email = ["[email protected]"]
gem.summary = "Simple, efficient background processing for Ruby"
gem.description = "Simple, efficient background processing for Ruby."
gem.homepage = "http://sidekiq.org"
gem.license = "LGPL-3.0"

gem.executables = ["sidekiq"]
gem.files = `git ls-files | grep -Ev '^(test|myapp|examples)'`.split("\n")
gem.name = "sidekiq"
gem.version = Sidekiq::VERSION
gem.executables = ["sidekiq"]
gem.files = `git ls-files | grep -Ev '^(test|myapp|examples)'`.split("\n")
gem.name = "sidekiq"
gem.version = Sidekiq::VERSION
gem.required_ruby_version = ">= 2.5.0"

gem.add_dependency "redis", ">= 4.1.0"
Expand Down

0 comments on commit 978ce8e

Please sign in to comment.