blacklight-spotlight 4.6.0 → 4.7.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: cf4c6e80e6610969a1f0c37a27cb1c3e67ada96d4e22b63ef92a84a32d1e4946
4
- data.tar.gz: e03d10a0a4db7fcdab708987cf5be0a50966ed831ece6037a9d3eb8b5fddb022
3
+ metadata.gz: 051b1798794393c2afeb19a83437d9d0bde7c2bd5861a1684b08bb89fe948a51
4
+ data.tar.gz: '058d356020bd76fccf4124dee494114640ecb514ecabe06220a3ad2628ce9510'
5
5
  SHA512:
6
- metadata.gz: a00ff7e056f1839c65c4656b636c5c29fccf1d293ff8d14ba2fc383d5485d12e08f0bf54c57a35d8100533180e61c68df01cce5e2a4461cf6124e98a47b6f566
7
- data.tar.gz: 192e740e4f9fc8d6d08ff5119ecb174789f2f974f07f520b2077f86d4be4af402167b8a82634372f412e3732f16feb87f9b34716017c4cb0c9e6ae725781f633
6
+ metadata.gz: 2489cb7dd18bcd3369a41e0991349617ed3a49adedb9859d79eb9b0938f70f712cf6325c2e9eb48754d2b691f1a1ae6c32e7f3c8393a2083f3984248d166dd6c
7
+ data.tar.gz: a636d0dabffd8633a2a293c8433dada5c3df367512df0232ea366b193300e2828d6e973cc38bc31f7279cf486e1505c77cea8c6c7f5c181adec80dbd6f97f40d
data/Rakefile CHANGED
@@ -19,6 +19,7 @@ end
19
19
  Bundler::GemHelper.install_tasks
20
20
 
21
21
  require 'solr_wrapper'
22
+ require 'open3'
22
23
 
23
24
  require 'rspec/core/rake_task'
24
25
  RSpec::Core::RakeTask.new(:spec)
@@ -30,16 +31,45 @@ require 'engine_cart/rake_task'
30
31
 
31
32
  require 'spotlight/version'
32
33
 
33
- task ci: ['engine_cart:generate'] do
34
- ENV['environment'] = 'test'
34
+ def system_with_error_handling(*args)
35
+ Open3.popen3(*args) do |_stdin, stdout, stderr, thread|
36
+ puts stdout.read
37
+ raise "Unable to run #{args.inspect}: #{stderr.read}" unless thread.value.success?
38
+ end
39
+ end
35
40
 
36
- SolrWrapper.wrap(port: '8983') do |solr|
37
- solr.with_collection(name: 'blacklight-core', dir: 'lib/generators/spotlight/templates/solr/conf') do
38
- Rake::Task['spotlight:fixtures'].invoke
41
+ def with_solr(&block) # rubocop:disable Metrics/MethodLength
42
+ # We're being invoked by the app entrypoint script and solr is already up via docker compose
43
+ if ENV['SOLR_ENV'] == 'docker-compose'
44
+ yield
45
+ elsif system('docker compose version')
46
+ # We're not running `docker compose up' but still want to use a docker instance of solr.
47
+ begin
48
+ puts 'Starting Solr'
49
+ system_with_error_handling 'docker compose up -d solr'
50
+ yield
51
+ ensure
52
+ puts 'Stopping Solr'
53
+ system_with_error_handling 'docker compose stop solr'
54
+ end
55
+ else
56
+ SolrWrapper.wrap do |solr|
57
+ solr.with_collection(&block)
58
+ end
59
+ end
60
+ end
61
+
62
+ task :ci do
63
+ ENV['environment'] = 'test'
39
64
 
40
- # run the tests
41
- Rake::Task['spec'].invoke
65
+ with_solr do
66
+ Rake::Task['spotlight:fixtures'].invoke
67
+ within_test_app do
68
+ system 'bin/rake spec:prepare'
42
69
  end
70
+
71
+ # run the tests
72
+ Rake::Task['spec'].invoke
43
73
  end
44
74
  end
45
75
 
@@ -5137,7 +5137,7 @@ jQuery.fn.scrollStop = function(callback) {
5137
5137
  class Pages {
5138
5138
  connect(){
5139
5139
  SirTrevor.setDefaults({
5140
- iconUrl: Spotlight.sirTrevorIcon,
5140
+ iconUrl: Spotlight.sirTrevorIcon || window.sirTrevorIcon,
5141
5141
  uploadUrl: $('[data-attachment-endpoint]').data('attachment-endpoint'),
5142
5142
  ajaxOptions: {
5143
5143
  headers: {