blacklight 3.7.1 → 3.7.2

Sign up to get free protection for your applications and to get access to all the features.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 3.7.1
1
+ 3.7.2
@@ -439,10 +439,10 @@ module Blacklight::SolrHelper
439
439
  # Need to set as f.facet_field.facet.limit to make sure we
440
440
  # override any field-specific default in the solr request handler.
441
441
  solr_params[:"f.#{facet_field}.facet.limit"] =
442
- if solr_params["facet.limit"]
442
+ if respond_to?(:facet_list_limit)
443
+ facet_list_limit.to_s.to_i + 1
444
+ elsif solr_params["facet.limit"]
443
445
  solr_params["facet.limit"].to_i + 1
444
- elsif respond_to?(:facet_list_limit)
445
- facet_list_limit.to_s.to_i + 1
446
446
  else
447
447
  20 + 1
448
448
  end
@@ -463,24 +463,16 @@ module Blacklight::SolrHelper
463
463
  # Make the solr call
464
464
  response =find(blacklight_config.solr_request_handler, solr_params)
465
465
 
466
- limit =
467
- if respond_to?(:facet_list_limit)
468
- facet_list_limit.to_s.to_i
469
- elsif solr_params[:"f.#{facet_field}.facet.limit"]
470
- solr_params[:"f.#{facet_field}.facet.limit"] - 1
471
- else
472
- nil
473
- end
474
-
475
-
466
+ limit = solr_params[:"f.#{facet_field}.facet.limit"] -1
467
+
476
468
  # Actually create the paginator!
477
469
  # NOTE: The sniffing of the proper sort from the solr response is not
478
470
  # currently tested for, tricky to figure out how to test, since the
479
471
  # default setup we test against doesn't use this feature.
480
472
  return Blacklight::Solr::FacetPaginator.new(response.facets.first.items,
481
- :offset => solr_params['facet.offset'],
473
+ :offset => solr_params[:"f.#{facet_field}.facet.offset"],
482
474
  :limit => limit,
483
- :sort => response["responseHeader"]["params"]["f.#{facet_field}.facet.sort"] || response["responseHeader"]["params"]["facet.sort"]
475
+ :sort => response["responseHeader"]["params"][:"f.#{facet_field}.facet.sort"] || response["responseHeader"]["params"]["facet.sort"]
484
476
  )
485
477
  end
486
478
 
@@ -69,8 +69,12 @@ EOF
69
69
  def generate_devise_assets
70
70
  if options[:devise]
71
71
  gem "devise"
72
- gem "devise-guests"
73
- run "bundle install"
72
+ gem "devise-guests", "~> 0.2"
73
+
74
+ Bundler.with_clean_env do
75
+ run "bundle install"
76
+ end
77
+
74
78
  generate "devise:install"
75
79
  generate "devise", model_name.classify
76
80
  generate "devise:views"
@@ -155,8 +159,12 @@ EOF
155
159
  def add_sass_configuration
156
160
  gem 'compass-rails', '~> 1.0.0', :group => :assets
157
161
  gem 'compass-susy-plugin', '~> 0.9.0', :group => :assets
158
- run "bundle install"
159
- insert_into_file "config/application.rb", :after => "config.assets.enabled = true" do <<EOF
162
+
163
+ Bundler.with_clean_env do
164
+ run "bundle install"
165
+ end
166
+
167
+ insert_into_file "config/application.rb", :after => "config.assets.enabled = true" do <<EOF
160
168
 
161
169
  # Default SASS Configuration, check out https://github.com/rails/sass-rails for details
162
170
  config.assets.compress = !Rails.env.development?
@@ -109,8 +109,6 @@ gem 'simplecov-rcov', :platform => :mri_19
109
109
  end
110
110
 
111
111
  gem 'jettywrapper', '>= 1.2.0'
112
- gem \"devise\"
113
- gem \"devise-guests\"
114
112
  " >> Gemfile
115
113
 
116
114
  bundle install
@@ -438,6 +438,7 @@ describe 'Blacklight::SolrHelper' do
438
438
  config.add_facet_fields_to_solr_request!
439
439
  config.add_facet_field 'format'
440
440
  config.add_facet_field 'format_ordered', :sort => :count
441
+ config.add_facet_field 'format_limited', :limit => 5
441
442
 
442
443
  end
443
444
  end
@@ -467,7 +468,13 @@ describe 'Blacklight::SolrHelper' do
467
468
  solr_params = solr_facet_params(@facet_field)
468
469
  solr_params[:"f.#{@facet_field}.facet.limit"].should == 1001
469
470
  end
471
+
472
+ it 'uses controller method for limit when a ordinary limit is set' do
473
+ solr_params = solr_facet_params(@facet_field)
474
+ solr_params[:"f.#{@facet_field}.facet.limit"].should == 1001
475
+ end
470
476
  end
477
+
471
478
  it 'uses the default sort' do
472
479
  solr_params = solr_facet_params(@facet_field)
473
480
  solr_params[:"f.#{@facet_field}.facet.sort"].should be_blank
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.7.1
4
+ version: 3.7.2
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -17,7 +17,7 @@ authors:
17
17
  autorequire:
18
18
  bindir: bin
19
19
  cert_chain: []
20
- date: 2012-10-09 00:00:00.000000000 Z
20
+ date: 2012-10-15 00:00:00.000000000 Z
21
21
  dependencies:
22
22
  - !ruby/object:Gem::Dependency
23
23
  name: rails
@@ -508,7 +508,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
508
508
  version: '0'
509
509
  segments:
510
510
  - 0
511
- hash: -2496092326738603899
511
+ hash: -3316550167436372560
512
512
  required_rubygems_version: !ruby/object:Gem::Requirement
513
513
  none: false
514
514
  requirements:
@@ -517,7 +517,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
517
517
  version: '0'
518
518
  segments:
519
519
  - 0
520
- hash: -2496092326738603899
520
+ hash: -3316550167436372560
521
521
  requirements: []
522
522
  rubyforge_project: blacklight
523
523
  rubygems_version: 1.8.23