rostra 0.3.1 → 0.3.2

Sign up to get free protection for your applications and to get access to all the features.
@@ -5,11 +5,11 @@ Rostra allows you to quickly add a question and answer forum to your application
5
5
  <b>NOTE: Rostra is not production ready.</b>
6
6
 
7
7
  == Installation
8
- Include the gem to your <tt>Gemfile</tt>:
8
+ Include the gem to your +Gemfile+:
9
9
 
10
10
  gem 'rostra'
11
11
 
12
- Mount the engine in <tt>config/routes.rb</tt>:
12
+ Mount the engine in +config/routes.rb+:
13
13
 
14
14
  mount Rostra::Engine => "/rostra" # or whatever path you like
15
15
 
@@ -18,31 +18,31 @@ Install and run the necessary migrations:
18
18
  rake rostra:install:migrations
19
19
  rake db:migrate
20
20
 
21
- Run the generator to create <tt>config/initializers/rostra.rb</tt> and <tt>app/helpers/application_helper.rb</tt>:
21
+ Run the generator to create +config/initializers/rostra.rb+ and +app/helpers/application_helper.rb+:
22
22
 
23
23
  rails generate rostra:install
24
24
 
25
- Call <tt>rostra</tt> in your user model:
25
+ Call +rostra+ in your user model:
26
26
 
27
27
  class User < ActiveRecord::Base
28
28
  rostra
29
29
  end
30
30
 
31
31
  == Basic configuration
32
- There's some stuff you'll almost definitely want to do in order to get Rostra working correctly for your app. First, set the <tt>default_url_options</tt> for your app. In each of your <tt>config/environment</tt> files you should have something like:
32
+ There's some stuff you'll almost definitely want to do in order to get Rostra working correctly for your app. First, set the +default_url_options+ for your app. In each of your +config/environment+ files you should have something like:
33
33
 
34
34
  config.action_mailer.default_url_options = { :host => 'test.com' } # test.rb
35
35
  config.action_mailer.default_url_options = { :host => 'localhost:3000' } # development.rb
36
36
  config.action_mailer.default_url_options = { :host => 'your_domain.com' } # production.rb
37
37
 
38
- Also, be sure to read through <tt>config/initializers/rostra.rb</tt> and override configuration options to suit your app. At the very least, you'll want to change:
38
+ Also, be sure to read through +config/initializers/rostra.rb+ and override configuration options to suit your app. At the very least, you'll want to change:
39
39
 
40
40
  config.deliver_emails_from = 'change_me@example.com'
41
41
 
42
- Finally, have a look at <tt>app/helpers/rostra/application_helper.rb</tt>, you may need to add/override helper methods.
42
+ Finally, have a look at +app/helpers/rostra/application_helper.rb+, you may need to add/override helper methods.
43
43
 
44
44
  == Overriding models
45
- Rostra provides a DSL for adding application specific logic to <tt>Rostra::Question</tt> and <tt>Rostra:Answer</tt>:
45
+ Rostra provides a DSL for adding application specific logic to +Rostra::Question+ and +Rostra:Answer+:
46
46
 
47
47
  class User < ActiveRecord::Base
48
48
  rostra do
@@ -73,9 +73,9 @@ Rostra provides a DSL for adding application specific logic to <tt>Rostra::Quest
73
73
  Added instructions for overriding controllers here (including generators!)
74
74
 
75
75
  == Setting permissions
76
- Under the hood, Rostra uses <tt>CanCan</tt> to set permissions. By default anyone can read rostra content - even if they are not logged in. A user can contribute content (i.e. ask questions, give answers, and leave comments) as long as they've logged in.
76
+ Under the hood, Rostra uses +CanCan+ to set permissions. By default anyone can read rostra content - even if they are not logged in. A user can contribute content (i.e. ask questions, give answers, and leave comments) as long as they've logged in.
77
77
 
78
- If you need to change these defaults, override <tt>can_participate_in_rostra?</tt> in your user model. <tt>CanCan</tt> will use this method to determine who can participate. If you need to specify even more complicated permissions, override <tt>app/models/rostra/ability.rb</tt> and go wild.
78
+ If you need to change these defaults, override +can_participate_in_rostra?+ in your user model. +CanCan+ will use this method to determine who can participate. If you need to specify even more complicated permissions, override +app/models/rostra/ability.rb+ and go wild.
79
79
 
80
80
 
81
81
  == Contributing to Rostra
@@ -31,13 +31,13 @@ module Rostra
31
31
 
32
32
  private
33
33
 
34
- # Override <tt>cancan</tt>'s default class of <tt>Ability</tt> to user <tt>Rostra::Ability</tt>.
34
+ # Override +cancan+'s default class of +Ability+ to user +Rostra::Ability+.
35
35
  #
36
36
  def current_ability
37
37
  @current_ability ||= Rostra::Ability.new(rostra_user)
38
38
  end
39
39
 
40
- # Override this method to if finer control over what happens when <tt>cancan</tt> denies access.
40
+ # Override this method to if finer control over what happens when +cancan+ denies access.
41
41
  #
42
42
  def after_access_denied
43
43
  redirect_to root_url, alert: "You don't have access to view this page"
@@ -47,7 +47,7 @@ module Rostra
47
47
  tag(:meta, { :name => "keywords", :content => keywords })
48
48
  end
49
49
 
50
- # Used to populate both the <tt>title</tt> and <tt>h1</tt> elements for each page.
50
+ # Used to populate both the +title+ and +h1+ elements for each page.
51
51
  #
52
52
  def page_title_helper
53
53
  case "#{controller_name}##{action_name}"
@@ -74,9 +74,9 @@ module Rostra
74
74
 
75
75
  # Finds the url to the user's avatar following this logic:
76
76
  #
77
- # 1. Calls <tt>avatar</tt> on the user object
77
+ # 1. Calls +avatar+ on the user object
78
78
  # 2. Uses the users email address to look for a gravatar
79
- # 3. Renders <tt>app/assets/images/rostra/anonymous_avatar.png</tt>
79
+ # 3. Renders +app/assets/images/rostra/anonymous_avatar.png+
80
80
  #
81
81
  def rostra_user_avatar(user)
82
82
  if user.respond_to?(:avatar)
@@ -101,7 +101,7 @@ module Rostra
101
101
  link_to entity_arrow.html_safe, vote_path(resource, direction), method: :put, remote: true, title: "vote #{direction}", class: "vote #{direction} #{selected}"
102
102
  end
103
103
 
104
- # Returns a rostra object's base class name. For example, <tt>@question</tt> is an instance of
104
+ # Returns a rostra object's base class name. For example, +@question+ is an instance of
105
105
  # Rostra::Question and so:
106
106
  #
107
107
  # class_name(@question) # => 'question'
@@ -11,8 +11,8 @@
11
11
  <body id="<%= controller_name %>" class="<%= action_name %>">
12
12
  <div id="page_wrap">
13
13
 
14
- <% flash.each do |name, msg| %>
15
- <%= content_tag :div, msg, id: "flash_#{name}", class: 'flash' %>
14
+ <% flash.each do |name, message| %>
15
+ <%= content_tag :div, message, id: "flash_#{name}", class: 'flash' %>
16
16
  <% end %>
17
17
 
18
18
  <h1><%=page_title_helper %></h1>
@@ -60,9 +60,9 @@ module Rostra
60
60
 
61
61
  # Finds the url to the user's avatar following this logic:
62
62
  #
63
- # 1. Calls <tt>avatar</tt> on the user object
63
+ # 1. Calls +avatar+ on the user object
64
64
  # 2. Uses the users email address to look for a gravatar
65
- # 3. Renders <tt>app/assets/images/rostra/anonymous_avatar.png</tt>
65
+ # 3. Renders +app/assets/images/rostra/anonymous_avatar.png+
66
66
  #
67
67
  # def rostra_user_avatar(user)
68
68
  # if user.respond_to?(:avatar)
@@ -75,7 +75,7 @@ module Rostra
75
75
  # image_tag(url, class: 'avatar')
76
76
  # end
77
77
 
78
- # Used to populate both the <tt>title</tt> and <tt>h1</tt> elements for each page.
78
+ # Used to populate both the +title+ and +h1+ elements for each page.
79
79
  #
80
80
  # def page_title_helper
81
81
  # case "#{controller_name}##{action_name}"
@@ -10,7 +10,7 @@ module Rostra
10
10
 
11
11
  module ClassMethods
12
12
 
13
- # Include this method in your <tt>rostra</tt>'d model to add the necessary accociations and
13
+ # Include this method in your +rostra+'d model to add the necessary accociations and
14
14
  # and methods:
15
15
  #
16
16
  # class User < ActiveRecord::Base
@@ -45,7 +45,7 @@ module Rostra
45
45
 
46
46
  module InstanceMethods
47
47
 
48
- # Built atop the <tt>thumbs_up</tt> API, this method does some conditional voting:
48
+ # Built atop the +thumbs_up+ API, this method does some conditional voting:
49
49
  #
50
50
  # * Clear the user's existing vote if...
51
51
  # - they've already voted up and attempt to vote up again
@@ -72,15 +72,15 @@ module Rostra
72
72
 
73
73
  # By default anyone can read rostra content - even if they are not logged in. This method
74
74
  # determines if users can contribute content (i.e. ask questions, give answers, and leave
75
- # comments). If <tt>can_participate_in_rostra?</tt> returns true, the user can contribute
75
+ # comments). If +can_participate_in_rostra?+ returns true, the user can contribute
76
76
  # content, otherwise they're restricted to read only.
77
77
  #
78
- # Under the hood, Rostra uses <tt>CanCan</tt> to set permissions and this is the only
79
- # place where <tt>can_participate_in_rostra?</tt> is actully used. The default is very
78
+ # Under the hood, Rostra uses +CanCan+ to set permissions and this is the only
79
+ # place where +can_participate_in_rostra?+ is actully used. The default is very
80
80
  # simple, if the user exists (i.e. they are logged in), then they may participate. But
81
- # you can override this method in your <tt>User</tt> model to set more complicated
81
+ # you can override this method in your +User+ model to set more complicated
82
82
  # conditions participation. If you need to specify even more complicated permissions,
83
- # override <tt>app/models/rostra/ability.rb</tt> and go wild.
83
+ # override +app/models/rostra/ability.rb+ and go wild.
84
84
  #
85
85
  def can_participate_in_rostra?
86
86
  !new_record?
@@ -1,3 +1,3 @@
1
1
  module Rostra
2
- VERSION = "0.3.1"
2
+ VERSION = "0.3.2"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rostra
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.1
4
+ version: 0.3.2
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,11 +9,11 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-04-12 00:00:00.000000000Z
12
+ date: 2012-05-02 00:00:00.000000000Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rails
16
- requirement: &2155949580 !ruby/object:Gem::Requirement
16
+ requirement: &70297176960800 !ruby/object:Gem::Requirement
17
17
  none: false
18
18
  requirements:
19
19
  - - ~>
@@ -21,21 +21,21 @@ dependencies:
21
21
  version: 3.2.3
22
22
  type: :runtime
23
23
  prerelease: false
24
- version_requirements: *2155949580
24
+ version_requirements: *70297176960800
25
25
  - !ruby/object:Gem::Dependency
26
26
  name: jquery-rails
27
- requirement: &2155943220 !ruby/object:Gem::Requirement
27
+ requirement: &70297176959940 !ruby/object:Gem::Requirement
28
28
  none: false
29
29
  requirements:
30
30
  - - ~>
31
31
  - !ruby/object:Gem::Version
32
- version: 1.0.19
32
+ version: 2.0.2
33
33
  type: :runtime
34
34
  prerelease: false
35
- version_requirements: *2155943220
35
+ version_requirements: *70297176959940
36
36
  - !ruby/object:Gem::Dependency
37
37
  name: acts-as-taggable-on
38
- requirement: &2155929300 !ruby/object:Gem::Requirement
38
+ requirement: &70297176959100 !ruby/object:Gem::Requirement
39
39
  none: false
40
40
  requirements:
41
41
  - - ~>
@@ -43,10 +43,10 @@ dependencies:
43
43
  version: 2.1.1
44
44
  type: :runtime
45
45
  prerelease: false
46
- version_requirements: *2155929300
46
+ version_requirements: *70297176959100
47
47
  - !ruby/object:Gem::Dependency
48
48
  name: cancan
49
- requirement: &2155891960 !ruby/object:Gem::Requirement
49
+ requirement: &70297176958340 !ruby/object:Gem::Requirement
50
50
  none: false
51
51
  requirements:
52
52
  - - ~>
@@ -54,10 +54,10 @@ dependencies:
54
54
  version: 1.6.7
55
55
  type: :runtime
56
56
  prerelease: false
57
- version_requirements: *2155891960
57
+ version_requirements: *70297176958340
58
58
  - !ruby/object:Gem::Dependency
59
59
  name: simple_form
60
- requirement: &2153337360 !ruby/object:Gem::Requirement
60
+ requirement: &70297176957280 !ruby/object:Gem::Requirement
61
61
  none: false
62
62
  requirements:
63
63
  - - ~>
@@ -65,10 +65,10 @@ dependencies:
65
65
  version: 1.5.2
66
66
  type: :runtime
67
67
  prerelease: false
68
- version_requirements: *2153337360
68
+ version_requirements: *70297176957280
69
69
  - !ruby/object:Gem::Dependency
70
70
  name: client_side_validations
71
- requirement: &2153336460 !ruby/object:Gem::Requirement
71
+ requirement: &70297176956520 !ruby/object:Gem::Requirement
72
72
  none: false
73
73
  requirements:
74
74
  - - ~>
@@ -76,10 +76,10 @@ dependencies:
76
76
  version: 3.1.4
77
77
  type: :runtime
78
78
  prerelease: false
79
- version_requirements: *2153336460
79
+ version_requirements: *70297176956520
80
80
  - !ruby/object:Gem::Dependency
81
81
  name: thumbs_up
82
- requirement: &2153335480 !ruby/object:Gem::Requirement
82
+ requirement: &70297176955320 !ruby/object:Gem::Requirement
83
83
  none: false
84
84
  requirements:
85
85
  - - ~>
@@ -87,10 +87,10 @@ dependencies:
87
87
  version: 0.4.6
88
88
  type: :runtime
89
89
  prerelease: false
90
- version_requirements: *2153335480
90
+ version_requirements: *70297176955320
91
91
  - !ruby/object:Gem::Dependency
92
92
  name: acts_as_commentable
93
- requirement: &2153334360 !ruby/object:Gem::Requirement
93
+ requirement: &70297176953600 !ruby/object:Gem::Requirement
94
94
  none: false
95
95
  requirements:
96
96
  - - ~>
@@ -98,10 +98,10 @@ dependencies:
98
98
  version: 3.0.1
99
99
  type: :runtime
100
100
  prerelease: false
101
- version_requirements: *2153334360
101
+ version_requirements: *70297176953600
102
102
  - !ruby/object:Gem::Dependency
103
103
  name: kaminari
104
- requirement: &2153332980 !ruby/object:Gem::Requirement
104
+ requirement: &70297176951840 !ruby/object:Gem::Requirement
105
105
  none: false
106
106
  requirements:
107
107
  - - ~>
@@ -109,10 +109,10 @@ dependencies:
109
109
  version: 0.13.0
110
110
  type: :runtime
111
111
  prerelease: false
112
- version_requirements: *2153332980
112
+ version_requirements: *70297176951840
113
113
  - !ruby/object:Gem::Dependency
114
114
  name: friendly_id
115
- requirement: &2153332200 !ruby/object:Gem::Requirement
115
+ requirement: &70297176948040 !ruby/object:Gem::Requirement
116
116
  none: false
117
117
  requirements:
118
118
  - - ~>
@@ -120,10 +120,10 @@ dependencies:
120
120
  version: 4.0.0
121
121
  type: :runtime
122
122
  prerelease: false
123
- version_requirements: *2153332200
123
+ version_requirements: *70297176948040
124
124
  - !ruby/object:Gem::Dependency
125
125
  name: impressionist
126
- requirement: &2153331080 !ruby/object:Gem::Requirement
126
+ requirement: &70297176946400 !ruby/object:Gem::Requirement
127
127
  none: false
128
128
  requirements:
129
129
  - - ~>
@@ -131,10 +131,10 @@ dependencies:
131
131
  version: 1.0.0
132
132
  type: :runtime
133
133
  prerelease: false
134
- version_requirements: *2153331080
134
+ version_requirements: *70297176946400
135
135
  - !ruby/object:Gem::Dependency
136
136
  name: sqlite3
137
- requirement: &2153330020 !ruby/object:Gem::Requirement
137
+ requirement: &70297176944900 !ruby/object:Gem::Requirement
138
138
  none: false
139
139
  requirements:
140
140
  - - ! '>='
@@ -142,10 +142,10 @@ dependencies:
142
142
  version: '0'
143
143
  type: :development
144
144
  prerelease: false
145
- version_requirements: *2153330020
145
+ version_requirements: *70297176944900
146
146
  - !ruby/object:Gem::Dependency
147
147
  name: cucumber-rails
148
- requirement: &2153329380 !ruby/object:Gem::Requirement
148
+ requirement: &70297176943460 !ruby/object:Gem::Requirement
149
149
  none: false
150
150
  requirements:
151
151
  - - ! '>='
@@ -153,10 +153,10 @@ dependencies:
153
153
  version: '0'
154
154
  type: :development
155
155
  prerelease: false
156
- version_requirements: *2153329380
156
+ version_requirements: *70297176943460
157
157
  - !ruby/object:Gem::Dependency
158
158
  name: factory_girl_rails
159
- requirement: &2153328680 !ruby/object:Gem::Requirement
159
+ requirement: &70297176942200 !ruby/object:Gem::Requirement
160
160
  none: false
161
161
  requirements:
162
162
  - - ! '>='
@@ -164,10 +164,10 @@ dependencies:
164
164
  version: '0'
165
165
  type: :development
166
166
  prerelease: false
167
- version_requirements: *2153328680
167
+ version_requirements: *70297176942200
168
168
  - !ruby/object:Gem::Dependency
169
169
  name: launchy
170
- requirement: &2153327600 !ruby/object:Gem::Requirement
170
+ requirement: &70297176940660 !ruby/object:Gem::Requirement
171
171
  none: false
172
172
  requirements:
173
173
  - - ! '>='
@@ -175,10 +175,10 @@ dependencies:
175
175
  version: '0'
176
176
  type: :development
177
177
  prerelease: false
178
- version_requirements: *2153327600
178
+ version_requirements: *70297176940660
179
179
  - !ruby/object:Gem::Dependency
180
180
  name: database_cleaner
181
- requirement: &2153326860 !ruby/object:Gem::Requirement
181
+ requirement: &70297176939520 !ruby/object:Gem::Requirement
182
182
  none: false
183
183
  requirements:
184
184
  - - ! '>='
@@ -186,10 +186,10 @@ dependencies:
186
186
  version: '0'
187
187
  type: :development
188
188
  prerelease: false
189
- version_requirements: *2153326860
189
+ version_requirements: *70297176939520
190
190
  - !ruby/object:Gem::Dependency
191
191
  name: rspec-rails
192
- requirement: &2153325580 !ruby/object:Gem::Requirement
192
+ requirement: &70297176938760 !ruby/object:Gem::Requirement
193
193
  none: false
194
194
  requirements:
195
195
  - - ! '>='
@@ -197,10 +197,10 @@ dependencies:
197
197
  version: '0'
198
198
  type: :development
199
199
  prerelease: false
200
- version_requirements: *2153325580
200
+ version_requirements: *70297176938760
201
201
  - !ruby/object:Gem::Dependency
202
202
  name: devise
203
- requirement: &2153324860 !ruby/object:Gem::Requirement
203
+ requirement: &70297176937680 !ruby/object:Gem::Requirement
204
204
  none: false
205
205
  requirements:
206
206
  - - ! '>='
@@ -208,10 +208,10 @@ dependencies:
208
208
  version: '0'
209
209
  type: :development
210
210
  prerelease: false
211
- version_requirements: *2153324860
211
+ version_requirements: *70297176937680
212
212
  - !ruby/object:Gem::Dependency
213
213
  name: pry
214
- requirement: &2153323420 !ruby/object:Gem::Requirement
214
+ requirement: &70297176936760 !ruby/object:Gem::Requirement
215
215
  none: false
216
216
  requirements:
217
217
  - - ! '>='
@@ -219,10 +219,10 @@ dependencies:
219
219
  version: '0'
220
220
  type: :development
221
221
  prerelease: false
222
- version_requirements: *2153323420
222
+ version_requirements: *70297176936760
223
223
  - !ruby/object:Gem::Dependency
224
224
  name: email_spec
225
- requirement: &2153322240 !ruby/object:Gem::Requirement
225
+ requirement: &70297176936140 !ruby/object:Gem::Requirement
226
226
  none: false
227
227
  requirements:
228
228
  - - ! '>='
@@ -230,7 +230,7 @@ dependencies:
230
230
  version: '0'
231
231
  type: :development
232
232
  prerelease: false
233
- version_requirements: *2153322240
233
+ version_requirements: *70297176936140
234
234
  description: Don't use. Not production ready
235
235
  email:
236
236
  - coryschires@gmail.com
@@ -592,7 +592,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
592
592
  version: '0'
593
593
  requirements: []
594
594
  rubyforge_project:
595
- rubygems_version: 1.8.10
595
+ rubygems_version: 1.8.15
596
596
  signing_key:
597
597
  specification_version: 3
598
598
  summary: Don't use. Not production ready