blacklight 3.2.1 → 3.2.2
Sign up to get free protection for your applications and to get access to all the features.
- data/VERSION +1 -1
- data/app/helpers/blacklight/facets_helper_behavior.rb +24 -12
- data/blacklight.gemspec +2 -2
- data/lib/blacklight/configuration/fields.rb +94 -97
- data/lib/blacklight/search_fields.rb +0 -2
- data/lib/generators/blacklight/templates/solr_document.rb +1 -1
- data/test_support/bin/test.sh +33 -37
- data/test_support/features/step_definitions/saved_searches_steps.rb +1 -4
- data/test_support/spec/controllers/catalog_controller_spec.rb +1 -1
- data/test_support/spec/helpers/facets_helper_spec.rb +37 -13
- data/test_support/spec/lib/blacklight_solr_document_spec.rb +2 -1
- metadata +26 -26
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
3.2.
|
1
|
+
3.2.2
|
@@ -21,29 +21,31 @@ module Blacklight::FacetsHelperBehavior
|
|
21
21
|
|
22
22
|
# Render a collection of facet fields
|
23
23
|
def render_facet_partials fields = facet_field_names, options = {}
|
24
|
-
solr_fields = fields.map
|
25
|
-
case solr_field
|
26
|
-
when String, Symbol
|
27
|
-
@response.facet_by_field_name(solr_field)
|
28
|
-
when Blacklight::Configuration::FacetField
|
29
|
-
@response.facet_by_field_name(solr_field.field)
|
30
|
-
else
|
31
|
-
solr_field
|
32
|
-
end
|
33
|
-
end.compact
|
24
|
+
solr_fields = fields.map { |solr_field| facet_by_field_name(solr_field) }.compact
|
34
25
|
|
35
26
|
solr_fields.map do |display_facet|
|
36
|
-
next if display_facet.items.blank?
|
37
27
|
render_facet_limit(display_facet, options)
|
38
28
|
end.compact.join("\n").html_safe
|
39
29
|
end
|
40
30
|
|
31
|
+
# Get a FacetField object from the @response
|
32
|
+
def facet_by_field_name solr_field
|
33
|
+
case solr_field
|
34
|
+
when String, Symbol
|
35
|
+
@response.facet_by_field_name(solr_field)
|
36
|
+
when Blacklight::Configuration::FacetField
|
37
|
+
@response.facet_by_field_name(solr_field.field)
|
38
|
+
else
|
39
|
+
solr_field
|
40
|
+
end
|
41
|
+
end
|
42
|
+
|
41
43
|
# used in the catalog/_facets partial and elsewhere
|
42
44
|
# Renders a single section for facet limit with a specified
|
43
45
|
# solr field used for faceting. Can be over-ridden for custom
|
44
46
|
# display on a per-facet basis.
|
45
47
|
#
|
46
|
-
# @param [RSolr::Ext::Response::Facets::FacetField]
|
48
|
+
# @param [RSolr::Ext::Response::Facets::FacetField] display_facet
|
47
49
|
# @param [Hash] options parameters to use for rendering the facet limit partial
|
48
50
|
#
|
49
51
|
def render_facet_limit(display_facet, options = {})
|
@@ -51,6 +53,7 @@ module Blacklight::FacetsHelperBehavior
|
|
51
53
|
$stderr.puts "DEPRECATION WARNING: Blacklight::FacetsHelper#render_facet_limit: use #render_facet_partials to render facets by field name"
|
52
54
|
return render_facet_partials([display_facet])
|
53
55
|
end
|
56
|
+
return if not should_render_facet?(display_facet)
|
54
57
|
options = options.dup
|
55
58
|
options[:partial] ||= facet_partial_name(display_facet)
|
56
59
|
options[:layout] ||= "facet_layout" unless options.has_key?(:layout)
|
@@ -63,6 +66,15 @@ module Blacklight::FacetsHelperBehavior
|
|
63
66
|
render(options)
|
64
67
|
end
|
65
68
|
|
69
|
+
##
|
70
|
+
# Determine if Blacklight should render the display_facet or not
|
71
|
+
#
|
72
|
+
# By default, only render facets with items.
|
73
|
+
# @param [RSolr::Ext::Response::Facets::FacetField] display_facet
|
74
|
+
def should_render_facet? display_facet
|
75
|
+
return !display_facet.items.blank?
|
76
|
+
end
|
77
|
+
|
66
78
|
# the name of the partial to use to render a facet field. Can be over-ridden for custom
|
67
79
|
# display on a per-facet basis.
|
68
80
|
def facet_partial_name(display_facet = nil)
|
data/blacklight.gemspec
CHANGED
@@ -20,14 +20,14 @@ Gem::Specification.new do |s|
|
|
20
20
|
|
21
21
|
# PRODUCTION GEM REQUIREMENTS
|
22
22
|
# ---------------------------------------
|
23
|
-
s.add_dependency "rails", "~> 3.1
|
23
|
+
s.add_dependency "rails", "~> 3.1"
|
24
24
|
s.add_dependency "nokogiri", "~>1.5" # XML Parser
|
25
25
|
s.add_dependency "unicode" # provides C-form normalization of unicode characters, as required by refworks.
|
26
26
|
s.add_dependency "marc", "~> 0.4.3" # Marc record parser
|
27
27
|
s.add_dependency "rsolr", "~> 1.0.6" # Library for interacting with rSolr.
|
28
28
|
s.add_dependency "rsolr-ext", '~> 1.0.3' # extension to the above for some rails-ish behaviors - currently embedded in our solr document ojbect.
|
29
29
|
s.add_dependency "kaminari" # the pagination (page 1,2,3, etc..) of our search results
|
30
|
-
s.add_dependency "sass-rails", "~> 3.1
|
30
|
+
s.add_dependency "sass-rails", "~> 3.1"
|
31
31
|
s.add_development_dependency "jettywrapper", ">= 1.2.0"
|
32
32
|
s.add_dependency "compass", ">= 0.12.alpha.2"
|
33
33
|
end
|
@@ -28,114 +28,111 @@ module Blacklight
|
|
28
28
|
end
|
29
29
|
end
|
30
30
|
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
end
|
81
|
-
|
82
|
-
return if field_config.is_a? Array
|
83
|
-
|
84
|
-
if block_given?
|
85
|
-
yield field_config
|
86
|
-
end
|
87
|
-
|
88
|
-
field_config.normalize!(self)
|
89
|
-
field_config.validate!
|
31
|
+
# Add a solr field configuration to the given configuration key
|
32
|
+
#
|
33
|
+
# The recommended and strongly encouraged format is a field name, configuration pair, e.g.:
|
34
|
+
# add_solr_field :index_field, 'format', :label => 'Format'
|
35
|
+
#
|
36
|
+
# Alternative formats include:
|
37
|
+
#
|
38
|
+
# * a field name and block format:
|
39
|
+
#
|
40
|
+
# add_solr_field :index_field, 'format' do |field|
|
41
|
+
# field.label = 'Format'
|
42
|
+
# end
|
43
|
+
#
|
44
|
+
# * a plain block:
|
45
|
+
#
|
46
|
+
# add_solr_field :index_field do |field|
|
47
|
+
# field.field = 'format'
|
48
|
+
# field.label = 'Format'
|
49
|
+
# end
|
50
|
+
#
|
51
|
+
# * a configuration hash:
|
52
|
+
#
|
53
|
+
# add_solr_field :index_field, :field => 'format', :label => 'Format'
|
54
|
+
#
|
55
|
+
# * a Field instance:
|
56
|
+
#
|
57
|
+
# add_solr_field :index_field, IndexField.new(:field => 'format', :label => 'Format')
|
58
|
+
#
|
59
|
+
# * an array of hashes:
|
60
|
+
#
|
61
|
+
# add_solr_field :index_field, [{:field => 'format', :label => 'Format'}, IndexField.new(:field => 'date', :label => 'Date')]
|
62
|
+
#
|
63
|
+
#
|
64
|
+
# @param String config_key
|
65
|
+
# @param Array *args
|
66
|
+
# @para
|
67
|
+
#
|
68
|
+
def add_solr_field config_key, *args, &block
|
69
|
+
field_config = case args.first
|
70
|
+
when String
|
71
|
+
field_config_from_key_and_hash(config_key, *args)
|
72
|
+
when Symbol
|
73
|
+
args.first = args.first.to_s
|
74
|
+
field_config_from_key_and_hash(config_key, *args)
|
75
|
+
when Array
|
76
|
+
field_config_from_array(config_key, *args)
|
77
|
+
else
|
78
|
+
field_config_from_field_or_hash(config_key, *args)
|
79
|
+
end
|
90
80
|
|
91
|
-
|
81
|
+
return if field_config.is_a? Array
|
82
|
+
|
83
|
+
if block_given?
|
84
|
+
yield field_config
|
92
85
|
end
|
86
|
+
|
87
|
+
field_config.normalize!(self)
|
88
|
+
field_config.validate!
|
93
89
|
|
94
|
-
|
95
|
-
|
96
|
-
def field_config_from_key_and_hash config_key, solr_field, field_or_hash = {}
|
97
|
-
field_config = field_config_from_field_or_hash(config_key, field_or_hash)
|
98
|
-
field_config.field = solr_field
|
90
|
+
self[config_key.pluralize][ field_config.field ] = field_config
|
91
|
+
end
|
99
92
|
|
100
|
-
|
101
|
-
|
93
|
+
protected
|
94
|
+
# Add a solr field by a solr field name and hash
|
95
|
+
def field_config_from_key_and_hash config_key, solr_field, field_or_hash = {}
|
96
|
+
field_config = field_config_from_field_or_hash(config_key, field_or_hash)
|
97
|
+
field_config.field = solr_field
|
102
98
|
|
103
|
-
|
104
|
-
|
105
|
-
array_of_fields_or_hashes.map do |field_or_hash|
|
106
|
-
add_solr_field(config_key, field_or_hash)
|
107
|
-
end
|
108
|
-
end
|
99
|
+
field_config
|
100
|
+
end
|
109
101
|
|
110
|
-
|
111
|
-
|
112
|
-
|
102
|
+
# Add multiple solr fields using a hash or Field instance
|
103
|
+
def field_config_from_array config_key, array_of_fields_or_hashes
|
104
|
+
array_of_fields_or_hashes.map do |field_or_hash|
|
105
|
+
add_solr_field(config_key, field_or_hash)
|
113
106
|
end
|
107
|
+
end
|
114
108
|
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
# an empty one. Second argument is an actual class object.
|
120
|
-
def hash_arg_to_config(hash_arg, klass)
|
121
|
-
case hash_arg
|
122
|
-
when Hash
|
123
|
-
klass.new(hash_arg)
|
124
|
-
when NilClass
|
125
|
-
klass.new
|
126
|
-
else
|
127
|
-
# this assumes it already is an element of klass, or acts like one,
|
128
|
-
# if not something bad will happen later, that's your problem.
|
129
|
-
hash_arg
|
130
|
-
end
|
131
|
-
end
|
109
|
+
# Add a solr field using a hash or Field instance
|
110
|
+
def field_config_from_field_or_hash config_key, field_or_hash = {}
|
111
|
+
hash_arg_to_config(field_or_hash, field_class_from_key(config_key))
|
112
|
+
end
|
132
113
|
|
133
|
-
|
134
|
-
|
135
|
-
|
136
|
-
|
114
|
+
# for our add_* methods, takes the optional hash param,
|
115
|
+
# and makes it into a specific config OpenStruct, like
|
116
|
+
# FacetField or SearchField. Or if the param already was
|
117
|
+
# one, that's cool. Or if the param is nil, make
|
118
|
+
# an empty one. Second argument is an actual class object.
|
119
|
+
def hash_arg_to_config(hash_arg, klass)
|
120
|
+
case hash_arg
|
121
|
+
when Hash
|
122
|
+
klass.new(hash_arg)
|
123
|
+
when NilClass
|
124
|
+
klass.new
|
125
|
+
else
|
126
|
+
# this assumes it already is an element of klass, or acts like one,
|
127
|
+
# if not something bad will happen later, that's your problem.
|
128
|
+
hash_arg
|
137
129
|
end
|
130
|
+
end
|
138
131
|
|
132
|
+
private
|
133
|
+
# convert a config key to the appropriate Field class
|
134
|
+
def field_class_from_key key
|
135
|
+
"Blacklight::Configuration::#{key.camelcase}".constantize
|
139
136
|
end
|
140
137
|
end
|
141
138
|
end
|
@@ -26,7 +26,6 @@
|
|
26
26
|
#
|
27
27
|
##
|
28
28
|
module Blacklight::SearchFields
|
29
|
-
extend ActiveSupport::Memoizable
|
30
29
|
extend ActiveSupport::Concern
|
31
30
|
|
32
31
|
included do
|
@@ -35,7 +34,6 @@ module Blacklight::SearchFields
|
|
35
34
|
|
36
35
|
# Looks up search field config list from blacklight_config[:search_fields], and
|
37
36
|
# 'normalizes' all field config hashes using normalize_config method.
|
38
|
-
# Memoized for efficiency of normalization.
|
39
37
|
def search_field_list
|
40
38
|
blacklight_config.search_fields.values
|
41
39
|
end
|
data/test_support/bin/test.sh
CHANGED
@@ -2,6 +2,10 @@
|
|
2
2
|
# test.sh
|
3
3
|
# Create a default rails appliaction, install blacklight, and run all the tests.
|
4
4
|
|
5
|
+
#If null or empty, use default value
|
6
|
+
RAILS_VERSION=${RAILS_VERSION:-"~> 3.2"}
|
7
|
+
JETTY_URL=${JETTY_URL:-"https://github.com/projectblacklight/blacklight-jetty/zipball/v3.5.0"}
|
8
|
+
|
5
9
|
before="$(date +%s)"
|
6
10
|
benchmark()
|
7
11
|
{
|
@@ -47,12 +51,11 @@ else
|
|
47
51
|
exit 1
|
48
52
|
fi
|
49
53
|
|
50
|
-
|
51
54
|
rvm use "$@" --create
|
52
55
|
check_errs $? "rvm failed. please run 'rvm install $@', and then re-run these tests."
|
53
56
|
|
54
|
-
if ! gem query -n rails -v "
|
55
|
-
gem install --no-rdoc --no-ri 'rails'
|
57
|
+
if ! gem query -n rails -v "$RAILS_VERSION" --installed > /dev/null; then
|
58
|
+
gem install --no-rdoc --no-ri 'rails' -v "$RAILS_VERSION"
|
56
59
|
fi
|
57
60
|
|
58
61
|
if ! gem query -n bundler -v ">=1.0" --installed > /dev/null; then
|
@@ -61,77 +64,70 @@ fi
|
|
61
64
|
|
62
65
|
rails new test_app
|
63
66
|
cd test_app
|
67
|
+
rm public/index.html
|
68
|
+
|
64
69
|
echo "
|
65
|
-
source 'http://rubygems.org'
|
66
|
-
gem 'rack', '1.3.3'
|
67
|
-
gem 'rails', '~> 3.1.1'
|
68
70
|
platforms :jruby do
|
69
71
|
gem 'jruby-openssl'
|
70
72
|
gem 'activerecord-jdbcsqlite3-adapter'
|
71
73
|
gem 'jdbc-sqlite3'
|
72
74
|
gem 'mediashelf-loggable', '>= 0.4.8'
|
75
|
+
gem 'therubyrhino'
|
73
76
|
end
|
77
|
+
|
74
78
|
platforms :ruby do
|
75
79
|
gem 'sqlite3-ruby', :require => 'sqlite3'
|
80
|
+
gem 'execjs'
|
81
|
+
gem 'therubyracer'
|
76
82
|
end
|
83
|
+
|
77
84
|
gem 'blacklight', :path => '../../'
|
78
85
|
gem 'jquery-rails'
|
79
86
|
|
80
87
|
group :assets do
|
81
|
-
gem 'sass-rails', '~> 3.1.1'
|
82
|
-
gem 'coffee-rails', '~> 3.1.1'
|
83
|
-
gem 'uglifier'
|
84
88
|
gem 'compass', '0.12.alpha.2'
|
85
|
-
|
86
|
-
platforms :ruby do
|
87
|
-
gem 'execjs'
|
88
|
-
gem 'therubyracer'
|
89
|
-
end
|
90
|
-
|
91
|
-
platforms :jruby do
|
92
|
-
gem 'therubyrhino'
|
93
|
-
end
|
94
89
|
end
|
95
90
|
|
96
91
|
|
97
92
|
# For testing
|
98
93
|
group :development, :test do
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
gem 'webrat'
|
94
|
+
gem 'rspec'
|
95
|
+
gem 'rspec-rails'
|
96
|
+
gem 'generator_spec'
|
97
|
+
gem 'cucumber-rails'
|
98
|
+
gem 'database_cleaner'
|
99
|
+
gem 'capybara'
|
106
100
|
end
|
107
101
|
|
108
102
|
gem 'jettywrapper', '>= 1.2.0'
|
109
103
|
gem \"devise\"
|
110
|
-
"
|
104
|
+
" >> Gemfile
|
111
105
|
|
112
|
-
bundle install
|
113
|
-
bundle update
|
114
|
-
# If a local install fails, try a full install.
|
115
|
-
if [ "$?" -ne "0" ]
|
116
|
-
then
|
117
|
-
bundle install
|
118
|
-
fi
|
106
|
+
bundle install
|
119
107
|
check_errs $? "Bundle install failed."
|
108
|
+
|
120
109
|
rails generate blacklight -d
|
121
110
|
check_errs $? "Blacklight generator failed"
|
111
|
+
|
122
112
|
bundle exec rake db:migrate
|
123
113
|
check_errs $? "Rake Migration failed"
|
114
|
+
|
124
115
|
rails g cucumber:install &> /dev/null
|
125
|
-
|
116
|
+
|
117
|
+
|
118
|
+
jetty_zip=$( echo $JETTY_URL | awk '{split($0,a,"/"); print "/tmp/blacklight_jetty_"a[length(a)]}')
|
126
119
|
if [ ! -f $jetty_zip ]
|
127
120
|
then
|
128
|
-
curl -L
|
121
|
+
curl -L $JETTY_URL -o $jetty_zip
|
129
122
|
check_errs $? "Jetty file does not exist, and cannot be downloaded."
|
130
123
|
fi
|
124
|
+
|
131
125
|
rails g blacklight:jetty test_jetty -e test -d $jetty_zip
|
132
|
-
|
133
|
-
|
126
|
+
check_errs $? "Jetty setup failed."
|
127
|
+
|
134
128
|
bundle exec rake solr:marc:index_test_data RAILS_ENV=test
|
129
|
+
|
135
130
|
bundle exec rake blacklight:hudson
|
136
131
|
check_errs $? "Tests failed."
|
132
|
+
|
137
133
|
benchmark
|
@@ -1,14 +1,11 @@
|
|
1
1
|
# -*- encoding : utf-8 -*-
|
2
2
|
Given /^I am logged in as "([^\"]*)"$/ do |login|
|
3
3
|
email = "#{login}@#{login}.com"
|
4
|
-
user = User.create(:
|
5
|
-
# visit user_sessions_path(:user_session => {:login => login, :password => "password"}), :post
|
6
|
-
# User.find(user.id).should_not be_nil
|
4
|
+
user = User.create(:email => email, :password => "password", :password_confirmation => "password")
|
7
5
|
visit new_user_session_path
|
8
6
|
fill_in("user_email", :with => email)
|
9
7
|
fill_in("user_password", :with => "password")
|
10
8
|
click_button("Sign in")
|
11
|
-
# response.body.should =~ /Logged/m
|
12
9
|
step 'I should see "Log Out"'
|
13
10
|
end
|
14
11
|
|
@@ -329,7 +329,7 @@ describe CatalogController do
|
|
329
329
|
it "should respond to an extension-registered format properly" do
|
330
330
|
get :show, :id => doc_id, :format => "mock" # This no longer works: :format => "mock"
|
331
331
|
response.should be_success
|
332
|
-
response.should
|
332
|
+
response.body.should =~ /mock_export/
|
333
333
|
end
|
334
334
|
|
335
335
|
|
@@ -1,8 +1,30 @@
|
|
1
1
|
require File.expand_path(File.dirname(__FILE__) + '/../spec_helper')
|
2
2
|
describe FacetsHelper do
|
3
3
|
|
4
|
+
describe "should_render_facet?" do
|
5
|
+
it "should render facets with items" do
|
6
|
+
a = mock(:items => [1,2])
|
7
|
+
helper.should_render_facet?(a).should == true
|
8
|
+
end
|
9
|
+
it "should not render facets without items" do
|
10
|
+
empty = mock(:items => [])
|
11
|
+
helper.should_render_facet?(empty).should == false
|
12
|
+
end
|
13
|
+
end
|
14
|
+
|
15
|
+
describe "facet_by_field_name" do
|
16
|
+
it "should retrieve the facet from the response given a string" do
|
17
|
+
a = mock(:name => 'a', :items => [1,2])
|
18
|
+
|
19
|
+
@response = mock()
|
20
|
+
@response.should_receive(:facet_by_field_name).with('a') { a }
|
21
|
+
|
22
|
+
helper.facet_by_field_name('a').should == a
|
23
|
+
end
|
24
|
+
end
|
25
|
+
|
4
26
|
describe "render_facet_partials" do
|
5
|
-
it "should
|
27
|
+
it "should try to render all provided facets " do
|
6
28
|
a = mock(:items => [1,2])
|
7
29
|
b = mock(:items => ['b','c'])
|
8
30
|
empty = mock(:items => [])
|
@@ -11,20 +33,22 @@ describe FacetsHelper do
|
|
11
33
|
|
12
34
|
helper.should_receive(:render_facet_limit).with(a, {})
|
13
35
|
helper.should_receive(:render_facet_limit).with(b, {})
|
14
|
-
helper.
|
36
|
+
helper.should_receive(:render_facet_limit).with(empty, {})
|
37
|
+
|
15
38
|
helper.render_facet_partials fields
|
16
39
|
end
|
17
40
|
|
18
|
-
it "should
|
19
|
-
|
20
|
-
|
41
|
+
it "should default to the configured facets" do
|
42
|
+
a = mock(:items => [1,2])
|
43
|
+
b = mock(:items => ['b','c'])
|
44
|
+
helper.should_receive(:facet_field_names) { [a,b] }
|
21
45
|
|
22
|
-
@response = mock()
|
23
|
-
@response.should_receive(:facet_by_field_name).with('a') { a }
|
24
46
|
helper.should_receive(:render_facet_limit).with(a, {})
|
47
|
+
helper.should_receive(:render_facet_limit).with(b, {})
|
25
48
|
|
26
|
-
helper.render_facet_partials
|
49
|
+
helper.render_facet_partials
|
27
50
|
end
|
51
|
+
|
28
52
|
end
|
29
53
|
|
30
54
|
describe "render_facet_limit" do
|
@@ -40,7 +64,7 @@ describe FacetsHelper do
|
|
40
64
|
end
|
41
65
|
|
42
66
|
it "should set basic local variables" do
|
43
|
-
@mock_facet = mock(:name => 'basic_field')
|
67
|
+
@mock_facet = mock(:name => 'basic_field', :items => [1,2,3])
|
44
68
|
helper.should_receive(:render).with(hash_including(:partial => 'facet_limit',
|
45
69
|
:locals => {
|
46
70
|
:solr_field => 'basic_field',
|
@@ -58,25 +82,25 @@ describe FacetsHelper do
|
|
58
82
|
end
|
59
83
|
|
60
84
|
it "should render a facet _not_ declared in the configuration" do
|
61
|
-
@mock_facet = mock(:name => 'asdf')
|
85
|
+
@mock_facet = mock(:name => 'asdf', :items => [1,2,3])
|
62
86
|
helper.should_receive(:render).with(hash_including(:partial => 'facet_limit'))
|
63
87
|
helper.render_facet_limit(@mock_facet)
|
64
88
|
end
|
65
89
|
|
66
90
|
it "should get the partial name from the configuration" do
|
67
|
-
@mock_facet = mock(:name => 'my_facet_field_with_custom_partial')
|
91
|
+
@mock_facet = mock(:name => 'my_facet_field_with_custom_partial', :items => [1,2,3])
|
68
92
|
helper.should_receive(:render).with(hash_including(:partial => 'custom_facet_partial'))
|
69
93
|
helper.render_facet_limit(@mock_facet)
|
70
94
|
end
|
71
95
|
|
72
96
|
it "should use a partial layout for rendering the facet frame" do
|
73
|
-
@mock_facet = mock(:name => 'my_facet_field_with_custom_partial')
|
97
|
+
@mock_facet = mock(:name => 'my_facet_field_with_custom_partial', :items => [1,2,3])
|
74
98
|
helper.should_receive(:render).with(hash_including(:layout => 'facet_layout'))
|
75
99
|
helper.render_facet_limit(@mock_facet)
|
76
100
|
end
|
77
101
|
|
78
102
|
it "should allow the caller to opt-out of facet layouts" do
|
79
|
-
@mock_facet = mock(:name => 'my_facet_field_with_custom_partial')
|
103
|
+
@mock_facet = mock(:name => 'my_facet_field_with_custom_partial', :items => [1,2,3])
|
80
104
|
helper.should_receive(:render).with(hash_including(:layout => nil))
|
81
105
|
helper.render_facet_limit(@mock_facet, :layout => nil)
|
82
106
|
end
|
@@ -21,7 +21,8 @@ describe "Blacklight::Solr::Document" do
|
|
21
21
|
|
22
22
|
context "Unique Key" do
|
23
23
|
it "should use a configuration-defined document unique key" do
|
24
|
-
MockDocument.
|
24
|
+
MockDocument.unique_key = 'my_unique_key'
|
25
|
+
|
25
26
|
@document = MockDocument.new :id => 'asdf', :my_unique_key => '1234'
|
26
27
|
@document.id.should == '1234'
|
27
28
|
end
|
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: 3.2.
|
4
|
+
version: 3.2.2
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -16,22 +16,22 @@ authors:
|
|
16
16
|
autorequire:
|
17
17
|
bindir: bin
|
18
18
|
cert_chain: []
|
19
|
-
date:
|
19
|
+
date: 2012-01-25 00:00:00.000000000 Z
|
20
20
|
dependencies:
|
21
21
|
- !ruby/object:Gem::Dependency
|
22
22
|
name: rails
|
23
|
-
requirement: &
|
23
|
+
requirement: &2152624320 !ruby/object:Gem::Requirement
|
24
24
|
none: false
|
25
25
|
requirements:
|
26
26
|
- - ~>
|
27
27
|
- !ruby/object:Gem::Version
|
28
|
-
version: 3.1
|
28
|
+
version: '3.1'
|
29
29
|
type: :runtime
|
30
30
|
prerelease: false
|
31
|
-
version_requirements: *
|
31
|
+
version_requirements: *2152624320
|
32
32
|
- !ruby/object:Gem::Dependency
|
33
33
|
name: nokogiri
|
34
|
-
requirement: &
|
34
|
+
requirement: &2152623840 !ruby/object:Gem::Requirement
|
35
35
|
none: false
|
36
36
|
requirements:
|
37
37
|
- - ~>
|
@@ -39,10 +39,10 @@ dependencies:
|
|
39
39
|
version: '1.5'
|
40
40
|
type: :runtime
|
41
41
|
prerelease: false
|
42
|
-
version_requirements: *
|
42
|
+
version_requirements: *2152623840
|
43
43
|
- !ruby/object:Gem::Dependency
|
44
44
|
name: unicode
|
45
|
-
requirement: &
|
45
|
+
requirement: &2152623460 !ruby/object:Gem::Requirement
|
46
46
|
none: false
|
47
47
|
requirements:
|
48
48
|
- - ! '>='
|
@@ -50,10 +50,10 @@ dependencies:
|
|
50
50
|
version: '0'
|
51
51
|
type: :runtime
|
52
52
|
prerelease: false
|
53
|
-
version_requirements: *
|
53
|
+
version_requirements: *2152623460
|
54
54
|
- !ruby/object:Gem::Dependency
|
55
55
|
name: marc
|
56
|
-
requirement: &
|
56
|
+
requirement: &2152622540 !ruby/object:Gem::Requirement
|
57
57
|
none: false
|
58
58
|
requirements:
|
59
59
|
- - ~>
|
@@ -61,10 +61,10 @@ dependencies:
|
|
61
61
|
version: 0.4.3
|
62
62
|
type: :runtime
|
63
63
|
prerelease: false
|
64
|
-
version_requirements: *
|
64
|
+
version_requirements: *2152622540
|
65
65
|
- !ruby/object:Gem::Dependency
|
66
66
|
name: rsolr
|
67
|
-
requirement: &
|
67
|
+
requirement: &2152621760 !ruby/object:Gem::Requirement
|
68
68
|
none: false
|
69
69
|
requirements:
|
70
70
|
- - ~>
|
@@ -72,10 +72,10 @@ dependencies:
|
|
72
72
|
version: 1.0.6
|
73
73
|
type: :runtime
|
74
74
|
prerelease: false
|
75
|
-
version_requirements: *
|
75
|
+
version_requirements: *2152621760
|
76
76
|
- !ruby/object:Gem::Dependency
|
77
77
|
name: rsolr-ext
|
78
|
-
requirement: &
|
78
|
+
requirement: &2152621120 !ruby/object:Gem::Requirement
|
79
79
|
none: false
|
80
80
|
requirements:
|
81
81
|
- - ~>
|
@@ -83,10 +83,10 @@ dependencies:
|
|
83
83
|
version: 1.0.3
|
84
84
|
type: :runtime
|
85
85
|
prerelease: false
|
86
|
-
version_requirements: *
|
86
|
+
version_requirements: *2152621120
|
87
87
|
- !ruby/object:Gem::Dependency
|
88
88
|
name: kaminari
|
89
|
-
requirement: &
|
89
|
+
requirement: &2152620680 !ruby/object:Gem::Requirement
|
90
90
|
none: false
|
91
91
|
requirements:
|
92
92
|
- - ! '>='
|
@@ -94,21 +94,21 @@ dependencies:
|
|
94
94
|
version: '0'
|
95
95
|
type: :runtime
|
96
96
|
prerelease: false
|
97
|
-
version_requirements: *
|
97
|
+
version_requirements: *2152620680
|
98
98
|
- !ruby/object:Gem::Dependency
|
99
99
|
name: sass-rails
|
100
|
-
requirement: &
|
100
|
+
requirement: &2152620100 !ruby/object:Gem::Requirement
|
101
101
|
none: false
|
102
102
|
requirements:
|
103
103
|
- - ~>
|
104
104
|
- !ruby/object:Gem::Version
|
105
|
-
version: 3.1
|
105
|
+
version: '3.1'
|
106
106
|
type: :runtime
|
107
107
|
prerelease: false
|
108
|
-
version_requirements: *
|
108
|
+
version_requirements: *2152620100
|
109
109
|
- !ruby/object:Gem::Dependency
|
110
110
|
name: jettywrapper
|
111
|
-
requirement: &
|
111
|
+
requirement: &2152562760 !ruby/object:Gem::Requirement
|
112
112
|
none: false
|
113
113
|
requirements:
|
114
114
|
- - ! '>='
|
@@ -116,10 +116,10 @@ dependencies:
|
|
116
116
|
version: 1.2.0
|
117
117
|
type: :development
|
118
118
|
prerelease: false
|
119
|
-
version_requirements: *
|
119
|
+
version_requirements: *2152562760
|
120
120
|
- !ruby/object:Gem::Dependency
|
121
121
|
name: compass
|
122
|
-
requirement: &
|
122
|
+
requirement: &2152562280 !ruby/object:Gem::Requirement
|
123
123
|
none: false
|
124
124
|
requirements:
|
125
125
|
- - ! '>='
|
@@ -127,7 +127,7 @@ dependencies:
|
|
127
127
|
version: 0.12.alpha.2
|
128
128
|
type: :runtime
|
129
129
|
prerelease: false
|
130
|
-
version_requirements: *
|
130
|
+
version_requirements: *2152562280
|
131
131
|
description: Blacklight is a free and open source ruby-on-rails based discovery interface
|
132
132
|
(a.k.a. “next-generation catalog”) especially optimized for heterogeneous collections.
|
133
133
|
You can use it as a library catalog, as a front end for a digital repository, or
|
@@ -435,7 +435,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
435
435
|
version: '0'
|
436
436
|
segments:
|
437
437
|
- 0
|
438
|
-
hash:
|
438
|
+
hash: 2527126427684428122
|
439
439
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
440
440
|
none: false
|
441
441
|
requirements:
|
@@ -444,7 +444,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
444
444
|
version: '0'
|
445
445
|
segments:
|
446
446
|
- 0
|
447
|
-
hash:
|
447
|
+
hash: 2527126427684428122
|
448
448
|
requirements: []
|
449
449
|
rubyforge_project: blacklight
|
450
450
|
rubygems_version: 1.8.10
|