Skip to content

Change for frozen string literal #590

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions benchmarking/logging.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# frozen_string_literal: true
# Run with
#
# $ ruby -Ilib benchmarking/logging.rb
Expand Down
1 change: 1 addition & 0 deletions benchmarking/pipeline.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# frozen_string_literal: true
require "benchmark"

$:.push File.join(File.dirname(__FILE__), 'lib')
Expand Down
1 change: 1 addition & 0 deletions benchmarking/speed.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# frozen_string_literal: true
# Run with
#
# $ ruby -Ilib benchmarking/speed.rb
Expand Down
1 change: 1 addition & 0 deletions benchmarking/suite.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# frozen_string_literal: true
require 'fileutils'

def run_in_background(command)
Expand Down
1 change: 1 addition & 0 deletions benchmarking/worker.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# frozen_string_literal: true
BENCHMARK_ROOT = File.dirname(__FILE__)
REDIS_ROOT = File.join(BENCHMARK_ROOT, "..", "lib")

Expand Down
1 change: 1 addition & 0 deletions examples/basic.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# frozen_string_literal: true
require 'redis'

r = Redis.new
Expand Down
1 change: 1 addition & 0 deletions examples/consistency.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# frozen_string_literal: true
# This file implements a simple consistency test for Redis-rb (or any other
# Redis environment if you pass a different client object) where a client
# writes to the database using INCR in order to increment keys, but actively
Expand Down
1 change: 1 addition & 0 deletions examples/dist_redis.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# frozen_string_literal: true
require "redis"
require "redis/distributed"

Expand Down
1 change: 1 addition & 0 deletions examples/incr-decr.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# frozen_string_literal: true
require 'redis'

r = Redis.new
Expand Down
1 change: 1 addition & 0 deletions examples/list.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# frozen_string_literal: true
require 'rubygems'
require 'redis'

Expand Down
1 change: 1 addition & 0 deletions examples/pubsub.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# frozen_string_literal: true
require "redis"

puts <<-EOS
Expand Down
1 change: 1 addition & 0 deletions examples/sentinel.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# frozen_string_literal: true
require 'redis'

# This example creates a master-slave setup with a sentinel, then connects to
Expand Down
1 change: 1 addition & 0 deletions examples/sets.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# frozen_string_literal: true
require 'rubygems'
require 'redis'

Expand Down
1 change: 1 addition & 0 deletions examples/unicorn/unicorn.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# frozen_string_literal: true
require "redis"

worker_processes 3
Expand Down
1 change: 1 addition & 0 deletions lib/redis.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# frozen_string_literal: true
require "monitor"
require "redis/errors"

Expand Down
1 change: 1 addition & 0 deletions lib/redis/client.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# frozen_string_literal: true
require "redis/errors"
require "socket"
require "cgi"
Expand Down
3 changes: 2 additions & 1 deletion lib/redis/connection.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# frozen_string_literal: true
require "redis/connection/registry"

# If a connection driver was required before this file, the array
Expand All @@ -6,4 +7,4 @@
# the plain Ruby driver as our default. Another driver can be required at a
# later point in time, causing it to be the last element of the #drivers array
# and therefore be chosen by default.
require "redis/connection/ruby" if Redis::Connection.drivers.empty?
require "redis/connection/ruby" if Redis::Connection.drivers.empty?
1 change: 1 addition & 0 deletions lib/redis/connection/command_helper.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# frozen_string_literal: true
class Redis
module Connection
module CommandHelper
Expand Down
1 change: 1 addition & 0 deletions lib/redis/connection/hiredis.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# frozen_string_literal: true
require "redis/connection/registry"
require "redis/errors"
require "hiredis/connection"
Expand Down
1 change: 1 addition & 0 deletions lib/redis/connection/registry.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# frozen_string_literal: true
class Redis
module Connection

Expand Down
3 changes: 2 additions & 1 deletion lib/redis/connection/ruby.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# frozen_string_literal: true
require "redis/connection/registry"
require "redis/connection/command_helper"
require "redis/errors"
Expand All @@ -13,7 +14,7 @@ def initialize(*args)
super(*args)

@timeout = nil
@buffer = ""
@buffer = String.new("")
end

def timeout=(timeout)
Expand Down
1 change: 1 addition & 0 deletions lib/redis/connection/synchrony.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# frozen_string_literal: true
require "redis/connection/command_helper"
require "redis/connection/registry"
require "redis/errors"
Expand Down
1 change: 1 addition & 0 deletions lib/redis/distributed.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# frozen_string_literal: true
require "redis/hash_ring"

class Redis
Expand Down
1 change: 1 addition & 0 deletions lib/redis/errors.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# frozen_string_literal: true
class Redis
# Base error for all redis-rb errors.
class BaseError < RuntimeError
Expand Down
1 change: 1 addition & 0 deletions lib/redis/hash_ring.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# frozen_string_literal: true
require 'zlib'

class Redis
Expand Down
1 change: 1 addition & 0 deletions lib/redis/pipeline.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# frozen_string_literal: true
class Redis
unless defined?(::BasicObject)
class BasicObject
Expand Down
1 change: 1 addition & 0 deletions lib/redis/subscribe.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# frozen_string_literal: true
class Redis
class SubscribedClient
def initialize(client)
Expand Down
1 change: 1 addition & 0 deletions lib/redis/version.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# frozen_string_literal: true
class Redis
VERSION = "3.2.2"
end
1 change: 1 addition & 0 deletions test/bitpos_test.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# encoding: UTF-8
# frozen_string_literal: true

require File.expand_path("helper", File.dirname(__FILE__))

Expand Down
1 change: 1 addition & 0 deletions test/blocking_commands_test.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# encoding: UTF-8
# frozen_string_literal: true

require File.expand_path("helper", File.dirname(__FILE__))
require "lint/blocking_commands"
Expand Down
1 change: 1 addition & 0 deletions test/command_map_test.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# encoding: UTF-8
# frozen_string_literal: true

require File.expand_path("helper", File.dirname(__FILE__))

Expand Down
1 change: 1 addition & 0 deletions test/commands_on_hashes_test.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# encoding: UTF-8
# frozen_string_literal: true

require File.expand_path("helper", File.dirname(__FILE__))
require "lint/hashes"
Expand Down
3 changes: 2 additions & 1 deletion test/commands_on_hyper_log_log_test.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# encoding: UTF-8
# frozen_string_literal: true

require File.expand_path("helper", File.dirname(__FILE__))
require "lint/hyper_log_log"
Expand All @@ -18,4 +19,4 @@ def test_pfmerge
end
end

end
end
1 change: 1 addition & 0 deletions test/commands_on_lists_test.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# encoding: UTF-8
# frozen_string_literal: true

require File.expand_path("helper", File.dirname(__FILE__))
require "lint/lists"
Expand Down
1 change: 1 addition & 0 deletions test/commands_on_sets_test.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# encoding: UTF-8
# frozen_string_literal: true

require File.expand_path("helper", File.dirname(__FILE__))
require "lint/sets"
Expand Down
1 change: 1 addition & 0 deletions test/commands_on_sorted_sets_test.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# encoding: UTF-8
# frozen_string_literal: true

require File.expand_path("helper", File.dirname(__FILE__))
require "lint/sorted_sets"
Expand Down
1 change: 1 addition & 0 deletions test/commands_on_strings_test.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# encoding: UTF-8
# frozen_string_literal: true

require File.expand_path("helper", File.dirname(__FILE__))
require "lint/strings"
Expand Down
1 change: 1 addition & 0 deletions test/commands_on_value_types_test.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# encoding: UTF-8
# frozen_string_literal: true

require File.expand_path("helper", File.dirname(__FILE__))
require "lint/value_types"
Expand Down
1 change: 1 addition & 0 deletions test/connection_handling_test.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# encoding: UTF-8
# frozen_string_literal: true

require File.expand_path("helper", File.dirname(__FILE__))

Expand Down
1 change: 1 addition & 0 deletions test/distributed_blocking_commands_test.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# encoding: UTF-8
# frozen_string_literal: true

require File.expand_path("helper", File.dirname(__FILE__))
require "lint/blocking_commands"
Expand Down
1 change: 1 addition & 0 deletions test/distributed_commands_on_hashes_test.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# encoding: UTF-8
# frozen_string_literal: true

require File.expand_path("helper", File.dirname(__FILE__))
require "lint/hashes"
Expand Down
1 change: 1 addition & 0 deletions test/distributed_commands_on_hyper_log_log_test.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# encoding: UTF-8
# frozen_string_literal: true

require File.expand_path("helper", File.dirname(__FILE__))
require "lint/hyper_log_log"
Expand Down
1 change: 1 addition & 0 deletions test/distributed_commands_on_lists_test.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# encoding: UTF-8
# frozen_string_literal: true

require File.expand_path("helper", File.dirname(__FILE__))
require "lint/lists"
Expand Down
1 change: 1 addition & 0 deletions test/distributed_commands_on_sets_test.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# encoding: UTF-8
# frozen_string_literal: true

require File.expand_path("helper", File.dirname(__FILE__))
require "lint/sets"
Expand Down
1 change: 1 addition & 0 deletions test/distributed_commands_on_sorted_sets_test.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# encoding: UTF-8
# frozen_string_literal: true

require File.expand_path("helper", File.dirname(__FILE__))
require "lint/sorted_sets"
Expand Down
1 change: 1 addition & 0 deletions test/distributed_commands_on_strings_test.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# encoding: UTF-8
# frozen_string_literal: true

require File.expand_path("helper", File.dirname(__FILE__))
require "lint/strings"
Expand Down
1 change: 1 addition & 0 deletions test/distributed_commands_on_value_types_test.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# encoding: UTF-8
# frozen_string_literal: true

require File.expand_path("helper", File.dirname(__FILE__))
require "lint/value_types"
Expand Down
1 change: 1 addition & 0 deletions test/distributed_commands_requiring_clustering_test.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# encoding: UTF-8
# frozen_string_literal: true

require File.expand_path("helper", File.dirname(__FILE__))

Expand Down
1 change: 1 addition & 0 deletions test/distributed_connection_handling_test.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# encoding: UTF-8
# frozen_string_literal: true

require File.expand_path("helper", File.dirname(__FILE__))

Expand Down
1 change: 1 addition & 0 deletions test/distributed_internals_test.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# encoding: UTF-8
# frozen_string_literal: true

require File.expand_path("helper", File.dirname(__FILE__))

Expand Down
1 change: 1 addition & 0 deletions test/distributed_key_tags_test.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# encoding: UTF-8
# frozen_string_literal: true

require File.expand_path("helper", File.dirname(__FILE__))

Expand Down
1 change: 1 addition & 0 deletions test/distributed_persistence_control_commands_test.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# encoding: UTF-8
# frozen_string_literal: true

require File.expand_path("helper", File.dirname(__FILE__))

Expand Down
1 change: 1 addition & 0 deletions test/distributed_publish_subscribe_test.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# encoding: UTF-8
# frozen_string_literal: true

require File.expand_path("helper", File.dirname(__FILE__))

Expand Down
1 change: 1 addition & 0 deletions test/distributed_remote_server_control_commands_test.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# encoding: UTF-8
# frozen_string_literal: true

require File.expand_path("helper", File.dirname(__FILE__))

Expand Down
1 change: 1 addition & 0 deletions test/distributed_scripting_test.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# encoding: UTF-8
# frozen_string_literal: true

require File.expand_path("helper", File.dirname(__FILE__))

Expand Down
1 change: 1 addition & 0 deletions test/distributed_sorting_test.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# encoding: UTF-8
# frozen_string_literal: true

require File.expand_path("helper", File.dirname(__FILE__))

Expand Down
1 change: 1 addition & 0 deletions test/distributed_test.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# encoding: UTF-8
# frozen_string_literal: true

require File.expand_path("helper", File.dirname(__FILE__))

Expand Down
1 change: 1 addition & 0 deletions test/distributed_transactions_test.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# encoding: UTF-8
# frozen_string_literal: true

require File.expand_path("helper", File.dirname(__FILE__))

Expand Down
1 change: 1 addition & 0 deletions test/encoding_test.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# encoding: UTF-8
# frozen_string_literal: true

require File.expand_path("helper", File.dirname(__FILE__))

Expand Down
1 change: 1 addition & 0 deletions test/error_replies_test.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# encoding: UTF-8
# frozen_string_literal: true

require File.expand_path("helper", File.dirname(__FILE__))

Expand Down
1 change: 1 addition & 0 deletions test/fork_safety_test.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# encoding: UTF-8
# frozen_string_literal: true

require File.expand_path("helper", File.dirname(__FILE__))

Expand Down
1 change: 1 addition & 0 deletions test/helper.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# frozen_string_literal: true
$:.unshift File.expand_path("../lib", File.dirname(__FILE__))
$:.unshift File.expand_path(File.dirname(__FILE__))

Expand Down
1 change: 1 addition & 0 deletions test/helper_test.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# encoding: UTF-8
# frozen_string_literal: true

require File.expand_path("helper", File.dirname(__FILE__))

Expand Down
1 change: 1 addition & 0 deletions test/internals_test.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# encoding: UTF-8
# frozen_string_literal: true

require File.expand_path("helper", File.dirname(__FILE__))

Expand Down
1 change: 1 addition & 0 deletions test/lint/blocking_commands.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# frozen_string_literal: true
module Lint

module BlockingCommands
Expand Down
1 change: 1 addition & 0 deletions test/lint/hashes.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# frozen_string_literal: true
module Lint

module Hashes
Expand Down
1 change: 1 addition & 0 deletions test/lint/hyper_log_log.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# frozen_string_literal: true
module Lint

module HyperLogLog
Expand Down
1 change: 1 addition & 0 deletions test/lint/lists.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# frozen_string_literal: true
module Lint

module Lists
Expand Down
Loading