blacklight 6.6.1 → 6.6.2

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: a591d2faa2186e933585bfbda29802ab1b185714
4
- data.tar.gz: 12580c6806aa5dc22d4977594796013f75705fb3
3
+ metadata.gz: 8a1212427a6ef925e7c442010f44118a4931ae67
4
+ data.tar.gz: 20da8e50afe0876f9ca7f79a22667933ed3562a8
5
5
  SHA512:
6
- metadata.gz: 4c80858411a22e4444b5a72a95fc72cb64eb1588c24a0f399494b7a08e2c3cd506fd7728a8152f221fc39161fe497b995909eaefdf4de67efc2b6e61abdd9831
7
- data.tar.gz: 8645a1a9d3a74dcc07b49f0afa12abaee10185f3403155823d057d3fa225df29f0f40a0e03e9b0acdb8946fb8f6639b6fd659b2b785f7666c29a87929cce493f
6
+ metadata.gz: 50044f685027f9733d984402f93891a2cb8969b6d97fdb729a0174f5a1bd118963292ab301bc7aa396a6e5dc4e792a67229a382352fba6ab0e187985bac004e2
7
+ data.tar.gz: 1b98e3acfe972a79d3ae486ee7c178ce32f4ebf17277fa44a439cf5136d7b5fcd32af12be96b301f556996cd8069b77252f98175cafb7b4a7b9ca802385f032e
@@ -21,4 +21,8 @@ Style/IndentationConsistency:
21
21
  Enabled: false
22
22
 
23
23
  Rails/OutputSafety:
24
- Enabled: false
24
+ Enabled: false
25
+
26
+ Style/MethodMissing:
27
+ Exclude:
28
+ - 'lib/blacklight/utils.rb'
data/VERSION CHANGED
@@ -1 +1 @@
1
- 6.6.1
1
+ 6.6.2
@@ -224,7 +224,7 @@ module Blacklight::Catalog
224
224
  def validate_email_params
225
225
  if params[:to].blank?
226
226
  flash[:error] = I18n.t('blacklight.email.errors.to.blank')
227
- elsif !params[:to].match(defined?(Devise) ? Devise.email_regexp : /^[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\.[A-Za-z]{2,4}$/)
227
+ elsif !params[:to].match(Blacklight::Engine.config.email_regexp)
228
228
  flash[:error] = I18n.t('blacklight.email.errors.to.invalid', :to => params[:to])
229
229
  end
230
230
 
@@ -43,5 +43,7 @@ module Blacklight
43
43
  }
44
44
 
45
45
  config.bookmarks_http_method = :post
46
+
47
+ config.email_regexp = defined?(Devise) ? Devise.email_regexp : /\A[^@\s]+@[^@\s]+\z/
46
48
  end
47
49
  end
@@ -167,10 +167,6 @@ module Blacklight
167
167
  super
168
168
  end
169
169
  end
170
-
171
- def respond_to_missing?(*_)
172
- true
173
- end
174
170
 
175
171
  private
176
172
 
@@ -16,5 +16,17 @@ module Blacklight
16
16
  def create_search_builder
17
17
  template "search_builder.rb", "app/models/#{model_name}.rb"
18
18
  end
19
+
20
+ def create_search_builder_spec
21
+ return unless rspec_installed?
22
+
23
+ template "search_builder_spec.rb", "spec/models/#{model_name}_spec.rb"
24
+ end
25
+
26
+ private
27
+
28
+ def rspec_installed?
29
+ defined?(RSpec) && defined?(RSpec::Rails)
30
+ end
19
31
  end
20
32
  end
@@ -1,4 +1,12 @@
1
1
  # frozen_string_literal: true
2
- class SearchBuilder < Blacklight::SearchBuilder
2
+ class <%= model_name.classify %> < Blacklight::SearchBuilder
3
3
  include Blacklight::Solr::SearchBuilderBehavior
4
+
5
+ ##
6
+ # @example Adding a new step to the processor chain
7
+ # self.default_processor_chain += [:add_custom_data_to_query]
8
+ #
9
+ # def add_custom_data_to_query(solr_parameters)
10
+ # solr_parameters[:custom] = blacklight_params[:user_value]
11
+ # end
4
12
  end
@@ -0,0 +1,18 @@
1
+ require 'rails_helper'
2
+
3
+ describe <%= model_name.classify %> do
4
+ let(:user_params) { Hash.new }
5
+ let(:blacklight_config) { Blacklight::Configuration.new }
6
+ let(:scope) { double blacklight_config: blacklight_config }
7
+ subject(:search_builder) { described_class.new scope }
8
+
9
+ # describe "my custom step" do
10
+ # subject(:query_parameters) do
11
+ # search_builder.with(user_params).processed_parameters
12
+ # end
13
+ #
14
+ # it "adds my custom data" do
15
+ # expect(query_parameters).to include :custom_data
16
+ # end
17
+ # end
18
+ 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: 6.6.1
4
+ version: 6.6.2
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-09-09 00:00:00.000000000 Z
20
+ date: 2016-09-16 00:00:00.000000000 Z
21
21
  dependencies:
22
22
  - !ruby/object:Gem::Dependency
23
23
  name: rails
@@ -380,7 +380,6 @@ files:
380
380
  - app/controllers/concerns/blacklight/search_helper.rb
381
381
  - app/controllers/concerns/blacklight/search_history.rb
382
382
  - app/controllers/concerns/blacklight/suggest.rb
383
- - app/controllers/concerns/blacklight/suggest_search.rb
384
383
  - app/controllers/concerns/blacklight/token_based_user.rb
385
384
  - app/controllers/saved_searches_controller.rb
386
385
  - app/controllers/search_history_controller.rb
@@ -411,6 +410,7 @@ files:
411
410
  - app/helpers/suggest_helper.rb
412
411
  - app/models/blacklight/facet_paginator.rb
413
412
  - app/models/blacklight/solr/facet_paginator.rb
413
+ - app/models/blacklight/suggest_search.rb
414
414
  - app/models/bookmark.rb
415
415
  - app/models/concerns/blacklight/configurable.rb
416
416
  - app/models/concerns/blacklight/document.rb
@@ -592,6 +592,7 @@ files:
592
592
  - lib/generators/blacklight/templates/config/blacklight.yml
593
593
  - lib/generators/blacklight/templates/config/jetty.yml
594
594
  - lib/generators/blacklight/templates/search_builder.rb
595
+ - lib/generators/blacklight/templates/search_builder_spec.rb
595
596
  - lib/generators/blacklight/templates/solr_document.rb
596
597
  - lib/generators/blacklight/test_support_generator.rb
597
598
  - lib/generators/blacklight/user_generator.rb
@@ -621,7 +622,6 @@ files:
621
622
  - spec/controllers/blacklight/facet_spec.rb
622
623
  - spec/controllers/blacklight/search_fields_spec.rb
623
624
  - spec/controllers/blacklight/search_helper_spec.rb
624
- - spec/controllers/blacklight/suggest_search_spec.rb
625
625
  - spec/controllers/bookmarks_controller_spec.rb
626
626
  - spec/controllers/catalog_controller_spec.rb
627
627
  - spec/controllers/saved_searches_controller_spec.rb
@@ -681,6 +681,7 @@ files:
681
681
  - spec/models/blacklight/solr/response_spec.rb
682
682
  - spec/models/blacklight/solr/search_builder_spec.rb
683
683
  - spec/models/blacklight/suggest/response_spec.rb
684
+ - spec/models/blacklight/suggest_search_spec.rb
684
685
  - spec/models/blacklight/user_spec.rb
685
686
  - spec/models/bookmark_spec.rb
686
687
  - spec/models/record_mailer_spec.rb
@@ -758,7 +759,6 @@ test_files:
758
759
  - spec/controllers/blacklight/facet_spec.rb
759
760
  - spec/controllers/blacklight/search_fields_spec.rb
760
761
  - spec/controllers/blacklight/search_helper_spec.rb
761
- - spec/controllers/blacklight/suggest_search_spec.rb
762
762
  - spec/controllers/bookmarks_controller_spec.rb
763
763
  - spec/controllers/catalog_controller_spec.rb
764
764
  - spec/controllers/saved_searches_controller_spec.rb
@@ -818,6 +818,7 @@ test_files:
818
818
  - spec/models/blacklight/solr/response_spec.rb
819
819
  - spec/models/blacklight/solr/search_builder_spec.rb
820
820
  - spec/models/blacklight/suggest/response_spec.rb
821
+ - spec/models/blacklight/suggest_search_spec.rb
821
822
  - spec/models/blacklight/user_spec.rb
822
823
  - spec/models/bookmark_spec.rb
823
824
  - spec/models/record_mailer_spec.rb