blacklight_advanced_search 6.0.0 → 6.0.1

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: f2ca7a7c57ac86d4f3c0dc385ef79561af1c1737
4
- data.tar.gz: ed73c2995b52f221b639d0840ee2caef4f90fbb7
3
+ metadata.gz: 656aa169eecd81150115fea2e617b2d345676709
4
+ data.tar.gz: 70d003ffa0d3e363ad54d0e0b5b5a87c15ebcd72
5
5
  SHA512:
6
- metadata.gz: d8dd353a79541d70fe0d026fb69d12c6957921c2805955533b2b0e181bd426a5ec0ce65f3e1feb06b7a1b9756a10ea364d1481f821127d0e91427ac187aad914
7
- data.tar.gz: 17af4c42eb38f9649659c9667150c9a50a7bca920ce077fdaed12d90d7357be0ad3ca1aa0fd560dbd8c2ea695c340cef25d4ae9e2f342088dbb56afa484e4d7e
6
+ metadata.gz: 5ae65b233d287eab9f15e21f711b7eda5a464e1875a40404e2ee12cd98440bfb8884a136313dcfe192ce14ea22c61f14f08525a49645e7f207a74f7c92f56f9f
7
+ data.tar.gz: 76ececeffd3c0b342a9cb336ae03c5c032135cc1c9e12b56fd04e6816cf4ac222e00aef291ae6556c646396a0ff9db9e59474c2f514d6baf4afa23d43b2df11e
data/VERSION CHANGED
@@ -1 +1 @@
1
- 6.0.0
1
+ 6.0.1
@@ -17,7 +17,7 @@ Gem::Specification.new do |s|
17
17
  s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
18
18
  s.require_paths = ["lib"]
19
19
 
20
- s.add_dependency 'blacklight', '> 6.0.0.pre', '< 7'
20
+ s.add_dependency 'blacklight', '~> 6.0.1'
21
21
  s.add_dependency "parslet"
22
22
 
23
23
  s.add_development_dependency "rails"
@@ -6,13 +6,6 @@ module BlacklightAdvancedSearch::Controller
6
6
  extend ActiveSupport::Concern
7
7
 
8
8
  included do
9
- # default advanced config values
10
- blacklight_config.advanced_search ||= Blacklight::OpenStructWithHashAccess.new
11
- #blacklight_config.advanced_search[:qt] ||= 'advanced'
12
- blacklight_config.advanced_search[:url_key] ||= 'advanced'
13
- blacklight_config.advanced_search[:query_parser] ||= 'dismax'
14
- blacklight_config.advanced_search[:form_solr_parameters] ||= {}
15
-
16
9
  # Display advanced search constraints properly
17
10
  helper BlacklightAdvancedSearch::RenderConstraintsOverride
18
11
  helper BlacklightAdvancedSearch::CatalogHelperOverride
@@ -2,40 +2,5 @@ require 'blacklight'
2
2
 
3
3
  module BlacklightAdvancedSearch
4
4
  class Engine < Rails::Engine
5
-
6
- # Do these things in a to_prepare block, to try and make them work
7
- # in development mode with class-reloading. The trick is we can't
8
- # be sure if the controllers we're modifying are being reloaded in
9
- # dev mode, if they are in the BL plugin and haven't been copied to
10
- # local, they won't be. But we do our best.
11
- config.to_prepare do
12
-
13
-
14
-
15
- # Ordinary module over-ride to CatalogController
16
- CatalogController.send(:include,
17
- BlacklightAdvancedSearch::Controller
18
- ) unless
19
- CatalogController.include?(
20
- BlacklightAdvancedSearch::Controller
21
- )
22
-
23
-
24
-
25
- SearchHistoryController.send(:helper,
26
- BlacklightAdvancedSearch::RenderConstraintsOverride
27
- ) unless
28
- SearchHistoryController.helpers.is_a?(
29
- BlacklightAdvancedSearch::RenderConstraintsOverride
30
- )
31
-
32
- SavedSearchesController.send(:helper,
33
- BlacklightAdvancedSearch::RenderConstraintsOverride
34
- ) unless
35
- SearchHistoryController.helpers.is_a?(
36
- BlacklightAdvancedSearch::RenderConstraintsOverride
37
- )
38
-
39
- end
40
5
  end
41
6
  end
@@ -15,6 +15,31 @@ module BlacklightAdvancedSearch
15
15
  end
16
16
  end
17
17
 
18
+ def install_catalog_controller_mixin
19
+ inject_into_class "app/controllers/catalog_controller.rb", "CatalogController" do
20
+ " include BlacklightAdvancedSearch::Controller\n"
21
+ end
22
+ end
23
+
24
+ def configuration
25
+ inject_into_file 'app/controllers/catalog_controller.rb', after: "configure_blacklight do |config|" do
26
+ "\n # default advanced config values" \
27
+ "\n config.advanced_search ||= Blacklight::OpenStructWithHashAccess.new" \
28
+ "\n # config.advanced_search[:qt] ||= 'advanced'" \
29
+ "\n config.advanced_search[:url_key] ||= 'advanced'" \
30
+ "\n config.advanced_search[:query_parser] ||= 'dismax'" \
31
+ "\n config.advanced_search[:form_solr_parameters] ||= {}\n"
32
+ end
33
+ end
34
+
35
+ def install_search_history_controller
36
+ copy_file "search_history_controller.rb", "app/controllers/search_history_controller.rb"
37
+ end
38
+
39
+ def install_saved_searches_controller
40
+ copy_file "saved_searches_controller.rb", "app/controllers/saved_searches_controller.rb"
41
+ end
42
+
18
43
  def inject_routes
19
44
  inject_into_file 'config/routes.rb', after: /mount Blacklight::Engine.*$/ do
20
45
  "\n mount BlacklightAdvancedSearch::Engine => '/'\n"
@@ -0,0 +1,6 @@
1
+ # frozen_string_literal: true
2
+ class SavedSearchesController < ApplicationController
3
+ include Blacklight::SavedSearches
4
+
5
+ helper BlacklightAdvancedSearch::RenderConstraintsOverride
6
+ end
@@ -0,0 +1,6 @@
1
+ # frozen_string_literal: true
2
+ class SearchHistoryController < ApplicationController
3
+ include Blacklight::SearchHistory
4
+
5
+ helper BlacklightAdvancedSearch::RenderConstraintsOverride
6
+ end
@@ -1,25 +1,33 @@
1
1
  class CatalogController < ApplicationController
2
2
  include Blacklight::Catalog
3
+ include BlacklightAdvancedSearch::Controller
3
4
 
4
5
  configure_blacklight do |config|
5
- config.default_solr_params = {
6
- :qt => 'search',
7
- :rows => 10
8
- }
6
+ # default advanced config values
7
+ config.advanced_search ||= Blacklight::OpenStructWithHashAccess.new
8
+ # config.advanced_search[:qt] ||= 'advanced'
9
+ config.advanced_search[:url_key] ||= 'advanced'
10
+ config.advanced_search[:query_parser] ||= 'dismax'
11
+ config.advanced_search[:form_solr_parameters] ||= {}
9
12
 
10
- config.add_facet_field 'language_facet'
13
+ config.default_solr_params = {
14
+ :qt => 'search',
15
+ :rows => 10
16
+ }
11
17
 
12
- config.add_search_field('title') do |field|
13
- field.solr_local_parameters = { :qf => "title_t", :pf => "title_t"}
14
- end
18
+ config.add_facet_field 'language_facet'
15
19
 
16
- config.add_search_field('author') do |field|
17
- field.solr_local_parameters = { :qf => "author_t", :pf => "author_t"}
18
- end
20
+ config.add_search_field('title') do |field|
21
+ field.solr_local_parameters = { :qf => "title_t", :pf => "title_t"}
22
+ end
23
+
24
+ config.add_search_field('author') do |field|
25
+ field.solr_local_parameters = { :qf => "author_t", :pf => "author_t"}
26
+ end
19
27
 
20
- config.add_search_field('dummy_field') do |field|
21
- field.include_in_advanced_search = false
22
- field.solr_local_parameters = { :qf => "author_t", :pf => "author_t"}
23
- end
28
+ config.add_search_field('dummy_field') do |field|
29
+ field.include_in_advanced_search = false
30
+ field.solr_local_parameters = { :qf => "author_t", :pf => "author_t"}
24
31
  end
25
- end
32
+ end
33
+ end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: blacklight_advanced_search
3
3
  version: !ruby/object:Gem::Version
4
- version: 6.0.0
4
+ version: 6.0.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jonathan Rochkind
@@ -9,28 +9,22 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2016-01-22 00:00:00.000000000 Z
12
+ date: 2016-01-30 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: blacklight
16
16
  requirement: !ruby/object:Gem::Requirement
17
17
  requirements:
18
- - - ">"
19
- - !ruby/object:Gem::Version
20
- version: 6.0.0.pre
21
- - - "<"
18
+ - - "~>"
22
19
  - !ruby/object:Gem::Version
23
- version: '7'
20
+ version: 6.0.1
24
21
  type: :runtime
25
22
  prerelease: false
26
23
  version_requirements: !ruby/object:Gem::Requirement
27
24
  requirements:
28
- - - ">"
29
- - !ruby/object:Gem::Version
30
- version: 6.0.0.pre
31
- - - "<"
25
+ - - "~>"
32
26
  - !ruby/object:Gem::Version
33
- version: '7'
27
+ version: 6.0.1
34
28
  - !ruby/object:Gem::Dependency
35
29
  name: parslet
36
30
  requirement: !ruby/object:Gem::Requirement
@@ -164,6 +158,8 @@ files:
164
158
  - lib/generators/blacklight_advanced_search/blacklight_advanced_search_generator.rb
165
159
  - lib/generators/blacklight_advanced_search/install_generator.rb
166
160
  - lib/generators/blacklight_advanced_search/templates/advanced_controller.rb
161
+ - lib/generators/blacklight_advanced_search/templates/saved_searches_controller.rb
162
+ - lib/generators/blacklight_advanced_search/templates/search_history_controller.rb
167
163
  - lib/parsing_nesting/Readme.rdoc
168
164
  - lib/parsing_nesting/grammar.rb
169
165
  - lib/parsing_nesting/tree.rb