Skip to content

Commit

Permalink
Add frozen_string_literals pragma
Browse files Browse the repository at this point in the history
  • Loading branch information
jcoyne committed Jan 20, 2016
1 parent c269dff commit 60770ec
Show file tree
Hide file tree
Showing 221 changed files with 221 additions and 0 deletions.
1 change: 1 addition & 0 deletions app/controllers/bookmarks_controller.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# frozen_string_literal: true
class BookmarksController < CatalogController

include Blacklight::Bookmarks
Expand Down
1 change: 1 addition & 0 deletions app/controllers/catalog_controller.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# frozen_string_literal: true
class CatalogController < ApplicationController

include Blacklight::Catalog
Expand Down
1 change: 1 addition & 0 deletions app/controllers/concerns/blacklight/base.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# frozen_string_literal: true
module Blacklight::Base
extend ActiveSupport::Concern

Expand Down
1 change: 1 addition & 0 deletions app/controllers/concerns/blacklight/bookmarks.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# frozen_string_literal: true
# note that while this is mostly restful routing, the #update and #destroy actions
# take the Solr document ID as the :id, NOT the id of the actual Bookmark action.
module Blacklight::Bookmarks
Expand Down
1 change: 1 addition & 0 deletions app/controllers/concerns/blacklight/catalog.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# frozen_string_literal: true
module Blacklight::Catalog
extend ActiveSupport::Concern

Expand Down
1 change: 1 addition & 0 deletions app/controllers/concerns/blacklight/controller.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# frozen_string_literal: true
# Filters added to this controller apply to all controllers in the hosting application
# as this module is mixed-in to the application controller in the hosting app on installation.
module Blacklight::Controller
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# frozen_string_literal: true
module Blacklight
module DefaultComponentConfiguration
extend ActiveSupport::Concern
Expand Down
1 change: 1 addition & 0 deletions app/controllers/concerns/blacklight/facet.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# frozen_string_literal: true
module Blacklight
# These are methods that are used at both the view helper and controller layers
# They are only dependent on `blacklight_config` and `@response`
Expand Down
1 change: 1 addition & 0 deletions app/controllers/concerns/blacklight/request_builders.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# frozen_string_literal: true
module Blacklight
module RequestBuilders
extend ActiveSupport::Concern
Expand Down
1 change: 1 addition & 0 deletions app/controllers/concerns/blacklight/search_context.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# frozen_string_literal: true
module Blacklight::SearchContext
extend ActiveSupport::Concern

Expand Down
1 change: 1 addition & 0 deletions app/controllers/concerns/blacklight/search_fields.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# frozen_string_literal: true
##
# Module to deal with accessing (and setting some defaults) in an array of
# hashes that describe Blacklight search fields. Requires the base class this
Expand Down
1 change: 1 addition & 0 deletions app/controllers/concerns/blacklight/search_helper.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# frozen_string_literal: true
# SearchHelper is a controller layer mixin. It is in the controller scope: request params, session etc.
#
# NOTE: Be careful when creating variables here as they may be overriding something that already exists.
Expand Down
1 change: 1 addition & 0 deletions app/controllers/concerns/blacklight/search_history.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# frozen_string_literal: true
module Blacklight
module SearchHistory
extend ActiveSupport::Concern
Expand Down
1 change: 1 addition & 0 deletions app/controllers/concerns/blacklight/suggest.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# frozen_string_literal: true
module Blacklight
module Suggest
extend ActiveSupport::Concern
Expand Down
1 change: 1 addition & 0 deletions app/controllers/concerns/blacklight/suggest_search.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# frozen_string_literal: true
module Blacklight
class SuggestSearch
attr_reader :request_params, :repository
Expand Down
1 change: 1 addition & 0 deletions app/controllers/concerns/blacklight/token_based_user.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# frozen_string_literal: true
module Blacklight::TokenBasedUser
extend ActiveSupport::Concern

Expand Down
1 change: 1 addition & 0 deletions app/controllers/saved_searches_controller.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# frozen_string_literal: true
class SavedSearchesController < ApplicationController
include Blacklight::Configurable

Expand Down
1 change: 1 addition & 0 deletions app/controllers/search_history_controller.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# frozen_string_literal: true
class SearchHistoryController < ApplicationController
include Blacklight::SearchHistory
end
1 change: 1 addition & 0 deletions app/controllers/suggest_controller.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# frozen_string_literal: true
class SuggestController < ApplicationController
include Blacklight::Suggest
end
1 change: 1 addition & 0 deletions app/helpers/blacklight/blacklight_helper_behavior.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# frozen_string_literal: true
# Methods added to this helper will be available to all templates in the hosting application
module Blacklight::BlacklightHelperBehavior
include BlacklightUrlHelper
Expand Down
1 change: 1 addition & 0 deletions app/helpers/blacklight/catalog_helper_behavior.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# frozen_string_literal: true
module Blacklight::CatalogHelperBehavior

def rss_feed_link_tag
Expand Down
1 change: 1 addition & 0 deletions app/helpers/blacklight/component_helper_behavior.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# frozen_string_literal: true
module Blacklight
module ComponentHelperBehavior

Expand Down
1 change: 1 addition & 0 deletions app/helpers/blacklight/configuration_helper_behavior.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# frozen_string_literal: true
module Blacklight::ConfigurationHelperBehavior

##
Expand Down
1 change: 1 addition & 0 deletions app/helpers/blacklight/deprecated_url_helper_behavior.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# frozen_string_literal: true
module Blacklight
module DeprecatedUrlHelperBehavior
extend Deprecation
Expand Down
1 change: 1 addition & 0 deletions app/helpers/blacklight/facets_helper_behavior.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# frozen_string_literal: true
module Blacklight::FacetsHelperBehavior
include Blacklight::Facet

Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# frozen_string_literal: true
# Rails Helper methods to take a hash and turn it to form <input type="hidden">
# fields, works with hash nested with other hashes and arrays, standard rails
# serialization style. Oddly while Hash#to_query will do this for a URL
Expand Down
1 change: 1 addition & 0 deletions app/helpers/blacklight/layout_helper_behavior.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# frozen_string_literal: true
# Methods added to this helper will be available to all templates in the hosting
# application
module Blacklight
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# frozen_string_literal: true
# All methods in here are 'api' that may be over-ridden by plugins and local
# code, so method signatures and semantics should not be changed casually.
# implementations can be of course.
Expand Down
1 change: 1 addition & 0 deletions app/helpers/blacklight/render_partials_helper.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# frozen_string_literal: true
module Blacklight::RenderPartialsHelper
##
# Render the document index view
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# frozen_string_literal: true
# All methods in here are 'api' that may be over-ridden by plugins and local
# code, so method signatures and semantics should not be changed casually.
# implementations can be of course.
Expand Down
1 change: 1 addition & 0 deletions app/helpers/blacklight/suggest_helper_behavior.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# frozen_string_literal: true
module Blacklight
module SuggestHelperBehavior
##
Expand Down
1 change: 1 addition & 0 deletions app/helpers/blacklight/url_helper_behavior.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# frozen_string_literal: true
##
# URL helper methods
module Blacklight::UrlHelperBehavior
Expand Down
1 change: 1 addition & 0 deletions app/helpers/blacklight_configuration_helper.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# frozen_string_literal: true
module BlacklightConfigurationHelper
include Blacklight::ConfigurationHelperBehavior
end
1 change: 1 addition & 0 deletions app/helpers/blacklight_helper.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# frozen_string_literal: true
module BlacklightHelper
include Blacklight::BlacklightHelperBehavior
end
1 change: 1 addition & 0 deletions app/helpers/blacklight_url_helper.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# frozen_string_literal: true
module BlacklightUrlHelper
include Blacklight::UrlHelperBehavior
end
1 change: 1 addition & 0 deletions app/helpers/catalog_helper.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# frozen_string_literal: true
module CatalogHelper
include Blacklight::CatalogHelperBehavior
end
1 change: 1 addition & 0 deletions app/helpers/component_helper.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# frozen_string_literal: true
module ComponentHelper
include Blacklight::ComponentHelperBehavior
end
1 change: 1 addition & 0 deletions app/helpers/facets_helper.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# frozen_string_literal: true
module FacetsHelper
include Blacklight::FacetsHelperBehavior
end
1 change: 1 addition & 0 deletions app/helpers/hash_as_hidden_fields_helper.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# frozen_string_literal: true
module HashAsHiddenFieldsHelper
include Blacklight::HashAsHiddenFieldsHelperBehavior
end
1 change: 1 addition & 0 deletions app/helpers/layout_helper.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# frozen_string_literal: true
module LayoutHelper
include Blacklight::LayoutHelperBehavior
end
1 change: 1 addition & 0 deletions app/helpers/render_constraints_helper.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# frozen_string_literal: true
module RenderConstraintsHelper
include Blacklight::RenderConstraintsHelperBehavior
end
1 change: 1 addition & 0 deletions app/helpers/search_history_constraints_helper.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# frozen_string_literal: true
module SearchHistoryConstraintsHelper
include Blacklight::SearchHistoryConstraintsHelperBehavior
end
1 change: 1 addition & 0 deletions app/helpers/suggest_helper.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# frozen_string_literal: true
module SuggestHelper
include Blacklight::SuggestHelperBehavior
end
1 change: 1 addition & 0 deletions app/models/blacklight/facet_paginator.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# frozen_string_literal: true
module Blacklight
# Pagination for facet values -- works by setting the limit to max
# displayable. You have to ask Solr for limit+1, to get enough
Expand Down
1 change: 1 addition & 0 deletions app/models/blacklight/solr/facet_paginator.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# frozen_string_literal: true
module Blacklight::Solr
# Pagination for facet values -- works by setting the limit to max
# displayable. You have to ask Solr for limit+1, to get enough
Expand Down
1 change: 1 addition & 0 deletions app/models/bookmark.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# frozen_string_literal: true
class Bookmark < ActiveRecord::Base

belongs_to :user, polymorphic: true
Expand Down
1 change: 1 addition & 0 deletions app/models/concerns/blacklight/configurable.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# frozen_string_literal: true
module Blacklight::Configurable
extend ActiveSupport::Concern

Expand Down
1 change: 1 addition & 0 deletions app/models/concerns/blacklight/document.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# frozen_string_literal: true
##
##
# = Introduction
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# frozen_string_literal: true
require 'active_model/conversion'

module Blacklight::Document
Expand Down
1 change: 1 addition & 0 deletions app/models/concerns/blacklight/document/cache_key.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# frozen_string_literal: true
# This module provides the cache key which can be used by rails
# caching to determine when to expire a particular object's cache
# See http://apidock.com/rails/ActiveRecord/Integration/cache_key
Expand Down
1 change: 1 addition & 0 deletions app/models/concerns/blacklight/document/dublin_core.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# frozen_string_literal: true
require 'builder'

# This module provide Dublin Core export based on the document's semantic values
Expand Down
1 change: 1 addition & 0 deletions app/models/concerns/blacklight/document/email.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# frozen_string_literal: true
# This module provides the body of an email export based on the document's semantic values
module Blacklight::Document::Email

Expand Down
1 change: 1 addition & 0 deletions app/models/concerns/blacklight/document/export.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# frozen_string_literal: true
# == Transformation conventions
# The main use case for extensions is for transforming a Document to another
# format. Either to another type of Ruby object, or to an exportable string in
Expand Down
1 change: 1 addition & 0 deletions app/models/concerns/blacklight/document/extensions.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# frozen_string_literal: true
# = Document Extensions
# An Blacklight::Document extension is simply a ruby module which is mixed
# in to individual Document instances. The intended use case is for documents
Expand Down
1 change: 1 addition & 0 deletions app/models/concerns/blacklight/document/schema_org.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# frozen_string_literal: true
module Blacklight::Document::SchemaOrg

def itemtype
Expand Down
1 change: 1 addition & 0 deletions app/models/concerns/blacklight/document/semantic_fields.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# frozen_string_literal: true
module Blacklight::Document
module SemanticFields
extend ActiveSupport::Concern
Expand Down
1 change: 1 addition & 0 deletions app/models/concerns/blacklight/document/sms.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# frozen_string_literal: true
# This module provides the body of an email export based on the document's semantic values
module Blacklight::Document::Sms

Expand Down
1 change: 1 addition & 0 deletions app/models/concerns/blacklight/solr/document.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# frozen_string_literal: true
require 'rsolr'
##
##
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# frozen_string_literal: true
module Blacklight::Solr::Document::MoreLikeThis
def more_like_this
response.more_like(self).map { |doc| self.class.new(doc, response) }
Expand Down
1 change: 1 addition & 0 deletions app/models/concerns/blacklight/suggest/response.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# frozen_string_literal: true
module Blacklight
module Suggest
class Response
Expand Down
1 change: 1 addition & 0 deletions app/models/concerns/blacklight/user.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# frozen_string_literal: true
module Blacklight::User
# This gives us an is_blacklight_user method that can be included in
# the containing applications models.
Expand Down
1 change: 1 addition & 0 deletions app/models/record_mailer.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# frozen_string_literal: true
# Only works for documents with a #to_marc right now.
class RecordMailer < ActionMailer::Base
def email_record(documents, details, url_gen_params)
Expand Down
1 change: 1 addition & 0 deletions app/models/search.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# frozen_string_literal: true
class Search < ActiveRecord::Base

belongs_to_arguments = { optional: true } if Rails.version >= '5.0.0'
Expand Down
1 change: 1 addition & 0 deletions app/models/solr_document.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# frozen_string_literal: true
class SolrDocument

include Blacklight::Solr::Document
Expand Down
1 change: 1 addition & 0 deletions app/presenters/blacklight/document_presenter.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# frozen_string_literal: true
module Blacklight
class DocumentPresenter
include ActionView::Helpers::OutputSafetyHelper
Expand Down
1 change: 1 addition & 0 deletions app/presenters/blacklight/json_presenter.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# frozen_string_literal: true
module Blacklight
class JsonPresenter
include Blacklight::Facet
Expand Down
1 change: 1 addition & 0 deletions config/routes.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# frozen_string_literal: true
Blacklight::Engine.routes.draw do
get "search_history", :to => "search_history#index", :as => "search_history"
delete "search_history/clear", :to => "search_history#clear", :as => "clear_search_history"
Expand Down
1 change: 1 addition & 0 deletions db/migrate/20140202020201_create_searches.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# frozen_string_literal: true
class CreateSearches < ActiveRecord::Migration
def self.up
create_table :searches do |t|
Expand Down
1 change: 1 addition & 0 deletions db/migrate/20140202020202_create_bookmarks.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# frozen_string_literal: true
class CreateBookmarks < ActiveRecord::Migration
def self.up
create_table :bookmarks do |t|
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# frozen_string_literal: true
class AddPolymorphicTypeToBookmarks < ActiveRecord::Migration
def change
add_column(:bookmarks, :document_type, :string)
Expand Down
1 change: 1 addition & 0 deletions lib/blacklight.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# frozen_string_literal: true
require 'kaminari'
require 'deprecation'
require 'blacklight/utils'
Expand Down
1 change: 1 addition & 0 deletions lib/blacklight/abstract_repository.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# frozen_string_literal: true
module Blacklight
class AbstractRepository
attr_accessor :blacklight_config
Expand Down
1 change: 1 addition & 0 deletions lib/blacklight/configuration.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# frozen_string_literal: true
module Blacklight
##
# Blacklight::Configuration holds the configuration for a Blacklight::Controller, including
Expand Down
1 change: 1 addition & 0 deletions lib/blacklight/configuration/context.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# frozen_string_literal: true
module Blacklight
class Configuration
class Context
Expand Down
1 change: 1 addition & 0 deletions lib/blacklight/configuration/facet_field.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# frozen_string_literal: true
module Blacklight
class Configuration::FacetField < Blacklight::Configuration::Field
def normalize! blacklight_config = nil
Expand Down
1 change: 1 addition & 0 deletions lib/blacklight/configuration/field.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# frozen_string_literal: true
module Blacklight
class Configuration::Field < OpenStructWithHashAccess
def normalize! blacklight_config = nil
Expand Down
1 change: 1 addition & 0 deletions lib/blacklight/configuration/fields.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# frozen_string_literal: true
module Blacklight
class Configuration
# This mixin provides Blacklight::Configuration with generic
Expand Down
1 change: 1 addition & 0 deletions lib/blacklight/configuration/search_field.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# frozen_string_literal: true
module Blacklight
class Configuration::SearchField < Blacklight::Configuration::Field
def normalize! blacklight_config = nil
Expand Down
1 change: 1 addition & 0 deletions lib/blacklight/configuration/sort_field.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# frozen_string_literal: true
module Blacklight
class Configuration::SortField < Blacklight::Configuration::Field
def normalize! blacklight_config = nil
Expand Down
1 change: 1 addition & 0 deletions lib/blacklight/configuration/tool_config.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# frozen_string_literal: true
module Blacklight
class Configuration::ToolConfig < OpenStructWithHashAccess
end
Expand Down

0 comments on commit 60770ec

Please sign in to comment.