to_spotlight 0.2 → 0.2.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/jobs/to_spotlight/spotlight_transfer_job.rb +13 -6
- data/lib/to_spotlight/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5944a4acea93f3863a6f28ed2c50821e13ab4253f50ee66f375ddd875b960a30
|
4
|
+
data.tar.gz: 1ad10835c8271e17696a5d5ce3de25d96e7d563b731a162ffda1ccbbffc88839
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2d2ebb3fabfc29cd787e25ba28a5af7b2c249de427b60a8b8a3321a99d93250fde1b350d276112c4eb962bbb36efa3df235898f2a10a48e2d1fbff4484c9f3dd
|
7
|
+
data.tar.gz: 599493c82a5051da4cb70db3ab32c66b89a541f6bdca1c17d94abeb9650754a3dfb663aaae82047a3596c2cd67e14e36d80929f51fec789a28e5d84a61db76b2
|
@@ -50,15 +50,22 @@ module ToSpotlight
|
|
50
50
|
File.open(dir.join(filename), 'wb') do |file|
|
51
51
|
file.write(csv_array.join("\n"))
|
52
52
|
end
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
token: 'secret_token' }.to_json,
|
58
|
-
'Content-Type' => 'application/json'
|
53
|
+
res = post_response URI("#{transfer.spotlight_url}/from_hyrax/receive"),
|
54
|
+
csv_url: "https://#{base_url}/uploads/csvs/#{filename}",
|
55
|
+
transfer: transfer.attributes.slice(:user, :exhibit), #only allow user+exhibit
|
56
|
+
token: 'secret_token'
|
59
57
|
|
60
58
|
end
|
61
59
|
|
60
|
+
def post_response uri, options={}
|
61
|
+
http = Net::HTTP.new(uri.host, uri.port)
|
62
|
+
http.use_ssl = true
|
63
|
+
http.verify_mode = OpenSSL::SSL::VERIFY_NONE
|
64
|
+
request = Net::HTTP::Post.new(uri.request_uri, 'Content-Type' => 'application/json')
|
65
|
+
request.body = options.to_json
|
66
|
+
http.request(request)
|
67
|
+
end
|
68
|
+
|
62
69
|
def base_url
|
63
70
|
@base_url ||= ::Account.where(tenant: Apartment::Tenant.current).first.cname
|
64
71
|
end
|
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:
|
4
|
+
version: 0.2.1
|
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-04 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|