global_alerts 0.4.0 → 0.5.0
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/README.md +5 -3
- data/app/models/global_alerts/alert.rb +9 -1
- data/config/deploy.rb +24 -0
- data/lib/global_alerts/version.rb +1 -1
- metadata +4 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 22e879a1c0467ca4f34eda7d048b5c45bd882b7310f5ea5f4a505a9fc0d04103
|
4
|
+
data.tar.gz: 891aa27791d7380e01259a8b049f36c5af67ac93a6249bd442f9987fcf355897
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 829dafbb5a2eb497441271db7aa9aa6a1a20f251f9d08c8819a4fe921f7889c9e0cf9744146a8ee6883eb30f0a6776afcc8398e1cac32e501fc99b1b8779a396
|
7
|
+
data.tar.gz: 78c3616de811658997b3fde8916dbbf3a07d327f4e86190ee00e6497c8d242d48f7804036acd186208b2d7958ae2e543071f889305f983e20cc2009c2c210c55
|
data/README.md
CHANGED
@@ -1,6 +1,8 @@
|
|
1
1
|
# GlobalAlerts
|
2
|
-
A gem for managing user-facing alerts across the portfolio.
|
3
|
-
|
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 =
|
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
|
data/config/deploy.rb
ADDED
@@ -0,0 +1,24 @@
|
|
1
|
+
set :application, 'global_alerts'
|
2
|
+
set :repo_url, 'https://github.com/sul-dlss/global_alerts.git'
|
3
|
+
|
4
|
+
# Default deploy_to directory is /var/www/my_app_name
|
5
|
+
set :deploy_to, "/dev/null"
|
6
|
+
|
7
|
+
before "deploy:assets:precompile", "deploy:yarn_install"
|
8
|
+
|
9
|
+
namespace :deploy do
|
10
|
+
desc 'Run rake yarn:install'
|
11
|
+
task :yarn_install do
|
12
|
+
on roles(:web) do
|
13
|
+
within release_path do
|
14
|
+
execute("cd #{release_path} && yarn install")
|
15
|
+
end
|
16
|
+
end
|
17
|
+
end
|
18
|
+
|
19
|
+
after :restart, :restart_sidekiq do
|
20
|
+
on roles(:background) do
|
21
|
+
sudo :systemctl, "restart", "sidekiq-*", raise_on_non_zero_exit: false
|
22
|
+
end
|
23
|
+
end
|
24
|
+
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
|
+
version: 0.5.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:
|
11
|
+
date: 2023-08-08 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|
@@ -91,6 +91,7 @@ files:
|
|
91
91
|
- app/models/global_alerts/alert.rb
|
92
92
|
- app/models/global_alerts/application_record.rb
|
93
93
|
- app/views/global_alerts/_alerts.html.erb
|
94
|
+
- config/deploy.rb
|
94
95
|
- config/initializers/global_alerts_initializer.rb
|
95
96
|
- config/routes.rb
|
96
97
|
- lib/global_alerts.rb
|
@@ -116,7 +117,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
116
117
|
- !ruby/object:Gem::Version
|
117
118
|
version: '0'
|
118
119
|
requirements: []
|
119
|
-
rubygems_version: 3.
|
120
|
+
rubygems_version: 3.4.10
|
120
121
|
signing_key:
|
121
122
|
specification_version: 4
|
122
123
|
summary: SUL global alerts as a service
|