blacklight-spotlight 0.10.0 → 0.10.1

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
  SHA1:
3
- metadata.gz: 4477ac2d54b4a5009867cbcff8bdf710b93bee8d
4
- data.tar.gz: 3c274d2b475395ca0f55da0e5c000fe0338b772f
3
+ metadata.gz: fc539263e3a9dac2f00db698ec1d33a72708aa1b
4
+ data.tar.gz: 7cca4bc62f988237279e2b31ffbfb692989dc2fb
5
5
  SHA512:
6
- metadata.gz: 53ac3d47317e9e867604f218abc36bf0995979eefeddfe54090595322e47edae1b3384cb14055293c92f9f0b7d2c146ab9b5478bec2572a69e24c97ec6679f09
7
- data.tar.gz: 551bc13319ac8f7992d78dc82b49e16832500cd7dd9d5a7c2d6c184ad4a25308b5609da8583ff249e29ea5e42aabc75477e16ebb04ae1eccc4a7ad631b008f59
6
+ metadata.gz: b3300b3ac8bd05cb4271334c2748ab979f827cf29db94e893578ae632762508e74eb7210c8adf4096449b2eae2175307e271f66793b0e20d906d7e2c04b3f803
7
+ data.tar.gz: d45028a75362cfb8a92a16db4e4e9369d353713e708efd322cd0b95f15d19e80b8b820297511c54ce35cc3411005890e0111c5bc568b74f74178438c7bcf35c0
@@ -1,4 +1,4 @@
1
1
  #
2
2
  module Spotlight
3
- VERSION = '0.10.0'
3
+ VERSION = '0.10.1'
4
4
  end
@@ -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
- exhibit = Spotlight::Exhibit.find_or_create_by! slug: data['slug'] do |e|
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.'
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: blacklight-spotlight
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.10.0
4
+ version: 0.10.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Chris Beer