blacklight 6.1.0 → 6.2.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 10118d3a200e5152de30c6f1738a5ce717e41802
4
- data.tar.gz: 36743744db251f2c367347d538f9a4414422e33e
3
+ metadata.gz: 56c35c6ca23b02b1ca6e11d7ba4eca20e6e98765
4
+ data.tar.gz: e84c2c02337bd0ff644922c8007b8aa700b1a0bc
5
5
  SHA512:
6
- metadata.gz: 42344240b708f4b0a48c8d8837b4a2aef285fb2a5cbdbb5b73d7585db3cea3a6f43d11f87ce2fda62ecd543fba5f08540759d489188ab3ffc85e6c23da9afadd
7
- data.tar.gz: cd6920cc46fc9823f9953debe129d8fa9a21dadcb1dd3e19a8c9b0c281c274bc084a2902e1ed54a85fa9186970c9294fcba153e584c56992b7b596828db7eede
6
+ metadata.gz: 9e78806fd48f0861fba67936341782d9411b45719688c9fc1fe08cd4e3cc1a8e5675ab3496c185ae16ad2b0a8019a9d2b0b535d36f6284e5a2d2c21623424064
7
+ data.tar.gz: 2e72ce5c749e044c9c60383341ef872ba427feeb4da4172adbf3bd257e41ea5cd7eb6d653d0a6fc0ee57cdee2fb70d5e0e2d55df2ae85b3045584a27eea819f1
@@ -1,34 +1,31 @@
1
1
  language: ruby
2
2
  sudo: false
3
- cache:
4
- directories:
5
- - /tmp/solr-5.3.0
6
3
 
7
4
  notifications:
8
5
  email: false
9
6
 
10
7
  rvm:
11
- - 2.3.0
8
+ - 2.3.1
12
9
 
13
10
  matrix:
14
11
  include:
15
- - rvm: 2.1.6
16
- env: "RAILS_VERSION=4.2.5"
17
- - rvm: 2.2.4
18
- env: "RAILS_VERSION=4.2.5"
19
- - rvm: 2.3.0
20
- env: "RAILS_VERSION=5.0.0.beta3"
21
- - rvm: jruby-9.0.4.0
22
- env: "RAILS_VERSION=4.2.5 JRUBY_OPTS=\"-J-Xms512m -J-Xmx1024m\""
12
+ - rvm: 2.1.9
13
+ env: "RAILS_VERSION=4.2.6"
14
+ - rvm: 2.2.5
15
+ env: "RAILS_VERSION=4.2.6"
16
+ - rvm: 2.3.1
17
+ env: "RAILS_VERSION=5.0.0.rc1"
18
+ - rvm: jruby-9.0.5.0
19
+ env: "RAILS_VERSION=4.2.6 JRUBY_OPTS=\"-J-Xms512m -J-Xmx1024m\""
23
20
  allow_failures:
24
- - rvm: jruby-9.0.4.0
21
+ - rvm: jruby-9.0.5.0
25
22
  fast_finish: true
26
23
 
27
24
  before_install:
28
25
  - gem install bundler
29
26
 
30
27
  env:
31
- - "RAILS_VERSION=4.2.5"
28
+ - "RAILS_VERSION=4.2.6"
32
29
 
33
30
  notifications:
34
31
  irc: "irc.freenode.org#blacklight"
@@ -37,3 +34,5 @@ notifications:
37
34
 
38
35
  global_env:
39
36
  - NOKOGIRI_USE_SYSTEM_LIBRARIES=true
37
+
38
+ jdk: oraclejdk8
data/Gemfile CHANGED
@@ -45,3 +45,5 @@ else
45
45
  end
46
46
  end
47
47
  # END ENGINE_CART BLOCK
48
+
49
+ eval_gemfile File.expand_path("spec/test_app_templates/Gemfile.extra", File.dirname(__FILE__))
data/VERSION CHANGED
@@ -1 +1 @@
1
- 6.1.0
1
+ 6.2.0
@@ -134,7 +134,7 @@ module Blacklight::SearchHelper
134
134
  end
135
135
 
136
136
  def repository
137
- @repository ||= repository_class.new(blacklight_config)
137
+ repository_class.new(blacklight_config)
138
138
  end
139
139
 
140
140
  private
@@ -35,10 +35,10 @@ Gem::Specification.new do |s|
35
35
  s.add_dependency "twitter-typeahead-rails", '~> 0.11'
36
36
 
37
37
  s.add_development_dependency "solr_wrapper"
38
- s.add_development_dependency "rspec-rails", "~> 3.0"
38
+ s.add_development_dependency "rspec-rails", ">= 3.4", "< 4"
39
39
  s.add_development_dependency "rspec-its"
40
40
  s.add_development_dependency "rspec-collection_matchers", ">= 1.0"
41
- s.add_development_dependency "capybara"
41
+ s.add_development_dependency "capybara", '~> 2.6.0'
42
42
  s.add_development_dependency "poltergeist"
43
43
  s.add_development_dependency 'engine_cart', '~> 0.8.0'
44
44
  s.add_development_dependency "equivalent-xml"
@@ -3,13 +3,11 @@ class CreateSearches < ActiveRecord::Migration
3
3
  def self.up
4
4
  create_table :searches do |t|
5
5
  t.text :query_params
6
- t.integer :user_id
6
+ t.integer :user_id, index: true
7
7
  t.string :user_type
8
8
 
9
9
  t.timestamps null: false
10
10
  end
11
-
12
- add_index :searches, :user_id
13
11
  end
14
12
 
15
13
  def self.down
@@ -2,9 +2,10 @@
2
2
  class CreateBookmarks < ActiveRecord::Migration
3
3
  def self.up
4
4
  create_table :bookmarks do |t|
5
- t.integer :user_id, :null=>false
5
+ t.integer :user_id, index: true, null: false
6
6
  t.string :user_type
7
- t.string :document_id
7
+ t.string :document_id, index: true
8
+ t.string :document_type
8
9
  t.string :title
9
10
  t.timestamps null: false
10
11
  end
@@ -1,8 +1,8 @@
1
1
  # frozen_string_literal: true
2
2
  class AddPolymorphicTypeToBookmarks < ActiveRecord::Migration
3
3
  def change
4
- add_column(:bookmarks, :document_type, :string)
4
+ add_column(:bookmarks, :document_type, :string) unless Bookmark.connection.column_exists? :bookmarks, :document_type
5
5
 
6
- add_index :bookmarks, :user_id
6
+ add_index :bookmarks, :user_id unless Bookmark.connection.index_exists? :bookmarks, :user_id
7
7
  end
8
8
  end
@@ -10,6 +10,7 @@ module Blacklight
10
10
  autoload :Exceptions, 'blacklight/exceptions'
11
11
  autoload :Parameters, 'blacklight/parameters'
12
12
  autoload :Routes, 'blacklight/routes'
13
+ autoload :RuntimeRegistry, 'blacklight/runtime_registry'
13
14
  autoload :SearchBuilder, 'blacklight/search_builder'
14
15
  autoload :SearchState, 'blacklight/search_state'
15
16
  autoload :Solr, 'blacklight/solr'
@@ -26,7 +27,11 @@ module Blacklight
26
27
  ##
27
28
  # The default index connection for the search index
28
29
  def self.default_index
29
- @default_index ||= repository_class.new(default_configuration)
30
+ Blacklight::RuntimeRegistry.connection ||= repository_class.new(default_configuration)
31
+ end
32
+
33
+ def self.default_index=(repository)
34
+ Blacklight::RuntimeRegistry.connection = repository
30
35
  end
31
36
 
32
37
  ##
@@ -52,10 +57,14 @@ module Blacklight
52
57
  end
53
58
 
54
59
  def self.connection_config
55
- @connection_config ||= begin
56
- raise "The #{::Rails.env} environment settings were not found in the blacklight.yml config" unless blacklight_yml[::Rails.env]
57
- blacklight_yml[::Rails.env].symbolize_keys
58
- end
60
+ Blacklight::RuntimeRegistry.connection_config ||= begin
61
+ raise "The #{::Rails.env} environment settings were not found in the blacklight.yml config" unless blacklight_yml[::Rails.env]
62
+ blacklight_yml[::Rails.env].symbolize_keys
63
+ end
64
+ end
65
+
66
+ def self.connection_config=(value)
67
+ Blacklight::RuntimeRegistry.connection_config = value
59
68
  end
60
69
 
61
70
  def self.blacklight_yml
@@ -0,0 +1,9 @@
1
+ require 'active_support/per_thread_registry'
2
+
3
+ module Blacklight
4
+ class RuntimeRegistry
5
+ extend ActiveSupport::PerThreadRegistry
6
+
7
+ attr_accessor :connection, :connection_config
8
+ end
9
+ end
@@ -100,7 +100,7 @@ EOF
100
100
  def generate_blacklight_marc_demo
101
101
  if options[:marc]
102
102
  blacklight_marc = String.new('blacklight-marc')
103
- gem blacklight_marc, '~> 6.0'
103
+ gem blacklight_marc, '~> 6.1'
104
104
 
105
105
  Bundler.with_clean_env do
106
106
  run "bundle install"
@@ -459,6 +459,7 @@
459
459
 
460
460
  <!-- NOTE: this is not a full list of fields in the index; dynamic fields are also used -->
461
461
  <field name="id" type="string" indexed="true" stored="true" required="true" />
462
+ <field name="_version_" type="long" indexed="true" stored="true" multiValued="false" />
462
463
  <field name="timestamp" type="date" indexed="true" stored="true" default="NOW" multiValued="false"/>
463
464
  <!-- default, catch all search field -->
464
465
  <field name="text" type="text" indexed="true" stored="false" multiValued="true"/>
@@ -22,7 +22,7 @@ describe 'Blacklight::Document::ActiveModelShim' do
22
22
  end
23
23
 
24
24
  before do
25
- allow(MockDocument.repository).to receive(:find).and_return(MockResponse.new([{id: 1}], {}))
25
+ allow(MockDocument).to receive(:repository).and_return(double(find: MockResponse.new([{id: 1}], {})))
26
26
  end
27
27
 
28
28
  describe "#find" do
@@ -81,7 +81,7 @@ describe Blacklight::Document do
81
81
  end
82
82
 
83
83
  before do
84
- allow(MockDocument.repository).to receive(:find).and_return(MockResponse.new([{id: 1}], {}))
84
+ allow(MockDocument).to receive(:repository).and_return(double(find: MockResponse.new([{id: 1}], {})))
85
85
  end
86
86
 
87
87
  it "should have a globalid" do
@@ -10,6 +10,7 @@ describe 'catalog/_facet_index_navigation.html.erb', type: :view do
10
10
  assign(:pagination, pagination)
11
11
  assign(:facet, facet)
12
12
  allow(view).to receive(:blacklight_config).and_return(blacklight_config)
13
+ controller.request.path_parameters[:action] = 'index'
13
14
  end
14
15
 
15
16
  it 'renders the facet index navigation range' do
@@ -3,6 +3,10 @@ require 'spec_helper'
3
3
 
4
4
  describe "catalog/_paginate_compact.html.erb" do
5
5
  let(:user) { User.new.tap { |u| u.save(validate: false) } }
6
+
7
+ before do
8
+ controller.request.path_parameters[:action] = 'index'
9
+ end
6
10
 
7
11
  describe "with a real solr response", :integration => true do
8
12
  def blacklight_config
@@ -13,6 +13,8 @@ describe "catalog/_view_type_group" do
13
13
  end
14
14
 
15
15
  allow(view).to receive_messages(how_sort_and_per_page?: true, blacklight_config: blacklight_config)
16
+
17
+ controller.request.path_parameters[:action] = 'index'
16
18
  end
17
19
 
18
20
  it "should not display the group when there's only one option" do
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
- gem "blacklight", ">= 5.3.0"
2
+ gem "blacklight", ">= 6.1"
3
3
  gem "jettywrapper", ">= 2.0"
4
4
  gem 'tzinfo-data', platforms: [:mingw, :mswin, :x64_mingw]
5
5
 
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: 6.1.0
4
+ version: 6.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jonathan Rochkind
@@ -17,7 +17,7 @@ authors:
17
17
  autorequire:
18
18
  bindir: exe
19
19
  cert_chain: []
20
- date: 2016-04-07 00:00:00.000000000 Z
20
+ date: 2016-05-10 00:00:00.000000000 Z
21
21
  dependencies:
22
22
  - !ruby/object:Gem::Dependency
23
23
  name: rails
@@ -161,16 +161,22 @@ dependencies:
161
161
  name: rspec-rails
162
162
  requirement: !ruby/object:Gem::Requirement
163
163
  requirements:
164
- - - "~>"
164
+ - - ">="
165
+ - !ruby/object:Gem::Version
166
+ version: '3.4'
167
+ - - "<"
165
168
  - !ruby/object:Gem::Version
166
- version: '3.0'
169
+ version: '4'
167
170
  type: :development
168
171
  prerelease: false
169
172
  version_requirements: !ruby/object:Gem::Requirement
170
173
  requirements:
171
- - - "~>"
174
+ - - ">="
175
+ - !ruby/object:Gem::Version
176
+ version: '3.4'
177
+ - - "<"
172
178
  - !ruby/object:Gem::Version
173
- version: '3.0'
179
+ version: '4'
174
180
  - !ruby/object:Gem::Dependency
175
181
  name: rspec-its
176
182
  requirement: !ruby/object:Gem::Requirement
@@ -203,16 +209,16 @@ dependencies:
203
209
  name: capybara
204
210
  requirement: !ruby/object:Gem::Requirement
205
211
  requirements:
206
- - - ">="
212
+ - - "~>"
207
213
  - !ruby/object:Gem::Version
208
- version: '0'
214
+ version: 2.6.0
209
215
  type: :development
210
216
  prerelease: false
211
217
  version_requirements: !ruby/object:Gem::Requirement
212
218
  requirements:
213
- - - ">="
219
+ - - "~>"
214
220
  - !ruby/object:Gem::Version
215
- version: '0'
221
+ version: 2.6.0
216
222
  - !ruby/object:Gem::Dependency
217
223
  name: poltergeist
218
224
  requirement: !ruby/object:Gem::Requirement
@@ -491,6 +497,7 @@ files:
491
497
  - lib/blacklight/routes.rb
492
498
  - lib/blacklight/routes/exportable.rb
493
499
  - lib/blacklight/routes/searchable.rb
500
+ - lib/blacklight/runtime_registry.rb
494
501
  - lib/blacklight/search_builder.rb
495
502
  - lib/blacklight/search_state.rb
496
503
  - lib/blacklight/solr.rb
@@ -671,7 +678,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
671
678
  version: '0'
672
679
  requirements: []
673
680
  rubyforge_project:
674
- rubygems_version: 2.5.1
681
+ rubygems_version: 2.4.5.1
675
682
  signing_key:
676
683
  specification_version: 4
677
684
  summary: Blacklight provides a discovery interface for any Solr (http://lucene.apache.org/solr)