ddr-models 2.3.2 → 2.4.0.rc1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.travis.yml +2 -3
- data/ddr-models.gemspec +1 -1
- data/lib/ddr/auth.rb +10 -6
- data/lib/ddr/auth/group.rb +2 -1
- data/lib/ddr/auth/grouper_gateway.rb +7 -6
- data/lib/ddr/auth/permissions.rb +2 -1
- data/lib/ddr/auth/roles.rb +3 -2
- data/lib/ddr/auth/roles/role_set.rb +3 -2
- data/lib/ddr/datastreams/administrative_metadata_datastream.rb +3 -0
- data/lib/ddr/derivatives/png_generator.rb +1 -1
- data/lib/ddr/index/fields.rb +11 -1
- data/lib/ddr/index/filter.rb +4 -3
- data/lib/ddr/index/legacy_license_fields.rb +0 -2
- data/lib/ddr/index/query_clause.rb +2 -2
- data/lib/ddr/index/query_value.rb +6 -3
- data/lib/ddr/jobs.rb +5 -1
- data/lib/ddr/jobs/fits_file_characterization.rb +2 -40
- data/lib/ddr/jobs/fixity_check.rb +13 -0
- data/lib/ddr/jobs/job.rb +36 -0
- data/lib/ddr/jobs/queue.rb +27 -0
- data/lib/ddr/jobs/update_index.rb +13 -0
- data/lib/ddr/managers/derivatives_manager.rb +21 -17
- data/lib/ddr/models.rb +14 -2
- data/lib/ddr/models/access_controllable.rb +3 -6
- data/lib/ddr/models/admin_set.rb +5 -3
- data/lib/ddr/models/base.rb +2 -3
- data/lib/ddr/models/contact.rb +17 -0
- data/lib/ddr/models/file_characterization.rb +37 -0
- data/lib/ddr/models/has_admin_metadata.rb +2 -1
- data/lib/ddr/models/has_content.rb +4 -2
- data/lib/ddr/models/indexing.rb +5 -0
- data/lib/ddr/models/licenses/license.rb +5 -3
- data/lib/ddr/models/solr_document.rb +1 -1
- data/lib/ddr/models/version.rb +1 -1
- data/lib/ddr/models/with_content_file.rb +37 -0
- data/lib/ddr/vocab/asset.rb +3 -0
- data/spec/derivatives/png_generator_spec.rb +7 -0
- data/spec/factories/test_model_factories.rb +1 -1
- data/spec/fixtures/arrow1rightred_e0.gif +0 -0
- data/spec/fixtures/bird.jpg +0 -0
- data/spec/index/query_value_spec.rb +33 -0
- data/spec/jobs/fits_file_characterization_spec.rb +8 -44
- data/spec/jobs/fixity_check_spec.rb +22 -0
- data/spec/jobs/job_spec.rb +40 -0
- data/spec/jobs/update_index_spec.rb +22 -0
- data/spec/managers/derivatives_manager_spec.rb +16 -12
- data/spec/models/admin_set_spec.rb +3 -3
- data/spec/models/contact_spec.rb +22 -0
- data/spec/models/effective_license_spec.rb +17 -7
- data/spec/models/file_characterization_spec.rb +39 -0
- data/spec/models/has_admin_metadata_spec.rb +8 -5
- data/spec/models/indexing_spec.rb +2 -0
- data/spec/models/license_spec.rb +3 -1
- data/spec/models/solr_document_spec.rb +6 -3
- data/spec/models/with_content_file_spec.rb +37 -0
- data/spec/spec_helper.rb +2 -0
- metadata +43 -30
- data/lib/ddr/contacts.rb +0 -25
- data/lib/ddr/index_fields.rb +0 -14
- data/spec/auth/ldap_gateway_spec.rb +0 -9
- data/spec/contacts/contacts_spec.rb +0 -26
data/lib/ddr/contacts.rb
DELETED
@@ -1,25 +0,0 @@
|
|
1
|
-
module Ddr
|
2
|
-
module Contacts
|
3
|
-
extend ActiveSupport::Autoload
|
4
|
-
|
5
|
-
class << self
|
6
|
-
attr_accessor :contacts
|
7
|
-
end
|
8
|
-
|
9
|
-
def self.get(contact_slug)
|
10
|
-
load_contacts unless contacts
|
11
|
-
contacts[contact_slug]
|
12
|
-
end
|
13
|
-
|
14
|
-
def self.load_contacts
|
15
|
-
self.contacts = OpenStruct.new
|
16
|
-
contacts_file = File.join(Rails.root, 'config', 'contacts.yml')
|
17
|
-
YAML.load_file(contacts_file).each do |key, value|
|
18
|
-
contacts[key] = OpenStruct.new(value.merge('slug' => key))
|
19
|
-
end
|
20
|
-
rescue SystemCallError
|
21
|
-
Rails.logger.warn("Unable to load Contacts file: #{contacts_file}")
|
22
|
-
end
|
23
|
-
|
24
|
-
end
|
25
|
-
end
|
data/lib/ddr/index_fields.rb
DELETED
@@ -1,14 +0,0 @@
|
|
1
|
-
module Ddr
|
2
|
-
module IndexFields
|
3
|
-
|
4
|
-
warn "[DEPRECATION] `Ddr::IndexFields` is deprecated and will be removed in ddr-models 3.0." \
|
5
|
-
" Use `Ddr::Index::Fields` instead."
|
6
|
-
|
7
|
-
include Ddr::Index::Fields
|
8
|
-
|
9
|
-
def self.get(name)
|
10
|
-
Ddr::Index::Fields.get(name)
|
11
|
-
end
|
12
|
-
|
13
|
-
end
|
14
|
-
end
|
@@ -1,26 +0,0 @@
|
|
1
|
-
require 'spec_helper'
|
2
|
-
|
3
|
-
module Ddr
|
4
|
-
RSpec.describe Contacts, contacts: true do
|
5
|
-
|
6
|
-
before do
|
7
|
-
allow(YAML).to receive(:load_file) { { 'a' => { 'name' => 'Contact A', 'short_name' => 'A' },
|
8
|
-
'b' => { 'name' => 'Contact B', 'short_name' => 'B' } } }
|
9
|
-
Contacts.load_contacts
|
10
|
-
end
|
11
|
-
|
12
|
-
describe "load_contacts" do
|
13
|
-
it "should load the contacts" do
|
14
|
-
expect(Contacts.contacts.to_h).to_not be_empty
|
15
|
-
end
|
16
|
-
end
|
17
|
-
|
18
|
-
describe "get" do
|
19
|
-
it "should return the appropriate contact" do
|
20
|
-
expect(Contacts.get('a').name).to eq('Contact A')
|
21
|
-
expect(Contacts.get('b').name).to eq('Contact B')
|
22
|
-
end
|
23
|
-
end
|
24
|
-
|
25
|
-
end
|
26
|
-
end
|