global_alerts 0.4.0 → 0.6.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: 6007837f7de40972e221132425424184910e894b42964fa812ac0e0780aff32f
4
- data.tar.gz: a3f606c12ae564f17cc4df240126abf848441e13656b518312e8f6947438b817
3
+ metadata.gz: 4d62dce25855a93dec11062c635a536a82246ff929334c5a8c06b6c1f7a30fe1
4
+ data.tar.gz: c15e507cc7b56c92c8e7b930f531c7bd2f76ddbf9e08b61ae68abe0919677529
5
5
  SHA512:
6
- metadata.gz: 2545b85c009f505403b7772daceac3fdbda17e968a61950b5869cf9021132515ab8287ce5de24e9b51d286ec408c8abb38a5293f858a8ebd41423024c106b2ab
7
- data.tar.gz: 9e04a6d7f03bc4885af220c5ea6b421f2ed15e192ab9c2109b48607496137d2d044fd40ddf1f88b5d04a069de9b99ef78c866ea7f9f0fd5a45b8019b92b04905
6
+ metadata.gz: 79ca531a047a821b0f1691d6ecb4b80d7ae7bcb6685082cdd3519db52f09f4bce21d0985ed262957f5e4ee50d4089ef78d922aea07bac37dc2032bb161eaa163
7
+ data.tar.gz: a4b466971569083b05df4d14e282e57cea6b034741fbeed669d106242c36fba427d343d3c354abc657ff268970ebf8b861be082d51c13ae713230b80f081c072
data/README.md CHANGED
@@ -1,6 +1,8 @@
1
1
  # GlobalAlerts
2
- A gem for managing user-facing alerts across the portfolio.
3
- ⚠️[See current alerts](https://github.com/sul-dlss/global_alerts/blob/main/sul.yaml)
2
+ A gem for managing user-facing alerts across the portfolio.
3
+
4
+ * ⚠️[See current alerts](https://github.com/sul-dlss/global_alerts/blob/main/sul.yaml)
5
+ * [Documentation for SUL OEG](https://docs.google.com/document/d/1J3V6lHKdYXynr1gNYgbQtuTeNPCHy64osxiO1-cR62g/edit#heading=h.jxru3xp3fpto)
4
6
 
5
7
  ## Usage
6
8
 
@@ -58,7 +60,7 @@ alerts:
58
60
  #### `application_name`
59
61
  ```
60
62
  alerts:
61
- - application_name: 'MyLibrary
63
+ - application_name: 'MyLibrary'
62
64
  html: This message will appear on MyLibrary until manually removed.
63
65
  - html: This alert will appear on all other applications with GLOBAL_ALERTS enabled
64
66
  ```
@@ -6,6 +6,14 @@ module GlobalAlerts
6
6
 
7
7
  CACHE_KEY = 'global-alerts'
8
8
 
9
+ def self.global_alert_time
10
+ @global_alert_time || Time.zone.now
11
+ end
12
+
13
+ def self.global_alert_time=(time)
14
+ @global_alert_time = time
15
+ end
16
+
9
17
  def self.all
10
18
  return to_enum(:all) unless block_given?
11
19
 
@@ -25,7 +33,7 @@ module GlobalAlerts
25
33
  []
26
34
  end
27
35
 
28
- def self.active(time = Time.zone.now)
36
+ def self.active(time = GlobalAlerts::Alert.global_alert_time)
29
37
  active_alert = all.find do |alert|
30
38
  alert.active?(time: time, for_application: GlobalAlerts::Engine.config.application_name)
31
39
  end
@@ -1,3 +1,3 @@
1
1
  module GlobalAlerts
2
- VERSION = '0.4.0'
2
+ VERSION = '0.6.0'
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: global_alerts
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.0
4
+ version: 0.6.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Chris Beer
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-03-09 00:00:00.000000000 Z
11
+ date: 2024-01-09 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -16,20 +16,20 @@ dependencies:
16
16
  requirements:
17
17
  - - ">="
18
18
  - !ruby/object:Gem::Version
19
- version: '5.0'
19
+ version: '6.1'
20
20
  - - "<"
21
21
  - !ruby/object:Gem::Version
22
- version: '7.1'
22
+ version: '7.2'
23
23
  type: :runtime
24
24
  prerelease: false
25
25
  version_requirements: !ruby/object:Gem::Requirement
26
26
  requirements:
27
27
  - - ">="
28
28
  - !ruby/object:Gem::Version
29
- version: '5.0'
29
+ version: '6.1'
30
30
  - - "<"
31
31
  - !ruby/object:Gem::Version
32
- version: '7.1'
32
+ version: '7.2'
33
33
  - !ruby/object:Gem::Dependency
34
34
  name: http
35
35
  requirement: !ruby/object:Gem::Requirement
@@ -116,7 +116,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
116
116
  - !ruby/object:Gem::Version
117
117
  version: '0'
118
118
  requirements: []
119
- rubygems_version: 3.2.32
119
+ rubygems_version: 3.4.20
120
120
  signing_key:
121
121
  specification_version: 4
122
122
  summary: SUL global alerts as a service