blacklight-spotlight 0.10.0 → 0.10.1
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/lib/spotlight/version.rb +1 -1
- data/lib/tasks/spotlight_tasks.rake +11 -2
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: fc539263e3a9dac2f00db698ec1d33a72708aa1b
|
4
|
+
data.tar.gz: 7cca4bc62f988237279e2b31ffbfb692989dc2fb
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b3300b3ac8bd05cb4271334c2748ab979f827cf29db94e893578ae632762508e74eb7210c8adf4096449b2eae2175307e271f66793b0e20d906d7e2c04b3f803
|
7
|
+
data.tar.gz: d45028a75362cfb8a92a16db4e4e9369d353713e708efd322cd0b95f15d19e80b8b820297511c54ce35cc3411005890e0111c5bc568b74f74178438c7bcf35c0
|
data/lib/spotlight/version.rb
CHANGED
@@ -30,7 +30,7 @@ namespace :spotlight do
|
|
30
30
|
end
|
31
31
|
|
32
32
|
desc 'Import an exhibit'
|
33
|
-
task import: :environment do
|
33
|
+
task :import, [:exhibit_slug] => :environment do |_, args|
|
34
34
|
contents = if ENV['FILE']
|
35
35
|
File.read(ENV['FILE'])
|
36
36
|
else
|
@@ -39,7 +39,9 @@ namespace :spotlight do
|
|
39
39
|
|
40
40
|
data = JSON.parse(contents)
|
41
41
|
|
42
|
-
|
42
|
+
slug = args[:exhibit_slug] || data['slug']
|
43
|
+
|
44
|
+
exhibit = Spotlight::Exhibit.find_or_create_by! slug: slug do |e|
|
43
45
|
e.title = data['title']
|
44
46
|
end
|
45
47
|
|
@@ -52,6 +54,13 @@ namespace :spotlight do
|
|
52
54
|
puts Spotlight::ExhibitExportSerializer.new(exhibit.reload).to_json
|
53
55
|
end
|
54
56
|
|
57
|
+
desc 'Export an exhibit as JSON'
|
58
|
+
task :export, [:exhibit_slug] => :environment do |_, args|
|
59
|
+
exhibit = Spotlight::Exhibit.find_by(slug: args[:exhibit_slug])
|
60
|
+
|
61
|
+
puts Spotlight::ExhibitExportSerializer.new(exhibit).to_json
|
62
|
+
end
|
63
|
+
|
55
64
|
def prompt_to_create_user
|
56
65
|
User.find_or_create_by!(email: prompt_for_email) do |u|
|
57
66
|
puts 'User not found. Enter a password to create the user.'
|