Skip to content

Commit 85ddffb

Browse files
committed
Add frozen_string_literal pragma comments.
1 parent fd3a5f3 commit 85ddffb

File tree

301 files changed

+600
-1
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

301 files changed

+600
-1
lines changed

Gemfile

+2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
# frozen_string_literal: true
2+
13
source 'https://rubygems.org'
24

35
gemspec

Rakefile

+2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
# frozen_string_literal: true
2+
13
require 'bundler'
24
require 'appraisal'
35

bin/console

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
#!/usr/bin/env ruby
1+
#! /usr/bin/env ruby
2+
# frozen_string_literal: true
23

34
require "bundler/setup"
45
require "thinking_sphinx"

lib/thinking-sphinx.rb

+2
Original file line numberDiff line numberDiff line change
@@ -1 +1,3 @@
1+
# frozen_string_literal: true
2+
13
require 'thinking_sphinx'

lib/thinking/sphinx.rb

+2
Original file line numberDiff line numberDiff line change
@@ -1 +1,3 @@
1+
# frozen_string_literal: true
2+
13
require 'thinking_sphinx'

lib/thinking_sphinx.rb

+2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
# frozen_string_literal: true
2+
13
if RUBY_PLATFORM == 'java'
24
require 'java'
35
require 'jdbc/mysql'

lib/thinking_sphinx/active_record.rb

+2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
# frozen_string_literal: true
2+
13
require 'active_record'
24
require 'joiner'
35

lib/thinking_sphinx/active_record/association.rb

+2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
# frozen_string_literal: true
2+
13
class ThinkingSphinx::ActiveRecord::Association
24
def initialize(column)
35
@column = column

lib/thinking_sphinx/active_record/association_proxy.rb

+2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
# frozen_string_literal: true
2+
13
module ThinkingSphinx::ActiveRecord::AssociationProxy
24
extend ActiveSupport::Concern
35

lib/thinking_sphinx/active_record/association_proxy/attribute_finder.rb

+2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
# frozen_string_literal: true
2+
13
class ThinkingSphinx::ActiveRecord::AssociationProxy::AttributeFinder
24
def initialize(association)
35
@association = association

lib/thinking_sphinx/active_record/association_proxy/attribute_matcher.rb

+2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
# frozen_string_literal: true
2+
13
class ThinkingSphinx::ActiveRecord::AssociationProxy::AttributeMatcher
24
def initialize(attribute, foreign_key)
35
@attribute, @foreign_key = attribute, foreign_key.to_s

lib/thinking_sphinx/active_record/attribute.rb

+2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
# frozen_string_literal: true
2+
13
class ThinkingSphinx::ActiveRecord::Attribute <
24
ThinkingSphinx::ActiveRecord::Property
35

lib/thinking_sphinx/active_record/attribute/sphinx_presenter.rb

+2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
# frozen_string_literal: true
2+
13
class ThinkingSphinx::ActiveRecord::Attribute::SphinxPresenter
24
SPHINX_TYPES = {
35
:integer => :uint,

lib/thinking_sphinx/active_record/attribute/type.rb

+2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
# frozen_string_literal: true
2+
13
class ThinkingSphinx::ActiveRecord::Attribute::Type
24
UPDATEABLE_TYPES = [:integer, :timestamp, :boolean, :float]
35

lib/thinking_sphinx/active_record/attribute/values.rb

+2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
# frozen_string_literal: true
2+
13
class ThinkingSphinx::ActiveRecord::Attribute::Values
24
def initialize(attribute)
35
@attribute = attribute

lib/thinking_sphinx/active_record/base.rb

+2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
# frozen_string_literal: true
2+
13
module ThinkingSphinx::ActiveRecord::Base
24
extend ActiveSupport::Concern
35

lib/thinking_sphinx/active_record/callbacks/delete_callbacks.rb

+2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
# frozen_string_literal: true
2+
13
class ThinkingSphinx::ActiveRecord::Callbacks::DeleteCallbacks <
24
ThinkingSphinx::Callbacks
35

lib/thinking_sphinx/active_record/callbacks/delta_callbacks.rb

+2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
# frozen_string_literal: true
2+
13
class ThinkingSphinx::ActiveRecord::Callbacks::DeltaCallbacks <
24
ThinkingSphinx::Callbacks
35

lib/thinking_sphinx/active_record/callbacks/update_callbacks.rb

+2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
# frozen_string_literal: true
2+
13
class ThinkingSphinx::ActiveRecord::Callbacks::UpdateCallbacks <
24
ThinkingSphinx::Callbacks
35

lib/thinking_sphinx/active_record/column.rb

+2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
# frozen_string_literal: true
2+
13
class ThinkingSphinx::ActiveRecord::Column
24
def initialize(*stack)
35
@stack = stack

lib/thinking_sphinx/active_record/column_sql_presenter.rb

+2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
# frozen_string_literal: true
2+
13
class ThinkingSphinx::ActiveRecord::ColumnSQLPresenter
24
def initialize(model, column, adapter, associations)
35
@model, @column, @adapter, @associations = model, column, adapter, associations

lib/thinking_sphinx/active_record/database_adapters.rb

+2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
# frozen_string_literal: true
2+
13
module ThinkingSphinx::ActiveRecord::DatabaseAdapters
24
class << self
35
attr_accessor :default

lib/thinking_sphinx/active_record/database_adapters/abstract_adapter.rb

+2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
# frozen_string_literal: true
2+
13
class ThinkingSphinx::ActiveRecord::DatabaseAdapters::AbstractAdapter
24
def initialize(model)
35
@model = model

lib/thinking_sphinx/active_record/database_adapters/mysql_adapter.rb

+2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
# frozen_string_literal: true
2+
13
class ThinkingSphinx::ActiveRecord::DatabaseAdapters::MySQLAdapter <
24
ThinkingSphinx::ActiveRecord::DatabaseAdapters::AbstractAdapter
35

lib/thinking_sphinx/active_record/database_adapters/postgresql_adapter.rb

+2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
# frozen_string_literal: true
2+
13
class ThinkingSphinx::ActiveRecord::DatabaseAdapters::PostgreSQLAdapter <
24
ThinkingSphinx::ActiveRecord::DatabaseAdapters::AbstractAdapter
35

lib/thinking_sphinx/active_record/depolymorph/association_reflection.rb

+2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
# frozen_string_literal: true
2+
13
# This custom association approach is only available in Rails 4.1-5.1. This
24
# behaviour is superseded by OverriddenReflection for Rails 5.2, and was
35
# preceded by ScopedReflection for Rails 4.0.

lib/thinking_sphinx/active_record/depolymorph/base_reflection.rb

+2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
# frozen_string_literal: true
2+
13
class ThinkingSphinx::ActiveRecord::Depolymorph::BaseReflection
24
def initialize(reflection, name, class_name)
35
@reflection = reflection

lib/thinking_sphinx/active_record/depolymorph/conditions_reflection.rb

+2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
# frozen_string_literal: true
2+
13
# The conditions approach is only available in Rails 3. This behaviour is
24
# superseded by ScopedReflection for Rails 4.0.
35
class ThinkingSphinx::ActiveRecord::Depolymorph::ConditionsReflection <

lib/thinking_sphinx/active_record/depolymorph/overridden_reflection.rb

+2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
# frozen_string_literal: true
2+
13
# This overriding approach is only available in Rails 5.2+. This behaviour
24
# was preceded by AssociationReflection for Rails 4.1-5.1.
35
class ThinkingSphinx::ActiveRecord::Depolymorph::OverriddenReflection <

lib/thinking_sphinx/active_record/depolymorph/scoped_reflection.rb

+2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
# frozen_string_literal: true
2+
13
# This scoped approach is only available in Rails 4.0. This behaviour is
24
# superseded by AssociationReflection for Rails 4.1, and was preceded by
35
# ConditionsReflection for Rails 3.2.

lib/thinking_sphinx/active_record/field.rb

+2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
# frozen_string_literal: true
2+
13
class ThinkingSphinx::ActiveRecord::Field <
24
ThinkingSphinx::ActiveRecord::Property
35
include ThinkingSphinx::Core::Field

lib/thinking_sphinx/active_record/filter_reflection.rb

+2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
# frozen_string_literal: true
2+
13
class ThinkingSphinx::ActiveRecord::FilterReflection
24
ReflectionGenerator = case ActiveRecord::VERSION::STRING.to_f
35
when 5.2..7.0

lib/thinking_sphinx/active_record/index.rb

+2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
# frozen_string_literal: true
2+
13
class ThinkingSphinx::ActiveRecord::Index < Riddle::Configuration::Index
24
include ThinkingSphinx::Core::Index
35

lib/thinking_sphinx/active_record/interpreter.rb

+2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
# frozen_string_literal: true
2+
13
class ThinkingSphinx::ActiveRecord::Interpreter <
24
::ThinkingSphinx::Core::Interpreter
35

lib/thinking_sphinx/active_record/join_association.rb

+2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
# frozen_string_literal: true
2+
13
class ThinkingSphinx::ActiveRecord::JoinAssociation <
24
::ActiveRecord::Associations::JoinDependency::JoinAssociation
35

lib/thinking_sphinx/active_record/log_subscriber.rb

+2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
# frozen_string_literal: true
2+
13
class ThinkingSphinx::ActiveRecord::LogSubscriber < ActiveSupport::LogSubscriber
24
def guard(event)
35
identifier = color 'Sphinx', GREEN, true

lib/thinking_sphinx/active_record/polymorpher.rb

+2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
# frozen_string_literal: true
2+
13
class ThinkingSphinx::ActiveRecord::Polymorpher
24
def initialize(source, column, class_names)
35
@source, @column, @class_names = source, column, class_names

lib/thinking_sphinx/active_record/property.rb

+2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
# frozen_string_literal: true
2+
13
class ThinkingSphinx::ActiveRecord::Property
24
include ThinkingSphinx::Core::Property
35

lib/thinking_sphinx/active_record/property_query.rb

+2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
# frozen_string_literal: true
2+
13
class ThinkingSphinx::ActiveRecord::PropertyQuery
24
def initialize(property, source, type = nil)
35
@property, @source, @type = property, source, type

lib/thinking_sphinx/active_record/property_sql_presenter.rb

+2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
# frozen_string_literal: true
2+
13
class ThinkingSphinx::ActiveRecord::PropertySQLPresenter
24
attr_reader :property, :adapter, :associations
35

lib/thinking_sphinx/active_record/simple_many_query.rb

+2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
# frozen_string_literal: true
2+
13
class ThinkingSphinx::ActiveRecord::SimpleManyQuery <
24
ThinkingSphinx::ActiveRecord::PropertyQuery
35

lib/thinking_sphinx/active_record/source_joins.rb

+2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
# frozen_string_literal: true
2+
13
class ThinkingSphinx::ActiveRecord::SourceJoins
24
def self.call(model, source)
35
new(model, source).call

lib/thinking_sphinx/active_record/sql_builder.rb

+2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
# frozen_string_literal: true
2+
13
module ThinkingSphinx
24
module ActiveRecord
35
class SQLBuilder

lib/thinking_sphinx/active_record/sql_builder/clause_builder.rb

+2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
# frozen_string_literal: true
2+
13
module ThinkingSphinx
24
module ActiveRecord
35
class SQLBuilder::ClauseBuilder

lib/thinking_sphinx/active_record/sql_builder/query.rb

+2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
# frozen_string_literal: true
2+
13
module ThinkingSphinx
24
module ActiveRecord
35
class SQLBuilder::Query

lib/thinking_sphinx/active_record/sql_builder/statement.rb

+2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
# frozen_string_literal: true
2+
13
require 'thinking_sphinx/active_record/sql_builder/clause_builder'
24

35
module ThinkingSphinx

lib/thinking_sphinx/active_record/sql_source.rb

+2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
# frozen_string_literal: true
2+
13
module ThinkingSphinx
24
module ActiveRecord
35
class SQLSource < Riddle::Configuration::SQLSource

lib/thinking_sphinx/active_record/sql_source/template.rb

+2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
# frozen_string_literal: true
2+
13
class ThinkingSphinx::ActiveRecord::SQLSource::Template
24
attr_reader :source
35

lib/thinking_sphinx/attribute_types.rb

+2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
# frozen_string_literal: true
2+
13
class ThinkingSphinx::AttributeTypes
24
def self.call
35
@call ||= new.call

lib/thinking_sphinx/batched_search.rb

+2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
# frozen_string_literal: true
2+
13
class ThinkingSphinx::BatchedSearch
24
attr_accessor :searches
35

lib/thinking_sphinx/callbacks.rb

+2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
# frozen_string_literal: true
2+
13
class ThinkingSphinx::Callbacks
24
attr_reader :instance
35

lib/thinking_sphinx/capistrano.rb

+2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
# frozen_string_literal: true
2+
13
if defined?(Capistrano::VERSION)
24
if Gem::Version.new(Capistrano::VERSION).release >= Gem::Version.new('3.0.0')
35
recipe_version = 3

lib/thinking_sphinx/capistrano/v2.rb

+2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
# frozen_string_literal: true
2+
13
Capistrano::Configuration.instance(:must_exist).load do
24
_cset(:thinking_sphinx_roles) { :db }
35
_cset(:thinking_sphinx_options) { {:roles => fetch(:thinking_sphinx_roles)} }

lib/thinking_sphinx/capistrano/v3.rb

+2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
# frozen_string_literal: true
2+
13
namespace :load do
24
task :defaults do
35
set :thinking_sphinx_roles, :db

lib/thinking_sphinx/commands/base.rb

+2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
# frozen_string_literal: true
2+
13
class ThinkingSphinx::Commands::Base
24
include ThinkingSphinx::WithOutput
35

lib/thinking_sphinx/commands/configure.rb

+2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
# frozen_string_literal: true
2+
13
class ThinkingSphinx::Commands::Configure < ThinkingSphinx::Commands::Base
24
def call
35
log "Generating configuration to #{configuration.configuration_file}"

lib/thinking_sphinx/commands/index.rb

+2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
# frozen_string_literal: true
2+
13
class ThinkingSphinx::Commands::Index < ThinkingSphinx::Commands::Base
24
def call
35
controller.index :verbose => options[:verbose]

lib/thinking_sphinx/commands/start_attached.rb

+2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
# frozen_string_literal: true
2+
13
class ThinkingSphinx::Commands::StartAttached < ThinkingSphinx::Commands::Base
24
def call
35
FileUtils.mkdir_p configuration.indices_location

lib/thinking_sphinx/commands/start_detached.rb

+2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
# frozen_string_literal: true
2+
13
class ThinkingSphinx::Commands::StartDetached < ThinkingSphinx::Commands::Base
24
def call
35
FileUtils.mkdir_p configuration.indices_location

lib/thinking_sphinx/commands/stop.rb

+2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
# frozen_string_literal: true
2+
13
class ThinkingSphinx::Commands::Stop < ThinkingSphinx::Commands::Base
24
def call
35
unless controller.running?

lib/thinking_sphinx/configuration.rb

+2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
# frozen_string_literal: true
2+
13
require 'pathname'
24

35
class ThinkingSphinx::Configuration < Riddle::Configuration

lib/thinking_sphinx/configuration/consistent_ids.rb

+2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
# frozen_string_literal: true
2+
13
class ThinkingSphinx::Configuration::ConsistentIds
24
def initialize(indices)
35
@indices = indices

lib/thinking_sphinx/configuration/defaults.rb

+2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
# frozen_string_literal: true
2+
13
module ThinkingSphinx::Configuration::Defaults
24
ADDRESS = '127.0.0.1'
35
PORT = 9306

lib/thinking_sphinx/configuration/distributed_indices.rb

+2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
# frozen_string_literal: true
2+
13
class ThinkingSphinx::Configuration::DistributedIndices
24
def initialize(indices)
35
@indices = indices

lib/thinking_sphinx/configuration/duplicate_names.rb

+2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
# frozen_string_literal: true
2+
13
class ThinkingSphinx::Configuration::DuplicateNames
24
def initialize(indices)
35
@indices = indices

lib/thinking_sphinx/configuration/minimum_fields.rb

+2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
# frozen_string_literal: true
2+
13
class ThinkingSphinx::Configuration::MinimumFields
24
def initialize(indices)
35
@indices = indices

lib/thinking_sphinx/connection.rb

+2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
# frozen_string_literal: true
2+
13
module ThinkingSphinx::Connection
24
MAXIMUM_RETRIES = 3
35

0 commit comments

Comments
 (0)