Skip to content
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

feature: add frozen_string_literal: true comment #899

Merged
merged 1 commit into from Apr 24, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 1 addition & 0 deletions Gemfile
@@ -1,3 +1,4 @@
# frozen_string_literal: true
source 'https://rubygems.org'

gemspec
Expand Down
1 change: 1 addition & 0 deletions Rakefile
@@ -1,3 +1,4 @@
# frozen_string_literal: true
require 'bundler/gem_tasks'
require 'rake/testtask'
Rake::TestTask.new 'test' do |t|
Expand Down
1 change: 1 addition & 0 deletions benchmarking/logging.rb
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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 bin/build
@@ -1,4 +1,5 @@
#!/usr/bin/env ruby
# frozen_string_literal: true

TARBALL = ARGV[0]

Expand Down
1 change: 1 addition & 0 deletions bin/console
@@ -1,4 +1,5 @@
#!/usr/bin/env ruby
# frozen_string_literal: true

$LOAD_PATH.unshift(File.expand_path('../../lib', __FILE__))
require 'redis'
Expand Down
1 change: 1 addition & 0 deletions examples/basic.rb
@@ -1,3 +1,4 @@
# frozen_string_literal: true
require 'redis'

r = Redis.new
Expand Down
1 change: 1 addition & 0 deletions examples/consistency.rb
@@ -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
@@ -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
@@ -1,3 +1,4 @@
# frozen_string_literal: true
require 'redis'

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

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

puts <<-EOS
Expand Down
1 change: 1 addition & 0 deletions examples/sentinel.rb
@@ -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/sentinel/start
@@ -1,4 +1,5 @@
#! /usr/bin/env ruby
# frozen_string_literal: true

# This is a helper script used together with examples/sentinel.rb
# It runs two Redis masters, two slaves for each of them, and two sentinels.
Expand Down
1 change: 1 addition & 0 deletions examples/sets.rb
@@ -1,3 +1,4 @@
# frozen_string_literal: true
require 'rubygems'
require 'redis'

Expand Down
1 change: 1 addition & 0 deletions examples/unicorn/config.ru
@@ -1,3 +1,4 @@
# frozen_string_literal: true
run lambda { |env|
[200, {"Content-Type" => "text/plain"}, [Redis.current.randomkey]]
}
1 change: 1 addition & 0 deletions examples/unicorn/unicorn.rb
@@ -1,3 +1,4 @@
# frozen_string_literal: true
require "redis"

worker_processes 3
Expand Down
1 change: 1 addition & 0 deletions lib/redis/connection.rb
@@ -1,3 +1,4 @@
# frozen_string_literal: true
require_relative "connection/registry"

# If a connection driver was required before this file, the array
Expand Down
1 change: 1 addition & 0 deletions lib/redis/connection/command_helper.rb
@@ -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
@@ -1,3 +1,4 @@
# frozen_string_literal: true
require_relative "registry"
require_relative "../errors"
require "hiredis/connection"
Expand Down
1 change: 1 addition & 0 deletions lib/redis/connection/registry.rb
@@ -1,3 +1,4 @@
# frozen_string_literal: true
class Redis
module Connection

Expand Down
1 change: 1 addition & 0 deletions lib/redis/connection/ruby.rb
@@ -1,3 +1,4 @@
# frozen_string_literal: true
require_relative "registry"
require_relative "command_helper"
require_relative "../errors"
Expand Down
1 change: 1 addition & 0 deletions lib/redis/connection/synchrony.rb
@@ -1,3 +1,4 @@
# frozen_string_literal: true
require_relative "command_helper"
require_relative "registry"
require_relative "../errors"
Expand Down
1 change: 1 addition & 0 deletions lib/redis/distributed.rb
@@ -1,3 +1,4 @@
# frozen_string_literal: true
require_relative "hash_ring"

class Redis
Expand Down
1 change: 1 addition & 0 deletions lib/redis/errors.rb
@@ -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
@@ -1,3 +1,4 @@
# frozen_string_literal: true
require 'zlib'

class Redis
Expand Down
1 change: 1 addition & 0 deletions lib/redis/pipeline.rb
@@ -1,3 +1,4 @@
# frozen_string_literal: true
class Redis
class Pipeline
attr_accessor :db
Expand Down
1 change: 1 addition & 0 deletions lib/redis/subscribe.rb
@@ -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
@@ -1,3 +1,4 @@
# frozen_string_literal: true
class Redis
VERSION = '4.1.3'
end
1 change: 1 addition & 0 deletions redis.gemspec
@@ -1,3 +1,4 @@
# frozen_string_literal: true
require "./lib/redis/version"

Gem::Specification.new do |s|
Expand Down
1 change: 1 addition & 0 deletions test/bitpos_test.rb
@@ -1,3 +1,4 @@
# frozen_string_literal: true
require_relative "helper"

class TestBitpos < Minitest::Test
Expand Down
1 change: 1 addition & 0 deletions test/blocking_commands_test.rb
@@ -1,3 +1,4 @@
# frozen_string_literal: true
require_relative 'helper'
require_relative 'lint/blocking_commands'

Expand Down
1 change: 1 addition & 0 deletions test/client_test.rb
@@ -1,3 +1,4 @@
# frozen_string_literal: true
require_relative "helper"

class TestClient < Minitest::Test
Expand Down
1 change: 1 addition & 0 deletions test/command_map_test.rb
@@ -1,3 +1,4 @@
# frozen_string_literal: true
require_relative "helper"

class TestCommandMap < Minitest::Test
Expand Down
1 change: 1 addition & 0 deletions test/commands_on_geo_test.rb
@@ -1,3 +1,4 @@
# frozen_string_literal: true
require_relative "helper"

class TestCommandsGeo < Minitest::Test
Expand Down
1 change: 1 addition & 0 deletions test/commands_on_hashes_test.rb
@@ -1,3 +1,4 @@
# frozen_string_literal: true
require_relative 'helper'
require_relative 'lint/hashes'

Expand Down
1 change: 1 addition & 0 deletions test/commands_on_hyper_log_log_test.rb
@@ -1,3 +1,4 @@
# frozen_string_literal: true
require_relative 'helper'
require_relative 'lint/hyper_log_log'

Expand Down
1 change: 1 addition & 0 deletions test/commands_on_lists_test.rb
@@ -1,3 +1,4 @@
# frozen_string_literal: true
require_relative 'helper'
require_relative 'lint/lists'

Expand Down
1 change: 1 addition & 0 deletions test/commands_on_sets_test.rb
@@ -1,3 +1,4 @@
# frozen_string_literal: true
require_relative 'helper'
require_relative 'lint/sets'

Expand Down
1 change: 1 addition & 0 deletions test/commands_on_sorted_sets_test.rb
@@ -1,3 +1,4 @@
# frozen_string_literal: true
require_relative 'helper'
require_relative 'lint/sorted_sets'

Expand Down
1 change: 1 addition & 0 deletions test/commands_on_strings_test.rb
@@ -1,3 +1,4 @@
# frozen_string_literal: true
require_relative 'helper'
require_relative 'lint/strings'

Expand Down
1 change: 1 addition & 0 deletions test/commands_on_value_types_test.rb
@@ -1,3 +1,4 @@
# frozen_string_literal: true
require_relative "helper"
require_relative "lint/value_types"

Expand Down
1 change: 1 addition & 0 deletions test/connection_handling_test.rb
@@ -1,3 +1,4 @@
# frozen_string_literal: true
require_relative "helper"

class TestConnectionHandling < Minitest::Test
Expand Down
1 change: 1 addition & 0 deletions test/connection_test.rb
@@ -1,3 +1,4 @@
# frozen_string_literal: true
require_relative "helper"

class TestConnection < Minitest::Test
Expand Down
1 change: 1 addition & 0 deletions test/distributed_blocking_commands_test.rb
@@ -1,3 +1,4 @@
# frozen_string_literal: true
require_relative 'helper'
require_relative 'lint/blocking_commands'

Expand Down
1 change: 1 addition & 0 deletions test/distributed_commands_on_hashes_test.rb
@@ -1,3 +1,4 @@
# frozen_string_literal: true
require_relative 'helper'
require_relative 'lint/hashes'

Expand Down
1 change: 1 addition & 0 deletions test/distributed_commands_on_hyper_log_log_test.rb
@@ -1,3 +1,4 @@
# frozen_string_literal: true
require_relative 'helper'
require_relative 'lint/hyper_log_log'

Expand Down
1 change: 1 addition & 0 deletions test/distributed_commands_on_lists_test.rb
@@ -1,3 +1,4 @@
# frozen_string_literal: true
require_relative 'helper'
require_relative 'lint/lists'

Expand Down
1 change: 1 addition & 0 deletions test/distributed_commands_on_sets_test.rb
@@ -1,3 +1,4 @@
# frozen_string_literal: true
require_relative 'helper'
require_relative 'lint/sets'

Expand Down
1 change: 1 addition & 0 deletions test/distributed_commands_on_sorted_sets_test.rb
@@ -1,3 +1,4 @@
# frozen_string_literal: true
require_relative 'helper'
require_relative 'lint/sorted_sets'

Expand Down
1 change: 1 addition & 0 deletions test/distributed_commands_on_strings_test.rb
@@ -1,3 +1,4 @@
# frozen_string_literal: true
require_relative "helper"
require_relative "lint/strings"

Expand Down
1 change: 1 addition & 0 deletions test/distributed_commands_on_value_types_test.rb
@@ -1,3 +1,4 @@
# frozen_string_literal: true
require_relative "helper"
require_relative "lint/value_types"

Expand Down
1 change: 1 addition & 0 deletions test/distributed_commands_requiring_clustering_test.rb
@@ -1,3 +1,4 @@
# frozen_string_literal: true
require_relative "helper"

class TestDistributedCommandsRequiringClustering < Minitest::Test
Expand Down
1 change: 1 addition & 0 deletions test/distributed_connection_handling_test.rb
@@ -1,3 +1,4 @@
# frozen_string_literal: true
require_relative "helper"

class TestDistributedConnectionHandling < Minitest::Test
Expand Down
1 change: 1 addition & 0 deletions test/distributed_internals_test.rb
@@ -1,3 +1,4 @@
# frozen_string_literal: true
require_relative "helper"

class TestDistributedInternals < Minitest::Test
Expand Down
1 change: 1 addition & 0 deletions test/distributed_key_tags_test.rb
@@ -1,3 +1,4 @@
# frozen_string_literal: true
require_relative "helper"

class TestDistributedKeyTags < Minitest::Test
Expand Down
1 change: 1 addition & 0 deletions test/distributed_persistence_control_commands_test.rb
@@ -1,3 +1,4 @@
# frozen_string_literal: true
require_relative "helper"

class TestDistributedPersistenceControlCommands < Minitest::Test
Expand Down
1 change: 1 addition & 0 deletions test/distributed_publish_subscribe_test.rb
@@ -1,3 +1,4 @@
# frozen_string_literal: true
require_relative "helper"

class TestDistributedPublishSubscribe < Minitest::Test
Expand Down
1 change: 1 addition & 0 deletions test/distributed_remote_server_control_commands_test.rb
@@ -1,3 +1,4 @@
# frozen_string_literal: true
require_relative "helper"

class TestDistributedRemoteServerControlCommands < Minitest::Test
Expand Down
1 change: 1 addition & 0 deletions test/distributed_scripting_test.rb
@@ -1,3 +1,4 @@
# frozen_string_literal: true
require_relative "helper"

class TestDistributedScripting < Minitest::Test
Expand Down
1 change: 1 addition & 0 deletions test/distributed_sorting_test.rb
@@ -1,3 +1,4 @@
# frozen_string_literal: true
require_relative "helper"

class TestDistributedSorting < Minitest::Test
Expand Down
1 change: 1 addition & 0 deletions test/distributed_test.rb
@@ -1,3 +1,4 @@
# frozen_string_literal: true
require_relative "helper"

class TestDistributed < Minitest::Test
Expand Down
1 change: 1 addition & 0 deletions test/distributed_transactions_test.rb
@@ -1,3 +1,4 @@
# frozen_string_literal: true
require_relative "helper"

class TestDistributedTransactions < Minitest::Test
Expand Down
1 change: 1 addition & 0 deletions test/encoding_test.rb
@@ -1,3 +1,4 @@
# frozen_string_literal: true
require_relative "helper"

class TestEncoding < Minitest::Test
Expand Down
1 change: 1 addition & 0 deletions test/error_replies_test.rb
@@ -1,3 +1,4 @@
# frozen_string_literal: true
require_relative "helper"

class TestErrorReplies < Minitest::Test
Expand Down
1 change: 1 addition & 0 deletions test/fork_safety_test.rb
@@ -1,3 +1,4 @@
# frozen_string_literal: true
require_relative "helper"

class TestForkSafety < Minitest::Test
Expand Down
1 change: 1 addition & 0 deletions test/helper_test.rb
@@ -1,3 +1,4 @@
# frozen_string_literal: true
require_relative "helper"

class TestHelper < Minitest::Test
Expand Down
1 change: 1 addition & 0 deletions test/internals_test.rb
@@ -1,3 +1,4 @@
# frozen_string_literal: true
require_relative "helper"

class TestInternals < Minitest::Test
Expand Down
1 change: 1 addition & 0 deletions test/lint/blocking_commands.rb
@@ -1,3 +1,4 @@
# frozen_string_literal: true
module Lint
module BlockingCommands
def setup
Expand Down
1 change: 1 addition & 0 deletions test/lint/hashes.rb
@@ -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
@@ -1,3 +1,4 @@
# frozen_string_literal: true
module Lint

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

module Lists
Expand Down
1 change: 1 addition & 0 deletions test/lint/sets.rb
@@ -1,3 +1,4 @@
# frozen_string_literal: true
module Lint

module Sets
Expand Down
1 change: 1 addition & 0 deletions test/lint/sorted_sets.rb
@@ -1,3 +1,4 @@
# frozen_string_literal: true
module Lint

module SortedSets
Expand Down
1 change: 1 addition & 0 deletions test/lint/strings.rb
@@ -1,3 +1,4 @@
# frozen_string_literal: true
module Lint

module Strings
Expand Down
1 change: 1 addition & 0 deletions test/lint/value_types.rb
@@ -1,3 +1,4 @@
# frozen_string_literal: true
module Lint

module ValueTypes
Expand Down