global_alerts 0.2.0 → 0.4.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 +42 -5
- data/Rakefile +0 -3
- data/config/initializers/global_alerts_initializer.rb +3 -1
- data/lib/global_alerts/engine.rb +2 -1
- data/lib/global_alerts/version.rb +1 -1
- metadata +23 -9
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6007837f7de40972e221132425424184910e894b42964fa812ac0e0780aff32f
|
4
|
+
data.tar.gz: a3f606c12ae564f17cc4df240126abf848441e13656b518312e8f6947438b817
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2545b85c009f505403b7772daceac3fdbda17e968a61950b5869cf9021132515ab8287ce5de24e9b51d286ec408c8abb38a5293f858a8ebd41423024c106b2ab
|
7
|
+
data.tar.gz: 9e04a6d7f03bc4885af220c5ea6b421f2ed15e192ab9c2109b48607496137d2d044fd40ddf1f88b5d04a069de9b99ef78c866ea7f9f0fd5a45b8019b92b04905
|
data/README.md
CHANGED
@@ -1,12 +1,14 @@
|
|
1
1
|
# GlobalAlerts
|
2
|
-
|
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)
|
3
4
|
|
4
5
|
## Usage
|
5
6
|
|
6
7
|
### Consuming
|
7
8
|
|
8
9
|
- Add the gem
|
9
|
-
- Set
|
10
|
+
- Set GLOBAL_ALERTS to `<%= true %>` in the application settings.
|
11
|
+
- Set any engine configuration in the consuming application's initializers:
|
10
12
|
- GlobalAlerts::Engine.config.cache (Cache for the alerts feed; defaults to the Rails cache)
|
11
13
|
- GlobalAlerts::Engine.config.application_name (Used for app-specific alerts, default is derived from the application name)
|
12
14
|
- GlobalAlerts::Engine.config.url (URL to pull alerts from)
|
@@ -24,6 +26,44 @@ Consuming applications will pick only the first relevant alert.
|
|
24
26
|
|
25
27
|
Restart any consuming applications.
|
26
28
|
|
29
|
+
### Example Alerts
|
30
|
+
|
31
|
+
#### Basic alert
|
32
|
+
```
|
33
|
+
alerts:
|
34
|
+
- html: A single <em>sample alert</em> across all apps. This will appear until manually removed from the YML file.
|
35
|
+
```
|
36
|
+
|
37
|
+
#### `to`
|
38
|
+
```
|
39
|
+
alerts:
|
40
|
+
- to: '2020-12-07T12:00:00-07:00'
|
41
|
+
html: This message will appear immediately and will expire on December 7th at noon.
|
42
|
+
```
|
43
|
+
|
44
|
+
#### `from`
|
45
|
+
```
|
46
|
+
alerts:
|
47
|
+
- from: '2020-12-07T12:00:00-07:00'
|
48
|
+
html: This message will begin on December 7th at noon and must be manually removed.
|
49
|
+
```
|
50
|
+
#### `from` and `to`
|
51
|
+
```
|
52
|
+
alerts:
|
53
|
+
- from: '2020-12-24T12:00:00-07:00'
|
54
|
+
to: '2020-12-25T12:00:00-07:00'
|
55
|
+
html: This message will appear from December 24th at noon and expire on December 25th at noon. This YML should be removed later.
|
56
|
+
```
|
57
|
+
|
58
|
+
#### `application_name`
|
59
|
+
```
|
60
|
+
alerts:
|
61
|
+
- application_name: 'MyLibrary
|
62
|
+
html: This message will appear on MyLibrary until manually removed.
|
63
|
+
- html: This alert will appear on all other applications with GLOBAL_ALERTS enabled
|
64
|
+
```
|
65
|
+
|
66
|
+
|
27
67
|
## Installation
|
28
68
|
Add this line to your application's Gemfile:
|
29
69
|
|
@@ -40,6 +80,3 @@ Or install it yourself as:
|
|
40
80
|
```bash
|
41
81
|
$ gem install global_alerts
|
42
82
|
```
|
43
|
-
|
44
|
-
## Contributing
|
45
|
-
Contribution directions go here.
|
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'
|
data/lib/global_alerts/engine.rb
CHANGED
@@ -7,7 +7,8 @@ module GlobalAlerts
|
|
7
7
|
config.url = 'https://github.com/sul-dlss/global-alerts/raw/main/sul.yaml'
|
8
8
|
|
9
9
|
initializer('global_alerts_default') do |app|
|
10
|
-
|
10
|
+
# parent_name is deprecated in Rails 6.1
|
11
|
+
config.application_name ||= app.class.respond_to?(:parent_name) ? app.class.parent_name.underscore : app.class.module_parent_name.underscore
|
11
12
|
end
|
12
13
|
end
|
13
14
|
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.4.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Chris Beer
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2022-03-09 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,7 +58,21 @@ dependencies:
|
|
58
58
|
- - ">="
|
59
59
|
- !ruby/object:Gem::Version
|
60
60
|
version: '0'
|
61
|
-
|
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'
|
75
|
+
description:
|
62
76
|
email:
|
63
77
|
- cabeer@stanford.edu
|
64
78
|
executables: []
|
@@ -87,7 +101,7 @@ homepage: https://github.com/sul-dlss/global_alerts
|
|
87
101
|
licenses:
|
88
102
|
- Apache 2.0
|
89
103
|
metadata: {}
|
90
|
-
post_install_message:
|
104
|
+
post_install_message:
|
91
105
|
rdoc_options: []
|
92
106
|
require_paths:
|
93
107
|
- lib
|
@@ -102,8 +116,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
102
116
|
- !ruby/object:Gem::Version
|
103
117
|
version: '0'
|
104
118
|
requirements: []
|
105
|
-
rubygems_version: 3.
|
106
|
-
signing_key:
|
119
|
+
rubygems_version: 3.2.32
|
120
|
+
signing_key:
|
107
121
|
specification_version: 4
|
108
122
|
summary: SUL global alerts as a service
|
109
123
|
test_files: []
|