ddr-core 1.13.0 → 1.14.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: 7f1841e5ee3adc06edb3fd81c96df0e290ee3745950a87f444f068dc5c48aff4
4
- data.tar.gz: 2f8eae3c291037d51c8053328aa860518252bbff522adc75e928149c971ff585
3
+ metadata.gz: 53d2fd63ff8f0136a18a83652020f4526920e89c43ec0fde26147387296c4e58
4
+ data.tar.gz: 91f74125381a24004a6869db16c30276ac527a891db9e70bfb1bd445a3b2fc46
5
5
  SHA512:
6
- metadata.gz: b595d3c404aae7945c7b7cca2f3bf3a5abfecd0c4bb764d6f80aee27a16a0fad86329e653a9479c8dbd41c58f5e1881b35d9b0a71b351835bb1a4b3c8a6d70fd
7
- data.tar.gz: e2a64a032a93c1730db2a5bcbce45bfb970f008d9d74b4ee26e89e5d5c456316cc042b88dd5781f54fc26e46ca49a383b75a5c0c9cb6990766e9235cca4e9727
6
+ metadata.gz: 3b812fed3b28c4e937c9829d0e3f88eb456328a113d26772432f4a694a74016c21a323b4ca49fad0c348e985c56c2030ff7c2dd4e209fb79dd11144c3f881b11
7
+ data.tar.gz: 19d773e6676b07d42c12c3cb51e19341aa0edfdeeebee92ef7ffad6aa1d5da87574b05de0680a17247bf5c9405610e3c3dac688beef38c64122d1c2a29325ce9
@@ -9,6 +9,10 @@ module Ddr
9
9
  @keystore ||= Hash[config.map { |entry| [entry['code'], new(entry).freeze] }].freeze
10
10
  end
11
11
 
12
+ def self.all
13
+ keystore.values
14
+ end
15
+
12
16
  def self.call(obj)
13
17
  find_by_code(obj.admin_set)
14
18
  end
@@ -1,6 +1,8 @@
1
1
  module Ddr
2
2
  class Alert < AuxiliaryResource
3
3
 
4
+ warn '[DEPRECATION] Ddr::Alert is deprecated and will be removed in ddr-core v2.0.0'
5
+
4
6
  ADMIN_SITE = 'admin'
5
7
  PUBLIC_SITE = 'public'
6
8
 
@@ -6,16 +6,18 @@ module Ddr
6
6
  #
7
7
  class AuxiliaryResource < ActiveResource::Base
8
8
 
9
+ warn '[DEPRECATION] Ddr::AuxiliaryResource is deprecated and will be removed from ddr-core 2.0'
10
+
9
11
  # ActiveResource freezes `site` in subclasses
10
12
  self.site = Ddr.ddr_aux_api_url
11
13
 
12
14
  class_attribute :cache_expiry, instance_accessor: false
13
15
  self.cache_expiry = 1.hour
14
-
16
+
15
17
  def self.fetch(value_key, &block)
16
18
  Rails.cache.fetch(cache_key(value_key), expires_in: cache_expiry, &block)
17
19
  end
18
-
20
+
19
21
  def self.cache_key(suffix)
20
22
  [ model_name.cache_key, suffix ].join('/')
21
23
  end
@@ -9,6 +9,10 @@ module Ddr
9
9
  @keystore ||= Hash[config.map { |entry| [entry['slug'], new(entry).freeze] }].freeze
10
10
  end
11
11
 
12
+ def self.all
13
+ keystore.values
14
+ end
15
+
12
16
  def self.call(slug)
13
17
  keystore.fetch(slug)
14
18
 
@@ -9,6 +9,10 @@ module Ddr
9
9
  @keystore ||= Hash[config.map { |entry| [entry['code'], new(entry).freeze] }].freeze
10
10
  end
11
11
 
12
+ def self.all
13
+ keystore.values
14
+ end
15
+
12
16
  def self.call(obj)
13
17
  obj.language.map { |lang| find_by_code(lang) }
14
18
  end
@@ -9,6 +9,10 @@ module Ddr
9
9
  @keystore ||= Hash[config.map { |entry| [entry['url'], new(entry).freeze] }].freeze
10
10
  end
11
11
 
12
+ def self.all
13
+ keystore.values
14
+ end
15
+
12
16
  def self.call(obj)
13
17
  return if obj.rights.empty?
14
18
 
data/lib/ddr/core.rb CHANGED
@@ -109,6 +109,8 @@ module Ddr
109
109
  end
110
110
 
111
111
  mattr_accessor :ddr_aux_api_url do
112
+ warn '[DEPRECATION] Ddr.ddr_aux_api_url is deprecated and will be removed from ddr-core 2.0'
113
+
112
114
  ENV["DDR_AUX_API_URL"]
113
115
  end
114
116
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ddr-core
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.13.0
4
+ version: 1.14.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jim Coble
@@ -11,7 +11,7 @@ authors:
11
11
  autorequire:
12
12
  bindir: bin
13
13
  cert_chain: []
14
- date: 2022-04-28 00:00:00.000000000 Z
14
+ date: 2022-05-31 00:00:00.000000000 Z
15
15
  dependencies:
16
16
  - !ruby/object:Gem::Dependency
17
17
  name: activeresource
@@ -451,7 +451,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
451
451
  - !ruby/object:Gem::Version
452
452
  version: '0'
453
453
  requirements: []
454
- rubygems_version: 3.3.12
454
+ rubygems_version: 3.3.14
455
455
  signing_key:
456
456
  specification_version: 4
457
457
  summary: Models used in the Duke Digital Repository