to_spotlight 0.2.2 → 0.2.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/app/controllers/to_spotlight/spotlight_transfer_controller.rb +8 -1
- data/app/views/to_spotlight/spotlight_transfer/approve.html.erb +0 -2
- data/lib/generators/install/install_generator.rb +7 -0
- data/lib/generators/install/templates/config/to_spotlight.yml +1 -0
- data/lib/to_spotlight/version.rb +1 -1
- metadata +4 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 41d9f884bff14e5cc820925183917eec062d99d9171bc06b382262b25272adde
|
4
|
+
data.tar.gz: bb56c9ea7d058a2a788ee68b34a93af767c4d3aacf47fb5583d47db615a3f8c4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e8e1ba2bdf08dabc8c3af5cc9b45c8f6b1ff60da1485a29f632ede1f20d93528fa2e4d62fef2bb24ea50e00a4cfe165a0b4937ab5b814b0b0b7ee0b1e2749929
|
7
|
+
data.tar.gz: 37fea3ff7597b052a60785775239fdbdab410c827a1e3ba16f70d68c04245f72bacb294dad148474c29f6a4f955cedfb2331a6ce211d6919e547e95319380732
|
@@ -1,7 +1,10 @@
|
|
1
1
|
module ToSpotlight
|
2
2
|
class SpotlightTransferController < ActionController::Base
|
3
3
|
protect_from_forgery with: :exception
|
4
|
+
before_action :authenticate_user!
|
4
5
|
skip_before_action :verify_authenticity_token, only: :receive
|
6
|
+
layout 'hyrax/dashboard' if Hyrax
|
7
|
+
before_action :authenticate, except: :index
|
5
8
|
require 'json'
|
6
9
|
require 'net/http'
|
7
10
|
|
@@ -20,7 +23,7 @@ module ToSpotlight
|
|
20
23
|
end
|
21
24
|
|
22
25
|
def receive
|
23
|
-
return unless params[:token]
|
26
|
+
return unless params[:token] == token
|
24
27
|
@transfer = ToSpotlight::SpotlightTransfer.new get_transfer_attributes
|
25
28
|
@transfer.mappings = params[:mappings]
|
26
29
|
if @transfer.save
|
@@ -50,6 +53,10 @@ module ToSpotlight
|
|
50
53
|
|
51
54
|
private
|
52
55
|
|
56
|
+
def token
|
57
|
+
ToSpotlight::Engine.config['hyrax_instances']
|
58
|
+
end
|
59
|
+
|
53
60
|
def mapping_invert(hash)
|
54
61
|
result = []
|
55
62
|
test = hash.map { |h| {h['hyrax'] => h['spotlight'].values} }
|
@@ -0,0 +1,7 @@
|
|
1
|
+
class CdmMigrator::InstallGenerator < Rails::Generators::Base
|
2
|
+
source_root File.expand_path('../templates', __FILE__)
|
3
|
+
|
4
|
+
def inject_content_dm_yml
|
5
|
+
copy_file('config/to_spotlight.yml', 'config/to_spotlight.yml') unless File.file?('config/to_spotlight.yml')
|
6
|
+
end
|
7
|
+
end
|
@@ -0,0 +1 @@
|
|
1
|
+
secret_token: 'rftvgyuhwefhcgyvuryweudijxoschdufygvebhqwdijloschvugbeiofhqdijlcnhqeljcmjioeql328r9hdfec3h'
|
data/lib/to_spotlight/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: to_spotlight
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- sephirothkod
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-05-
|
11
|
+
date: 2020-05-05 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|
@@ -72,6 +72,8 @@ files:
|
|
72
72
|
- config/application.rb
|
73
73
|
- config/routes.rb
|
74
74
|
- db/migrate/20200310153953_create_to_spotlight_spotlight_transfers.rb
|
75
|
+
- lib/generators/install/install_generator.rb
|
76
|
+
- lib/generators/install/templates/config/to_spotlight.yml
|
75
77
|
- lib/tasks/to_spotlight_tasks.rake
|
76
78
|
- lib/to_spotlight.rb
|
77
79
|
- lib/to_spotlight/engine.rb
|