Skip to content

Commit

Permalink
Adds frozen_string_literal: true
Browse files Browse the repository at this point in the history
  • Loading branch information
ixti committed Feb 10, 2016
1 parent 81f5cc1 commit 1b0f1de
Show file tree
Hide file tree
Showing 32 changed files with 34 additions and 18 deletions.
6 changes: 4 additions & 2 deletions .rubocop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,9 @@ Style/EmptyLineBetweenDefs:
Style/Encoding:
EnforcedStyle: when_needed

Style/FrozenStringLiteralComment:
EnforcedStyle: always

Style/HashSyntax:
EnforcedStyle: hash_rockets

Expand All @@ -34,8 +37,7 @@ Style/MultilineOperationIndentation:
# IMHO `%r{foo/bar}` looks way more cleaner than `/foo\/bar/`.
# Enabling this cop also makes Guardfile (which is full of pathname regexps)
# look absolutley (style) inconsistent and terrible. Thus it should be on
# developer's choice whenever to user `%r` or not. Just like we don't enforce
# to use `["foo"]` over `%w(foo)` and so on.
# developer's choice whenever to user `%r` or not.
Style/RegexpLiteral:
Enabled: false

Expand Down
1 change: 1 addition & 0 deletions Gemfile
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# frozen_string_literal: true
source "https://rubygems.org"

group :test do
Expand Down
1 change: 1 addition & 0 deletions Rakefile
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# frozen_string_literal: true
require "bundler/gem_tasks"

require "rspec/core/rake_task"
Expand Down
14 changes: 0 additions & 14 deletions bin/console

This file was deleted.

3 changes: 1 addition & 2 deletions bin/setup
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
#!/bin/bash

set -euo pipefail
IFS=$'\n\t'

bundle install

# Do any other automated setup that you need to do here
1 change: 1 addition & 0 deletions lib/sidekiq/throttled.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# frozen_string_literal: true
# 3rd party
require "sidekiq"

Expand Down
1 change: 1 addition & 0 deletions lib/sidekiq/throttled/basic_fetch.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# frozen_string_literal: true
# stdlib
require "thread"

Expand Down
1 change: 1 addition & 0 deletions lib/sidekiq/throttled/errors.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# frozen_string_literal: true
module Sidekiq
module Throttled
# Generic class for Sidekiq::Throttled errors
Expand Down
1 change: 1 addition & 0 deletions lib/sidekiq/throttled/middleware.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# frozen_string_literal: true
# internal
require "sidekiq/throttled/registry"

Expand Down
1 change: 1 addition & 0 deletions lib/sidekiq/throttled/registry.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# frozen_string_literal: true
# internal
require "sidekiq/throttled/strategy"

Expand Down
1 change: 1 addition & 0 deletions lib/sidekiq/throttled/strategy.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# frozen_string_literal: true
# internal
require "sidekiq/throttled/errors"
require "sidekiq/throttled/strategy/concurrency"
Expand Down
1 change: 1 addition & 0 deletions lib/sidekiq/throttled/strategy/concurrency.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# frozen_string_literal: true
# internal
require "sidekiq/throttled/strategy/script"

Expand Down
1 change: 1 addition & 0 deletions lib/sidekiq/throttled/strategy/script.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# frozen_string_literal: true
module Sidekiq
module Throttled
class Strategy
Expand Down
1 change: 1 addition & 0 deletions lib/sidekiq/throttled/strategy/threshold.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# frozen_string_literal: true
# internal
require "sidekiq/throttled/strategy/script"

Expand Down
1 change: 1 addition & 0 deletions lib/sidekiq/throttled/testing.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# frozen_string_literal: true
require "sidekiq/throttled/registry"

RSpec.configure do |config|
Expand Down
1 change: 1 addition & 0 deletions lib/sidekiq/throttled/version.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# frozen_string_literal: true
module Sidekiq
module Throttled
# Gem version
Expand Down
1 change: 1 addition & 0 deletions lib/sidekiq/throttled/web.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# frozen_string_literal: true
# stdlib
require "pathname"

Expand Down
1 change: 1 addition & 0 deletions lib/sidekiq/throttled/web/stats.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# frozen_string_literal: true
module Sidekiq
module Throttled
module Web
Expand Down
1 change: 1 addition & 0 deletions lib/sidekiq/throttled/worker.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# frozen_string_literal: true
# internal
require "sidekiq/throttled/registry"

Expand Down
1 change: 1 addition & 0 deletions sidekiq-throttled.gemspec
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# coding: utf-8
# frozen_string_literal: true

lib = File.expand_path("../lib", __FILE__)
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
Expand Down
1 change: 1 addition & 0 deletions spec/sidekiq/throttled/basic_fetch_spec.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# frozen_string_literal: true
require "sidekiq/throttled/basic_fetch"

RSpec.describe Sidekiq::Throttled::BasicFetch, :sidekiq => :disabled do
Expand Down
1 change: 1 addition & 0 deletions spec/sidekiq/throttled/middleware_spec.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# frozen_string_literal: true
require "sidekiq/throttled/middleware"

RSpec.describe Sidekiq::Throttled::Middleware do
Expand Down
1 change: 1 addition & 0 deletions spec/sidekiq/throttled/registry_spec.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# frozen_string_literal: true
RSpec.describe Sidekiq::Throttled::Registry do
let(:threshold) { { :threshold => { :limit => 1, :period => 1 } } }
let(:concurrency) { { :concurrency => { :limit => 1 } } }
Expand Down
1 change: 1 addition & 0 deletions spec/sidekiq/throttled/strategy/concurrency_spec.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# frozen_string_literal: true
RSpec.describe Sidekiq::Throttled::Strategy::Concurrency do
subject(:strategy) { described_class.new :test, :limit => 5 }

Expand Down
1 change: 1 addition & 0 deletions spec/sidekiq/throttled/strategy/threshold_spec.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# frozen_string_literal: true
RSpec.describe Sidekiq::Throttled::Strategy::Threshold do
subject(:strategy) { described_class.new :test, :limit => 5, :period => 10 }

Expand Down
1 change: 1 addition & 0 deletions spec/sidekiq/throttled/strategy_spec.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# frozen_string_literal: true
RSpec.describe Sidekiq::Throttled::Strategy do
subject(:strategy) { described_class.new(:foo, **options) }

Expand Down
1 change: 1 addition & 0 deletions spec/sidekiq/throttled/web/stats_spec.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# frozen_string_literal: true
require "sidekiq/throttled/web/stats"

RSpec.describe Sidekiq::Throttled::Web::Stats do
Expand Down
1 change: 1 addition & 0 deletions spec/sidekiq/throttled/web_spec.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# frozen_string_literal: true
require "rack/test"

require "sidekiq/throttled/web"
Expand Down
1 change: 1 addition & 0 deletions spec/sidekiq/throttled/worker_spec.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# frozen_string_literal: true
RSpec.describe Sidekiq::Throttled::Worker do
let(:working_class) { Class.new { include Sidekiq::Throttled::Worker } }

Expand Down
1 change: 1 addition & 0 deletions spec/sidekiq/throttled_spec.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# frozen_string_literal: true
RSpec.describe Sidekiq::Throttled, :sidekiq => :disabled do
describe ".setup!" do
before do
Expand Down
1 change: 1 addition & 0 deletions spec/sidekiq_helper.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# frozen_string_literal: true
require "securerandom"

require "sidekiq/testing"
Expand Down
1 change: 1 addition & 0 deletions spec/spec_helper.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# coding: utf-8
# frozen_string_literal: true

require "simplecov"
require "coveralls"
Expand Down

0 comments on commit 1b0f1de

Please sign in to comment.