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

LIBSEARCH-112 Remove Rails as a dependency for Spectrum #189

Merged
merged 13 commits into from
Oct 3, 2024
Prev Previous commit
Next Next commit
Remove blacklight.
bertrama committed Sep 3, 2024
commit 858c8d7e7cb7235eab87eb3eccc9d9916c860b69
5 changes: 0 additions & 5 deletions Gemfile
Original file line number Diff line number Diff line change
@@ -43,11 +43,6 @@ source "https://rubygems.org" do

gem "rails", "~> 4.2.0"

# ### BLACKLIGHT (begin) ###
gem "blacklight", "~>5.3.0"
gem "blacklight-marc"
# ### BLACKLIGHT (end) ###

gem "json"

gem "httpclient"
25 changes: 0 additions & 25 deletions Gemfile.lock
Original file line number Diff line number Diff line change
@@ -111,25 +111,9 @@ GEM
arrayfields (4.9.2)
ast (2.4.2)
attr_required (1.0.1)
autoprefixer-rails (10.3.3.0)
execjs (~> 2)
bindata (2.5.0)
binding_of_caller (1.0.0)
debug_inspector (>= 0.0.1)
blacklight (5.3.0)
bootstrap-sass (~> 3.0)
deprecation
kaminari (~> 0.13)
nokogiri (~> 1.6)
rails (>= 3.2.6, < 5)
rsolr (~> 1.0.6)
blacklight-marc (5.0.0)
blacklight (~> 5.0)
marc (>= 0.4.3, < 1.1)
rails
bootstrap-sass (3.4.1)
autoprefixer-rails (>= 5.2.1)
sassc (>= 2.0.0)
builder (3.2.4)
byebug (11.1.3)
cancan (1.6.10)
@@ -153,8 +137,6 @@ GEM
crass (1.0.6)
debug_inspector (1.1.0)
deep_merge (1.2.1)
deprecation (1.1.0)
activesupport
diff-lcs (1.4.4)
docile (1.4.0)
dotenv (2.7.6)
@@ -225,9 +207,6 @@ GEM
json-schema (2.8.1)
addressable (>= 2.4)
jwt (2.3.0)
kaminari (0.17.0)
actionpack (>= 3.0.0)
activesupport (>= 3.0.0)
kwalify (0.7.2)
launchy (2.5.0)
addressable (~> 2.7)
@@ -433,8 +412,6 @@ GEM
ruby2_keywords (0.0.5)
ruby_parser (3.18.0)
sexp_processor (~> 4.16)
sassc (2.4.0)
ffi (~> 1.9)
scrub_rb (1.0.1)
sequel (5.50.0)
sexp_processor (4.16.0)
@@ -499,8 +476,6 @@ PLATFORMS
DEPENDENCIES
alma_rest_client!
binding_of_caller!
blacklight (~> 5.3.0)!
blacklight-marc!
cancan!
dotenv-rails!
down!
4 changes: 0 additions & 4 deletions app/controllers/application_controller.rb
Original file line number Diff line number Diff line change
@@ -6,10 +6,6 @@ class ApplicationController < ActionController::Base
helper_method :set_browser_option, :get_browser_option

# Adds a few additional behaviors into the application controller
include Blacklight::Controller
include Blacklight::Catalog
include Blacklight::Configurable

include BrowseSupport

# Please be sure to impelement current_user and user_session. Blacklight depends on
6 changes: 0 additions & 6 deletions app/controllers/catalog_controller.rb
Original file line number Diff line number Diff line change
@@ -3,7 +3,6 @@
# (plus AcademicCommons - which uses Blacklight against a diff. Solr)
# (and dcv - which uses Blacklight against a yet another Solr)
# This was originally based on the Blacklight CatalogController.
require 'blacklight/catalog'

class CatalogController < ApplicationController
layout 'quicksearch'
@@ -14,11 +13,6 @@ class CatalogController < ApplicationController
prepend_before_filter :preprocess_search_params
before_filter :add_custom_solr_search_params_logic

# Bring in endnote export, etc.
include Blacklight::Marc::Catalog

include Blacklight::Catalog
include Blacklight::Configurable
# include BlacklightUnapi::ControllerExtension

# load last, to override any BlackLight methods included above
3 changes: 0 additions & 3 deletions app/controllers/spectrum_controller.rb
Original file line number Diff line number Diff line change
@@ -12,9 +12,6 @@
# - does the same thing, but for AJAX calls, returning JSON
#
class SpectrumController < ApplicationController
include Blacklight::Controller
include Blacklight::Catalog
include Blacklight::Configurable
layout 'quicksearch'

attr_reader :active_source
1 change: 0 additions & 1 deletion app/helpers/local_solr_helper_extension.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
module LocalSolrHelperExtension
extend ActiveSupport::Concern
include Blacklight::SolrHelper
#include BlacklightRangeLimit::SegmentCalculation

def is_advanced_search?(req_params = params)
51 changes: 0 additions & 51 deletions app/models/solr_document.rb

This file was deleted.

233 changes: 0 additions & 233 deletions app/models/spectrum/queries/solr.rb

This file was deleted.

5 changes: 0 additions & 5 deletions config/application.rb
Original file line number Diff line number Diff line change
@@ -152,10 +152,5 @@ class Application < Rails::Application
# e.g., :original_url, :remote_ip, etc.)
config.log_tags = [:remote_ip]
config.eager_load = true
config.before_eager_load do
Blacklight::Engine.class_eval do
config.eager_load_paths = config.eager_load_paths.reject { |path| path.end_with?("/models") }
end
end
end
end
4 changes: 0 additions & 4 deletions lib/monkey_patches.rb
Original file line number Diff line number Diff line change
@@ -85,10 +85,6 @@ def recursive_merge(hash = nil)
end
end

module Kaminari::Helpers
PARAM_KEY_EXCEPT_LIST = [:authenticity_token, :commit, :utf8, :_method, :script_name, :original_script_name].freeze
end

module ActionController::HttpAuthentication::Token
AUTHN_PAIR_DELIMITERS = /(?:,|;|\t)/
end