public_service_announcement 0.1.0 → 0.1.1
Sign up to get free protection for your applications and to get access to all the features.
- data/.gitignore +2 -0
- data/README.md +43 -0
- data/app/models/psa.rb +4 -0
- data/public_service_announcement.gemspec +2 -2
- metadata +4 -4
- data/README.rdoc +0 -3
data/.gitignore
CHANGED
data/README.md
ADDED
@@ -0,0 +1,43 @@
|
|
1
|
+
Public Service Announcement
|
2
|
+
===========================
|
3
|
+
|
4
|
+
Public Service Announcement is a Rails Engine allowing for the centralized management of public alerts.
|
5
|
+
|
6
|
+
|
7
|
+
Install
|
8
|
+
-------
|
9
|
+
|
10
|
+
Add this line to your Gemfile:
|
11
|
+
|
12
|
+
gem 'public_service_announcement'
|
13
|
+
|
14
|
+
Then at the commandline:
|
15
|
+
|
16
|
+
bundle install
|
17
|
+
rake psa:migrations:copy
|
18
|
+
rake db:migrate
|
19
|
+
|
20
|
+
Finally, add the code to output the messages to your application.html.erb file:
|
21
|
+
|
22
|
+
<ul class="announcements">
|
23
|
+
<% public_service_announcements.each do |announcement| %>
|
24
|
+
<li><%= announcement %></li>
|
25
|
+
<% end %>
|
26
|
+
</ul>
|
27
|
+
|
28
|
+
And for haml:
|
29
|
+
|
30
|
+
%ul.announcements
|
31
|
+
- public_service_announcements.each do |announcement|
|
32
|
+
li=announcement
|
33
|
+
|
34
|
+
Of course, you can actually format them anyway you like but this is how I do it.
|
35
|
+
|
36
|
+
Usage
|
37
|
+
-----
|
38
|
+
|
39
|
+
Navigate to:
|
40
|
+
|
41
|
+
/psas
|
42
|
+
|
43
|
+
Create new announcement with a message, start date, and end date. You may, optionally, include max views, route regex to match, and/or user agent regex to match. The route and user agent regexes will default to exact match unless you specify either ^ or $.
|
data/app/models/psa.rb
CHANGED
@@ -6,11 +6,11 @@ Gem::Specification.new do |s|
|
|
6
6
|
s.homepage = "http://github.com/gabeanzelini/public_service_announcement"
|
7
7
|
s.name = "public_service_announcement"
|
8
8
|
s.summary = "Insert PublicServiceAnnouncement summary."
|
9
|
-
s.description = "
|
9
|
+
s.description = "Rails Engine allowing centralized management of public alerts."
|
10
10
|
s.add_dependency "rails", "3.0.3"
|
11
11
|
s.add_dependency "inherited_resources"
|
12
12
|
s.add_dependency "simple_form"
|
13
13
|
s.files = `git ls-files`.split("\n")
|
14
14
|
s.require_paths = ["lib"]
|
15
|
-
s.version = "0.1.
|
15
|
+
s.version = "0.1.1"
|
16
16
|
end
|
metadata
CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
|
|
5
5
|
segments:
|
6
6
|
- 0
|
7
7
|
- 1
|
8
|
-
-
|
9
|
-
version: 0.1.
|
8
|
+
- 1
|
9
|
+
version: 0.1.1
|
10
10
|
platform: ruby
|
11
11
|
authors:
|
12
12
|
- Gabe Anzelini
|
@@ -58,7 +58,7 @@ dependencies:
|
|
58
58
|
version: "0"
|
59
59
|
type: :runtime
|
60
60
|
version_requirements: *id003
|
61
|
-
description:
|
61
|
+
description: Rails Engine allowing centralized management of public alerts.
|
62
62
|
email: me@gabeanzelini.com
|
63
63
|
executables: []
|
64
64
|
|
@@ -71,7 +71,7 @@ files:
|
|
71
71
|
- Gemfile
|
72
72
|
- Gemfile.lock
|
73
73
|
- MIT-LICENSE
|
74
|
-
- README.
|
74
|
+
- README.md
|
75
75
|
- Rakefile
|
76
76
|
- app/controllers/psas_controller.rb
|
77
77
|
- app/models/psa.rb
|
data/README.rdoc
DELETED