blacklight 5.16.4 → 5.17.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: e56b20bdd2b2230a8c427bd8a71188499ecadefd
4
- data.tar.gz: f7b4394bde76c526e48d7305f1b0f40c094d2ea4
3
+ metadata.gz: d718d6ce1d7a9acf09add7de9ffc63a514c886b2
4
+ data.tar.gz: 4fb53f6e833c2bbb4db244269378dc82acae1612
5
5
  SHA512:
6
- metadata.gz: 1cee2f321d52e3b5733cbfcecf0c2fcf74f584e6a86e482ae5a67b0aad858b07e9d926b8b8778ca9aa5ce2147b0f98c6c5766fb5c3a6ea8e48a1d142653de09e
7
- data.tar.gz: 9d6aeb7047e02b917ab07c08847b646a5e952c46c74e56cef99524a94ed4d444b474fda2b57914b7c588a46cb8a313381a885d0a97ef19da8b5d2b955b45abf7
6
+ metadata.gz: 707e0171c0847a5110d2684f1fae48c127ef7a2ef715a758ba8d58dcf6e425d02a4164a23d6e53996eb248852d183f031223ff8eea23e387210240a0e6f084da
7
+ data.tar.gz: bb7e8038c4d226a4c895288079b311b8cd7d286616f26ec95c1dd3dec1f8a8ce49abe08e5d3e216e76af9d49424e55a014ad1b2e72766994be4ec3bcd5761574
data/Gemfile CHANGED
@@ -5,6 +5,7 @@ gemspec path: File.expand_path('..', __FILE__)
5
5
 
6
6
  gem 'simplecov', '~> 0.10', require: false
7
7
  gem 'coveralls', '~> 0.8.6', require: false
8
+ gem 'autoprefixer-rails', '~> 6.0.0' if RUBY_VERSION < '2.0'
8
9
 
9
10
  group :test do
10
11
  gem "blacklight-marc", "~> 5.0", github: "projectblacklight/blacklight_marc"
data/VERSION CHANGED
@@ -1 +1 @@
1
- 5.16.4
1
+ 5.17.0
@@ -320,6 +320,8 @@ module Blacklight::Catalog
320
320
  # DEPRECATED; this method will be removed in Blacklight 6.0 and the functionality
321
321
  # moved to invalid_document_id_error
322
322
  def invalid_solr_id_error(exception)
323
+ raise exception unless Pathname.new("#{Rails.root}/public/404.html").exist?
324
+
323
325
  error_info = {
324
326
  "status" => "404",
325
327
  "error" => "#{exception.class}: #{exception.message}"
@@ -3,7 +3,7 @@ xml.entry do
3
3
  xml.title presenter(document).render_document_index_label(document_show_link_field(document))
4
4
 
5
5
  # updated is required, for now we'll just set it to now, sorry
6
- xml.updated Time.now.strftime("%Y-%m-%dT%H:%M:%SZ")
6
+ xml.updated Time.current.iso8601
7
7
 
8
8
  xml.link "rel" => "alternate", "type" => "text/html", "href" => polymorphic_url(url_for_document(document))
9
9
  # add other doc-specific formats, atom only lets us have one per
@@ -50,6 +50,4 @@ xml.entry do
50
50
  end
51
51
 
52
52
  end
53
-
54
-
55
- end
53
+ end
@@ -43,7 +43,7 @@ xml.feed("xmlns" => "http://www.w3.org/2005/Atom",
43
43
 
44
44
 
45
45
  # updated is required, for now we'll just set it to now, sorry
46
- xml.updated Time.now.strftime("%Y-%m-%dT%H:%M:%SZ")
46
+ xml.updated Time.current.iso8601
47
47
 
48
48
  @document_list.each_with_index do |document, document_counter|
49
49
  xml << Nokogiri::XML.fragment(render_document_partials(document, blacklight_config.view_config(:atom).partials, document_counter: document_counter))
@@ -6,7 +6,7 @@ class CreateSearches < ActiveRecord::Migration
6
6
  t.integer :user_id
7
7
  t.string :user_type
8
8
 
9
- t.timestamps
9
+ t.timestamps null: false
10
10
  end
11
11
 
12
12
  add_index :searches, :user_id
@@ -6,7 +6,7 @@ class CreateBookmarks < ActiveRecord::Migration
6
6
  t.string :user_type
7
7
  t.string :document_id
8
8
  t.string :title
9
- t.timestamps
9
+ t.timestamps null: false
10
10
  end
11
11
  end
12
12
 
@@ -16,6 +16,21 @@ module Blacklight
16
16
  @connection ||= build_connection
17
17
  end
18
18
 
19
+ ##
20
+ # Find a single document result by a known id
21
+ # @param [String] document's unique key value
22
+ # @param [Hash] additional query parameters
23
+ def find(id, params = {})
24
+ fail NotImplementedError
25
+ end
26
+
27
+ ##
28
+ # Execute a search query against a search index
29
+ # @param [Hash] query parameters
30
+ def search(params = {})
31
+ fail NotImplementedError
32
+ end
33
+
19
34
  protected
20
35
  def connection_config
21
36
  blacklight_config.connection_config
@@ -1,4 +1,8 @@
1
1
  module Blacklight
2
+ ##
3
+ # Blacklight's SearchBuilder converts blacklight request parameters into
4
+ # query parameters appropriate for search index. It does so by evaluating a
5
+ # chain of processing methods to populate a result hash (see {#to_hash}).
2
6
  class SearchBuilder
3
7
  extend Deprecation
4
8
  self.deprecation_horizon = "blacklight 6.0"
@@ -181,7 +181,21 @@ module Blacklight
181
181
  # @return [OpenStructWithHashAccess] a new instance of an OpenStructWithHashAccess
182
182
  def merge! other_hash
183
183
  @table.merge!(nested_class, (other_hash if other_hash.is_a? Hash) || other_hash.to_h)
184
- end
184
+ end
185
+
186
+ ##
187
+ # Override #method_missing from OpenStruct to ensure the default_proc logic
188
+ # gets triggered.
189
+ def method_missing(mid, *args)
190
+ len = args.length
191
+
192
+ if len == 0
193
+ new_ostruct_member(mid)
194
+ @table[mid]
195
+ else
196
+ super
197
+ end
198
+ end
185
199
 
186
200
  private
187
201
  def set_default_proc!
@@ -4,6 +4,15 @@ class <%= controller_name.classify %>Controller < ApplicationController
4
4
  include Blacklight::Catalog
5
5
 
6
6
  configure_blacklight do |config|
7
+ ## Class for sending and receiving requests from a search index
8
+ # config.repository_class = Blacklight::Solr::Repository
9
+ #
10
+ ## Class for converting Blacklight's url parameters to into request parameters for the search index
11
+ # config.search_builder_class = ::SearchBuilder
12
+ #
13
+ ## Model that maps search index responses to the blacklight response model
14
+ # config.response_model = Blacklight::Solr::Response
15
+
7
16
  ## Default parameters to send to solr for all search-like requests. See also SearchBuilder#processed_parameters
8
17
  config.default_solr_params = {
9
18
  :qt => 'search',
@@ -65,9 +74,9 @@ class <%= controller_name.classify %>Controller < ApplicationController
65
74
  config.add_facet_field 'example_pivot_field', :label => 'Pivot Field', :pivot => ['format', 'language_facet']
66
75
 
67
76
  config.add_facet_field 'example_query_facet_field', :label => 'Publish Date', :query => {
68
- :years_5 => { :label => 'within 5 Years', :fq => "pub_date:[#{Time.now.year - 5 } TO *]" },
69
- :years_10 => { :label => 'within 10 Years', :fq => "pub_date:[#{Time.now.year - 10 } TO *]" },
70
- :years_25 => { :label => 'within 25 Years', :fq => "pub_date:[#{Time.now.year - 25 } TO *]" }
77
+ :years_5 => { :label => 'within 5 Years', :fq => "pub_date:[#{Time.zone.now.year - 5 } TO *]" },
78
+ :years_10 => { :label => 'within 10 Years', :fq => "pub_date:[#{Time.zone.now.year - 10 } TO *]" },
79
+ :years_25 => { :label => 'within 25 Years', :fq => "pub_date:[#{Time.zone.now.year - 25 } TO *]" }
71
80
  }
72
81
 
73
82
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: blacklight
3
3
  version: !ruby/object:Gem::Version
4
- version: 5.16.4
4
+ version: 5.17.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jonathan Rochkind
@@ -17,7 +17,7 @@ authors:
17
17
  autorequire:
18
18
  bindir: bin
19
19
  cert_chain: []
20
- date: 2015-11-17 00:00:00.000000000 Z
20
+ date: 2015-12-12 00:00:00.000000000 Z
21
21
  dependencies:
22
22
  - !ruby/object:Gem::Dependency
23
23
  name: rails