global_alerts 0.3.1 → 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/Rakefile +0 -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 +20 -5
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
|
```
|
data/Rakefile
CHANGED
@@ -14,9 +14,6 @@ RDoc::Task.new(:rdoc) do |rdoc|
|
|
14
14
|
rdoc.rdoc_files.include('lib/**/*.rb')
|
15
15
|
end
|
16
16
|
|
17
|
-
APP_RAKEFILE = File.expand_path("test/dummy/Rakefile", __dir__)
|
18
|
-
load 'rails/tasks/engine.rake'
|
19
|
-
|
20
17
|
load 'rails/tasks/statistics.rake'
|
21
18
|
|
22
19
|
require 'bundler/gem_tasks'
|
@@ -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
|
@@ -19,7 +19,7 @@ dependencies:
|
|
19
19
|
version: '5.0'
|
20
20
|
- - "<"
|
21
21
|
- !ruby/object:Gem::Version
|
22
|
-
version: '7'
|
22
|
+
version: '7.1'
|
23
23
|
type: :runtime
|
24
24
|
prerelease: false
|
25
25
|
version_requirements: !ruby/object:Gem::Requirement
|
@@ -29,7 +29,7 @@ dependencies:
|
|
29
29
|
version: '5.0'
|
30
30
|
- - "<"
|
31
31
|
- !ruby/object:Gem::Version
|
32
|
-
version: '7'
|
32
|
+
version: '7.1'
|
33
33
|
- !ruby/object:Gem::Dependency
|
34
34
|
name: http
|
35
35
|
requirement: !ruby/object:Gem::Requirement
|
@@ -58,6 +58,20 @@ dependencies:
|
|
58
58
|
- - ">="
|
59
59
|
- !ruby/object:Gem::Version
|
60
60
|
version: '0'
|
61
|
+
- !ruby/object:Gem::Dependency
|
62
|
+
name: combustion
|
63
|
+
requirement: !ruby/object:Gem::Requirement
|
64
|
+
requirements:
|
65
|
+
- - ">="
|
66
|
+
- !ruby/object:Gem::Version
|
67
|
+
version: '0'
|
68
|
+
type: :development
|
69
|
+
prerelease: false
|
70
|
+
version_requirements: !ruby/object:Gem::Requirement
|
71
|
+
requirements:
|
72
|
+
- - ">="
|
73
|
+
- !ruby/object:Gem::Version
|
74
|
+
version: '0'
|
61
75
|
description:
|
62
76
|
email:
|
63
77
|
- cabeer@stanford.edu
|
@@ -77,6 +91,7 @@ files:
|
|
77
91
|
- app/models/global_alerts/alert.rb
|
78
92
|
- app/models/global_alerts/application_record.rb
|
79
93
|
- app/views/global_alerts/_alerts.html.erb
|
94
|
+
- config/deploy.rb
|
80
95
|
- config/initializers/global_alerts_initializer.rb
|
81
96
|
- config/routes.rb
|
82
97
|
- lib/global_alerts.rb
|
@@ -102,7 +117,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
102
117
|
- !ruby/object:Gem::Version
|
103
118
|
version: '0'
|
104
119
|
requirements: []
|
105
|
-
rubygems_version: 3.
|
120
|
+
rubygems_version: 3.4.10
|
106
121
|
signing_key:
|
107
122
|
specification_version: 4
|
108
123
|
summary: SUL global alerts as a service
|