paul_revere 0.1.0 → 0.1.1
Sign up to get free protection for your applications and to get access to all the features.
- data/README.textile +7 -3
- data/Rakefile +3 -4
- data/app/helpers/announcements_helper.rb +11 -0
- data/app/models/announcement.rb +9 -0
- data/app/views/announcements/_announcement.html.erb +9 -0
- data/app/views/announcements/_email_announcement.erb +5 -0
- data/init.rb +1 -2
- data/lib/generators/paul_revere/USAGE +8 -0
- data/lib/generators/paul_revere/paul_revere_generator.rb +10 -0
- data/lib/generators/paul_revere/templates/announcements.js +6 -0
- data/lib/generators/paul_revere/templates/migration.rb +12 -0
- metadata +12 -6
- data/install.rb +0 -0
- data/uninstall.rb +0 -1
data/README.textile
CHANGED
@@ -4,13 +4,17 @@ Simple announcement plugin to include "one off" style announcements in Rails web
|
|
4
4
|
|
5
5
|
h2. Install
|
6
6
|
|
7
|
-
Install the engine as normal:
|
7
|
+
Install the engine as normal, in your Gemfile:
|
8
8
|
|
9
|
-
@
|
9
|
+
@gem 'paul_revere'@
|
10
|
+
|
11
|
+
or...
|
12
|
+
|
13
|
+
@rails plugin install git://github.com/thoughtbot/paul_revere.git@
|
10
14
|
|
11
15
|
Run the generator to create the migration and copy the javascript file into public:
|
12
16
|
|
13
|
-
|
17
|
+
@rails generate paul_revere@
|
14
18
|
|
15
19
|
h2. Beastie Boys Lyrics
|
16
20
|
|
data/Rakefile
CHANGED
@@ -25,17 +25,16 @@ end
|
|
25
25
|
|
26
26
|
spec = Gem::Specification.new do |s|
|
27
27
|
s.name = "paul_revere"
|
28
|
-
s.version = "0.1.
|
28
|
+
s.version = "0.1.1"
|
29
29
|
s.summary = "Simple announcement plugin to include 'one off' style announcements in Rails web apps."
|
30
30
|
s.author = "Thoughtbot"
|
31
31
|
s.email = "support@thoughtbot.com"
|
32
32
|
s.homepage = "http://thoughtbot.com/community"
|
33
|
-
|
34
33
|
s.has_rdoc = true
|
35
34
|
s.extra_rdoc_files = %w(README.textile)
|
36
35
|
s.rdoc_options = %w(--main README.textile)
|
37
|
-
|
38
|
-
|
36
|
+
s.files = %w(init.rb MIT-LICENSE Rakefile README.textile) +
|
37
|
+
Dir.glob("{test,lib/**/*,app/**/*}")
|
39
38
|
s.require_paths = ["lib"]
|
40
39
|
|
41
40
|
s.add_dependency("rails", "~> 3.0.0")
|
@@ -0,0 +1,9 @@
|
|
1
|
+
<% if current_user and current_announcement.exists? and not announcement_hidden?(current_announcement) %>
|
2
|
+
<div id="announcement">
|
3
|
+
<%= current_announcement.body %>
|
4
|
+
<div class="hide">
|
5
|
+
<%= link_to_function "hide", "hideAnnouncement('announcement_#{current_announcement.created_at}');" %>
|
6
|
+
</div>
|
7
|
+
</div>
|
8
|
+
<% end %>
|
9
|
+
|
data/init.rb
CHANGED
@@ -1,2 +1 @@
|
|
1
|
-
|
2
|
-
|
1
|
+
require 'paul_revere'
|
@@ -0,0 +1,10 @@
|
|
1
|
+
class PaulRevereGenerator < Rails::Generator::Base
|
2
|
+
desc "Put the javascript and migration in place"
|
3
|
+
source_root File.join(File.dirname(__FILE__), "templates")
|
4
|
+
|
5
|
+
def install
|
6
|
+
directory "public/javascripts"
|
7
|
+
file "announcements.js", "public/javascripts/announcements.js"
|
8
|
+
migration_template "migration.rb", "db/migrate/create_announcements.rb"
|
9
|
+
end
|
10
|
+
end
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: paul_revere
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 25
|
5
5
|
prerelease: false
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 1
|
9
|
-
-
|
10
|
-
version: 0.1.
|
9
|
+
- 1
|
10
|
+
version: 0.1.1
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Thoughtbot
|
@@ -15,7 +15,7 @@ autorequire:
|
|
15
15
|
bindir: bin
|
16
16
|
cert_chain: []
|
17
17
|
|
18
|
-
date: 2010-10-
|
18
|
+
date: 2010-10-13 00:00:00 -04:00
|
19
19
|
default_executable:
|
20
20
|
dependencies:
|
21
21
|
- !ruby/object:Gem::Dependency
|
@@ -86,12 +86,18 @@ extra_rdoc_files:
|
|
86
86
|
- README.textile
|
87
87
|
files:
|
88
88
|
- init.rb
|
89
|
-
- install.rb
|
90
89
|
- MIT-LICENSE
|
91
90
|
- Rakefile
|
92
91
|
- README.textile
|
93
|
-
-
|
92
|
+
- lib/generators/paul_revere/paul_revere_generator.rb
|
93
|
+
- lib/generators/paul_revere/templates/announcements.js
|
94
|
+
- lib/generators/paul_revere/templates/migration.rb
|
95
|
+
- lib/generators/paul_revere/USAGE
|
94
96
|
- lib/paul_revere.rb
|
97
|
+
- app/helpers/announcements_helper.rb
|
98
|
+
- app/models/announcement.rb
|
99
|
+
- app/views/announcements/_announcement.html.erb
|
100
|
+
- app/views/announcements/_email_announcement.erb
|
95
101
|
has_rdoc: true
|
96
102
|
homepage: http://thoughtbot.com/community
|
97
103
|
licenses: []
|
data/install.rb
DELETED
File without changes
|
data/uninstall.rb
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
# Uninstall hook code here
|