blacklight 6.19.2 → 6.20.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
  SHA256:
3
- metadata.gz: 29725d7ac098fe4dfcdadceabf7b03066f14c680a9af21afa54191d643e87e7a
4
- data.tar.gz: e36bfb2a98c4eccdd1368f8a06a7a377e5fa5f1d3282a48384e31470148b3c50
3
+ metadata.gz: 469ca5ef4136d32bb5afe11a51dc7eeec97c6b0eded26f0e2d1a9c607fa175a1
4
+ data.tar.gz: 7061a8348a91417bffdacb4f7f508e3f1cba134d754ca1cbbe33743229e09e31
5
5
  SHA512:
6
- metadata.gz: f00f3c5c21af357d7c695888835a92a7ca63ca361fdb670fee07254f69a444fca4bc6d7d0ccd396bb871346eabc6ef6015c82d4dbadd81c1a3e7ccb584f56545
7
- data.tar.gz: 4f06db656530cb3b32364815ae24fff6c4ddcd8fe12373e08d6088b263025b9acb292c616ac45377ba43f96dbb6230875e98553fe4c7bd87b5f18f5819557a92
6
+ metadata.gz: 6427d562139eb605f5bd5e53d61a9f13abb2a1c35430fc20e21fc8e3a3035f8b7c6c2a9f8b72449db2a6478410a64cd1031ed7e17e42611ceb3be0ebe1b65fa9
7
+ data.tar.gz: c0a27859a10d9c1a97bc2f16794d000b407704146f543aec1acd77fe714626e4ce6cc8e2d93be9d7d066ddb4bccf2faaf84107d5dc9e9266f69c3fcb9bec8566
data/VERSION CHANGED
@@ -1 +1 @@
1
- 6.19.2
1
+ 6.20.0
@@ -7,7 +7,7 @@ Blacklight::Engine.routes.draw do
7
7
  put "saved_searches/save/:id", :to => "saved_searches#save", :as => "save_search"
8
8
  delete "saved_searches/forget/:id", :to => "saved_searches#forget", :as => "forget_search"
9
9
  post "saved_searches/forget/:id", :to => "saved_searches#forget"
10
- post "/catalog/:id/track", to: 'catalog#track', as: 'track_search_context'
10
+ post "/catalog/:id/track", to: 'catalog#track', as: 'track_search_context', constraints: { id: Blacklight::Engine.config.routes.identifier_constraint }
11
11
 
12
12
  resources :suggest, only: :index, defaults: { format: 'json' }
13
13
  end
@@ -7,7 +7,7 @@ module Blacklight
7
7
  require 'twitter-typeahead-rails'
8
8
 
9
9
  # BlacklightHelper is needed by all helpers, so we inject it
10
- # into action view base here.
10
+ # into action view base here.
11
11
  initializer 'blacklight.helpers' do |app|
12
12
  ActionView::Base.send :include, BlacklightHelper
13
13
  end
@@ -43,8 +43,12 @@ module Blacklight
43
43
  'Cricket' => 'mms.mycricket.com'
44
44
  }
45
45
 
46
+ config.routes = OpenStruct.new
47
+ # Set identifier_constraint to enforce a format for the document identifiers
48
+ config.routes.identifier_constraint = /[\w-]+/
49
+
46
50
  config.bookmarks_http_method = :post
47
-
51
+
48
52
  config.email_regexp = defined?(Devise) ? Devise.email_regexp : /\A[^@\s]+@[^@\s]+\z/
49
53
  end
50
54
  end
@@ -21,6 +21,22 @@ describe "Routing" do
21
21
  end
22
22
  end
23
23
 
24
+ describe 'tracking' do
25
+ context 'when the routing constraint is set to allow periods' do
26
+ before do
27
+ if Rails.version < '5.2.0'
28
+ skip 'requires https://github.com/rails/rails/pull/22435'
29
+ end
30
+ allow(Blacklight::Engine.config.routes).to receive(:identifier_constraint).and_return(%r{[^/]+})
31
+ Rails.application.reload_routes!
32
+ end
33
+
34
+ it 'routes to #track' do
35
+ expect(post('/catalog/gallica.bnf.fr/track')).to route_to('catalog#track', id: 'gallica.bnf.fr')
36
+ end
37
+ end
38
+ end
39
+
24
40
 
25
41
  describe "solr_document_path for SolrDocument", :test => true do
26
42
  it "routes correctly" do
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.19.2
4
+ version: 6.20.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: 2019-01-11 00:00:00.000000000 Z
20
+ date: 2019-03-11 00:00:00.000000000 Z
21
21
  dependencies:
22
22
  - !ruby/object:Gem::Dependency
23
23
  name: rails