Short description and motivation.
- Add the gem
- Set any engine configuration:
- GlobalAlerts::Engine.config.cache (Cache for the alerts feed; defaults to the Rails cache)
- GlobalAlerts::Engine.config.application_name (Used for app-specific alerts, default is derived from the application name)
- GlobalAlerts::Engine.config.url (URL to pull alerts from)
- Render the global_alerts/alerts partial
In a YAML file (e.g. https://github.com/sul-dlss/global_alerts/blob/main/sul.yaml by default), configure alerts using:
html
: the HTML-safe alert textapplication_name
: used for application-specific alert text; matches against the consumer'sGlobalAlerts::Engine.config.application_name
from
/to
: schedule alerts for particular times (also supports open-ended ranges with onlyfrom
or onlyto
)
Consuming applications will pick only the first relevant alert.
Restart any consuming applications.
Add this line to your application's Gemfile:
gem 'global_alerts'
And then execute:
$ bundle
Or install it yourself as:
$ gem install global_alerts
Contribution directions go here.