paul_revere 0.2.0 → 0.2.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (5) hide show
  1. data/Gemfile +5 -0
  2. data/README.md +20 -0
  3. data/Rakefile +20 -45
  4. data/lib/generators/paul_revere/USAGE +4 -3
  5. metadata +73 -101
data/Gemfile ADDED
@@ -0,0 +1,5 @@
1
+ source "http://rubygems.org"
2
+ gemspec
3
+
4
+ gem "appraisal"
5
+ gem "rspec-rails"
data/README.md CHANGED
@@ -1,6 +1,9 @@
1
1
  Paul Revere
2
2
  ===========
3
3
 
4
+ [![Build Status](https://secure.travis-ci.org/thoughtbot/paul_revere.png?branch=master)](http://travis-ci.org/thoughtbot/paul_revere)
5
+
6
+
4
7
  Simple announcement plugin to include "one off" style announcements in Rails web apps.
5
8
 
6
9
  Install
@@ -14,6 +17,23 @@ Run the generator to create the migration and copy the javascript file into publ
14
17
 
15
18
  rails generate paul_revere
16
19
 
20
+ Usage
21
+ -----
22
+
23
+ Paul Revere provides...
24
+
25
+ * A model called `Announcement`, which has nothing more than timestamps and a "body" column (text column). We view the most recent `Announcement` as the "current" announcement, and will select that to show on the site.
26
+ * A helper called `#current_announcement`, which will return that latest `Announcement` record.
27
+ * A view partial called `_announcement_for_all`, which is intended to be shown to all site users.
28
+ * A view partial called `_announcement`, which is intended to be shown only to logged in users.
29
+ * A view partial called `_email_announcement`, which is intended to be used in site emails which are sent out.
30
+
31
+ So the flow would be...
32
+
33
+ * Install the gem
34
+ * Use those partials in the correct places in your view code and mailer view code where you want announcements to show up
35
+ * When you want to make an announcement, use the rails console to create a new Announcement record
36
+
17
37
  Beastie Boys Lyrics
18
38
  -------------------
19
39
 
data/Rakefile CHANGED
@@ -1,56 +1,31 @@
1
+ # encoding: UTF-8
2
+ require 'rubygems'
3
+ begin
4
+ require 'bundler/setup'
5
+ rescue LoadError
6
+ puts 'You must `gem install bundler` and `bundle install` to run rake tasks'
7
+ end
8
+
1
9
  require 'rake'
2
- require 'rake/testtask'
3
- require 'rake/rdoctask'
4
- require "rake/gempackagetask"
10
+ require 'rdoc/task'
11
+ require 'appraisal'
12
+
13
+ require 'rspec/core'
14
+ require 'rspec/core/rake_task'
15
+ RSpec::Core::RakeTask.new(:spec)
5
16
 
6
- desc 'Default: run unit tests.'
7
- task :default => :test
17
+ desc "Default: run the unit tests."
18
+ task :default => [:all]
8
19
 
9
- desc 'Test the paul revere plugin.'
10
- Rake::TestTask.new(:test) do |t|
11
- t.libs << 'lib'
12
- t.libs << 'test'
13
- t.pattern = 'test/**/*_test.rb'
14
- t.verbose = true
20
+ desc 'Test the plugin under all supported Rails versions.'
21
+ task :all => ["appraisal:install"] do |t|
22
+ exec('rake appraisal spec')
15
23
  end
16
24
 
17
25
  desc 'Generate documentation for the paul revere plugin.'
18
- Rake::RDocTask.new(:rdoc) do |rdoc|
26
+ RDoc::Task.new(:rdoc) do |rdoc|
19
27
  rdoc.rdoc_dir = 'rdoc'
20
28
  rdoc.title = 'PaulRevere'
21
29
  rdoc.options << '--line-numbers' << '--inline-source'
22
- rdoc.rdoc_files.include('README')
23
30
  rdoc.rdoc_files.include('lib/**/*.rb')
24
31
  end
25
-
26
- spec = Gem::Specification.new do |s|
27
- s.name = "paul_revere"
28
- s.version = "0.1.5"
29
- s.summary = "Simple announcement plugin to include 'one off' style announcements in Rails web apps."
30
- s.author = "Thoughtbot"
31
- s.email = "support@thoughtbot.com"
32
- s.homepage = "http://thoughtbot.com/community"
33
- s.has_rdoc = true
34
- s.extra_rdoc_files = %w(README.textile)
35
- s.rdoc_options = %w(--main README.textile)
36
- s.files = %w(init.rb MIT-LICENSE Rakefile README.textile) +
37
- Dir.glob("{test,lib/**/*,app/**/*}")
38
- s.require_paths = ["lib"]
39
-
40
- s.add_dependency("rails", "~> 3.0.0")
41
- s.add_development_dependency("bourne")
42
- s.add_development_dependency("shoulda")
43
- s.add_development_dependency("redgreen")
44
- end
45
-
46
- Rake::GemPackageTask.new(spec) do |pkg|
47
- pkg.gem_spec = spec
48
- end
49
-
50
- desc "Build the gemspec file #{spec.name}.gemspec"
51
- task :gemspec do
52
- file = File.dirname(__FILE__) + "/#{spec.name}.gemspec"
53
- File.open(file, "w") {|f| f << spec.to_ruby }
54
- end
55
-
56
- task :package => :gemspec
@@ -1,8 +1,9 @@
1
1
  Description:
2
- Explain the generator
2
+ Copies a javascript file and a migration into the application.
3
3
 
4
4
  Example:
5
- rails generate paul_revere Thing
5
+ rails generate paul_revere
6
6
 
7
7
  This will create:
8
- what/will/it/create
8
+ public/javascripts/announcements.js
9
+ db/migrate/create_announcements.rb
metadata CHANGED
@@ -1,138 +1,110 @@
1
- --- !ruby/object:Gem::Specification
1
+ --- !ruby/object:Gem::Specification
2
2
  name: paul_revere
3
- version: !ruby/object:Gem::Version
4
- hash: 23
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.2.1
5
5
  prerelease:
6
- segments:
7
- - 0
8
- - 2
9
- - 0
10
- version: 0.2.0
11
6
  platform: ruby
12
- authors:
13
- - Thoughtbot
7
+ authors:
8
+ - Nick Quaranto
9
+ - Matt Jankowski
10
+ - Joe Ferris
11
+ - Christopher Meiklejohn
12
+ - Tammer Saleh
13
+ - Jason Morrison
14
+ - Gabe Berke-Williams
14
15
  autorequire:
15
16
  bindir: bin
16
17
  cert_chain: []
17
-
18
- date: 2011-05-11 00:00:00 -04:00
19
- default_executable:
20
- dependencies:
21
- - !ruby/object:Gem::Dependency
18
+ date: 2011-09-18 00:00:00.000000000 Z
19
+ dependencies:
20
+ - !ruby/object:Gem::Dependency
22
21
  name: rails
23
- prerelease: false
24
- requirement: &id001 !ruby/object:Gem::Requirement
22
+ requirement: &2152105720 !ruby/object:Gem::Requirement
25
23
  none: false
26
- requirements:
24
+ requirements:
27
25
  - - ~>
28
- - !ruby/object:Gem::Version
29
- hash: 7
30
- segments:
31
- - 3
32
- - 0
33
- - 0
34
- version: 3.0.0
26
+ - !ruby/object:Gem::Version
27
+ version: '3.0'
35
28
  type: :runtime
36
- version_requirements: *id001
37
- - !ruby/object:Gem::Dependency
38
- name: bourne
39
29
  prerelease: false
40
- requirement: &id002 !ruby/object:Gem::Requirement
30
+ version_requirements: *2152105720
31
+ - !ruby/object:Gem::Dependency
32
+ name: rspec
33
+ requirement: &2152105180 !ruby/object:Gem::Requirement
41
34
  none: false
42
- requirements:
43
- - - ">="
44
- - !ruby/object:Gem::Version
45
- hash: 3
46
- segments:
47
- - 0
48
- version: "0"
35
+ requirements:
36
+ - - ! '>='
37
+ - !ruby/object:Gem::Version
38
+ version: '0'
49
39
  type: :development
50
- version_requirements: *id002
51
- - !ruby/object:Gem::Dependency
52
- name: shoulda
53
40
  prerelease: false
54
- requirement: &id003 !ruby/object:Gem::Requirement
41
+ version_requirements: *2152105180
42
+ - !ruby/object:Gem::Dependency
43
+ name: sqlite3
44
+ requirement: &2152104700 !ruby/object:Gem::Requirement
55
45
  none: false
56
- requirements:
57
- - - ">="
58
- - !ruby/object:Gem::Version
59
- hash: 3
60
- segments:
61
- - 0
62
- version: "0"
46
+ requirements:
47
+ - - ! '>='
48
+ - !ruby/object:Gem::Version
49
+ version: '0'
63
50
  type: :development
64
- version_requirements: *id003
65
- - !ruby/object:Gem::Dependency
66
- name: redgreen
67
51
  prerelease: false
68
- requirement: &id004 !ruby/object:Gem::Requirement
52
+ version_requirements: *2152104700
53
+ - !ruby/object:Gem::Dependency
54
+ name: mocha
55
+ requirement: &2152104240 !ruby/object:Gem::Requirement
69
56
  none: false
70
- requirements:
71
- - - ">="
72
- - !ruby/object:Gem::Version
73
- hash: 3
74
- segments:
75
- - 0
76
- version: "0"
57
+ requirements:
58
+ - - ! '>='
59
+ - !ruby/object:Gem::Version
60
+ version: '0'
77
61
  type: :development
78
- version_requirements: *id004
79
- description:
62
+ prerelease: false
63
+ version_requirements: *2152104240
64
+ description: Paul Revere provides a model and helper methods to do one-off style announcements.
80
65
  email: support@thoughtbot.com
81
66
  executables: []
82
-
83
67
  extensions: []
84
-
85
- extra_rdoc_files:
86
- - README.md
87
- files:
88
- - init.rb
89
- - MIT-LICENSE
90
- - Rakefile
91
- - README.md
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
96
- - lib/paul_revere.rb
68
+ extra_rdoc_files: []
69
+ files:
97
70
  - app/helpers/announcements_helper.rb
98
71
  - app/models/announcement.rb
99
72
  - app/views/announcements/_announcement.html.erb
100
73
  - app/views/announcements/_announcement_for_all.html.erb
101
74
  - app/views/announcements/_email_announcement.erb
102
- has_rdoc: true
103
- homepage: http://thoughtbot.com/community
75
+ - lib/generators/paul_revere/paul_revere_generator.rb
76
+ - lib/generators/paul_revere/templates/announcements.js
77
+ - lib/generators/paul_revere/templates/migration.rb
78
+ - lib/generators/paul_revere/USAGE
79
+ - lib/paul_revere.rb
80
+ - MIT-LICENSE
81
+ - Rakefile
82
+ - Gemfile
83
+ - README.md
84
+ - init.rb
85
+ homepage: https://github.com/thoughtbot/paul_revere
104
86
  licenses: []
105
-
106
87
  post_install_message:
107
- rdoc_options:
108
- - --main
109
- - README.md
110
- require_paths:
88
+ rdoc_options: []
89
+ require_paths:
111
90
  - lib
112
- required_ruby_version: !ruby/object:Gem::Requirement
91
+ required_ruby_version: !ruby/object:Gem::Requirement
113
92
  none: false
114
- requirements:
115
- - - ">="
116
- - !ruby/object:Gem::Version
117
- hash: 3
118
- segments:
119
- - 0
120
- version: "0"
121
- required_rubygems_version: !ruby/object:Gem::Requirement
93
+ requirements:
94
+ - - ! '>='
95
+ - !ruby/object:Gem::Version
96
+ version: '0'
97
+ required_rubygems_version: !ruby/object:Gem::Requirement
122
98
  none: false
123
- requirements:
124
- - - ">="
125
- - !ruby/object:Gem::Version
126
- hash: 3
127
- segments:
128
- - 0
129
- version: "0"
99
+ requirements:
100
+ - - ! '>='
101
+ - !ruby/object:Gem::Version
102
+ version: '0'
130
103
  requirements: []
131
-
132
104
  rubyforge_project:
133
- rubygems_version: 1.6.2
105
+ rubygems_version: 1.8.10
134
106
  signing_key:
135
107
  specification_version: 3
136
- summary: Simple announcement plugin to include 'one off' style announcements in Rails web apps.
108
+ summary: Simple announcement plugin to include 'one off' style announcements in Rails
109
+ web apps.
137
110
  test_files: []
138
-