commontator 4.3.0 → 4.4.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +18 -11
- data/app/assets/stylesheets/commontator/comments.css +24 -3
- data/app/controllers/commontator/application_controller.rb +8 -3
- data/app/controllers/commontator/comments_controller.rb +13 -11
- data/app/controllers/commontator/subscriptions_controller.rb +2 -2
- data/app/controllers/commontator/threads_controller.rb +2 -2
- data/app/mailers/commontator/subscriptions_mailer.rb +5 -8
- data/app/models/commontator/comment.rb +37 -19
- data/app/models/commontator/thread.rb +18 -20
- data/app/views/commontator/comments/_body.html.erb +1 -1
- data/app/views/commontator/comments/_show.html.erb +10 -9
- data/app/views/commontator/comments/_votes.html.erb +11 -6
- data/app/views/commontator/comments/delete.js.erb +1 -1
- data/app/views/commontator/comments/update.js.erb +1 -1
- data/app/views/commontator/subscriptions_mailer/comment_created.html.erb +2 -2
- data/app/views/commontator/threads/_show.html.erb +3 -2
- data/config/initializers/commontator.rb +117 -96
- data/config/locales/{en.yml → commontator/en.yml} +15 -14
- data/lib/commontator.rb +61 -17
- data/lib/commontator/acts_as_commontable.rb +4 -0
- data/lib/commontator/acts_as_commontator.rb +16 -0
- data/lib/commontator/engine.rb +3 -0
- data/lib/commontator/shared_helper.rb +7 -19
- data/lib/commontator/version.rb +1 -1
- data/lib/tasks/commontator_tasks.rake +5 -2
- data/spec/app/mailers/commontator/subscriptions_mailer_spec.rb +2 -2
- data/spec/app/models/commontator/comment_spec.rb +19 -0
- data/spec/dummy/config/application.rb +1 -0
- data/spec/dummy/config/initializers/commontator.rb +3 -5
- data/spec/dummy/db/test.sqlite3 +0 -0
- data/spec/dummy/log/test.log +120400 -0
- data/spec/dummy/tmp/cache/assets/test/sprockets/72b63dddbc5c995f79af8e3c94904fd9 +0 -0
- data/spec/dummy/tmp/cache/assets/test/sprockets/a77b1a9223d168112e1705c29220116f +0 -0
- data/spec/dummy/tmp/cache/assets/test/sprockets/d2244ccef8e05bb993f75715af0344cc +0 -0
- data/spec/dummy/tmp/cache/assets/test/sprockets/decb63cac838a5314aa0c22a979f5ac9 +0 -0
- data/spec/dummy/tmp/cache/assets/test/sprockets/f721383d531f067d82b071e14aed7a92 +0 -0
- data/spec/lib/commontator/acts_as_commontable_spec.rb +1 -0
- data/spec/lib/commontator/acts_as_commontator_spec.rb +4 -0
- data/spec/lib/commontator/commontator_config_spec.rb +6 -4
- data/spec/test_helper.rb +0 -6
- metadata +3 -9
- data/app/helpers/commontator/comments_helper.rb +0 -17
- data/app/helpers/commontator/threads_helper.rb +0 -7
- data/spec/app/helpers/commontator/comments_helper_spec.rb +0 -29
- data/spec/app/helpers/commontator/threads_helper_spec.rb +0 -13
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
@@ -19,6 +19,10 @@ module Commontator
|
|
19
19
|
user.must_respond_to :comments
|
20
20
|
user.must_respond_to :subscriptions
|
21
21
|
user.must_respond_to :commontator_config
|
22
|
+
user.must_respond_to :commontator_name
|
23
|
+
user.must_respond_to :commontator_email
|
24
|
+
user.must_respond_to :commontator_link
|
25
|
+
user.must_respond_to :commontator_avatar
|
22
26
|
user.commontator_config.must_be_instance_of CommontatorConfig
|
23
27
|
end
|
24
28
|
end
|
@@ -17,10 +17,12 @@ module Commontator
|
|
17
17
|
end
|
18
18
|
|
19
19
|
it 'must be configurable' do
|
20
|
-
|
21
|
-
|
22
|
-
config = CommontatorConfig.new(:
|
23
|
-
config.
|
20
|
+
proc = lambda { |user| 'Some name' }
|
21
|
+
proc2 = lambda { |user| 'Another name' }
|
22
|
+
config = CommontatorConfig.new(:user_name_proc => proc)
|
23
|
+
(config.user_name_proc == proc).must_equal true
|
24
|
+
config = CommontatorConfig.new(:user_name_proc => proc2)
|
25
|
+
(config.user_name_proc == proc2).must_equal true
|
24
26
|
end
|
25
27
|
end
|
26
28
|
end
|
data/spec/test_helper.rb
CHANGED
@@ -29,12 +29,6 @@ def setup_controller_spec
|
|
29
29
|
end
|
30
30
|
|
31
31
|
def setup_helper_spec
|
32
|
-
setup_model_spec
|
33
|
-
@comment = Commontator::Comment.new
|
34
|
-
@comment.body = 'Some comment'
|
35
|
-
@comment.thread = @thread
|
36
|
-
@comment.creator = @user
|
37
|
-
@comment.save!
|
38
32
|
end
|
39
33
|
|
40
34
|
def setup_mailer_spec
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: commontator
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 4.
|
4
|
+
version: 4.4.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Dante Soares
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-03-
|
11
|
+
date: 2014-03-14 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|
@@ -102,8 +102,6 @@ files:
|
|
102
102
|
- app/controllers/commontator/subscriptions_controller.rb
|
103
103
|
- app/controllers/commontator/threads_controller.rb
|
104
104
|
- app/helpers/commontator/application_helper.rb
|
105
|
-
- app/helpers/commontator/comments_helper.rb
|
106
|
-
- app/helpers/commontator/threads_helper.rb
|
107
105
|
- app/mailers/commontator/subscriptions_mailer.rb
|
108
106
|
- app/models/commontator/comment.rb
|
109
107
|
- app/models/commontator/subscription.rb
|
@@ -128,7 +126,7 @@ files:
|
|
128
126
|
- app/views/commontator/threads/_show.html.erb
|
129
127
|
- app/views/commontator/threads/show.js.erb
|
130
128
|
- config/initializers/commontator.rb
|
131
|
-
- config/locales/en.yml
|
129
|
+
- config/locales/commontator/en.yml
|
132
130
|
- config/routes.rb
|
133
131
|
- db/migrate/0_install_commontator.rb
|
134
132
|
- lib/commontator.rb
|
@@ -146,8 +144,6 @@ files:
|
|
146
144
|
- spec/app/controllers/commontator/subscriptions_controller_spec.rb
|
147
145
|
- spec/app/controllers/commontator/threads_controller_spec.rb
|
148
146
|
- spec/app/helpers/commontator/application_helper_spec.rb
|
149
|
-
- spec/app/helpers/commontator/comments_helper_spec.rb
|
150
|
-
- spec/app/helpers/commontator/threads_helper_spec.rb
|
151
147
|
- spec/app/mailers/commontator/subscriptions_mailer_spec.rb
|
152
148
|
- spec/app/models/commontator/comment_spec.rb
|
153
149
|
- spec/app/models/commontator/subscription_spec.rb
|
@@ -237,8 +233,6 @@ test_files:
|
|
237
233
|
- spec/app/controllers/commontator/subscriptions_controller_spec.rb
|
238
234
|
- spec/app/controllers/commontator/threads_controller_spec.rb
|
239
235
|
- spec/app/helpers/commontator/application_helper_spec.rb
|
240
|
-
- spec/app/helpers/commontator/comments_helper_spec.rb
|
241
|
-
- spec/app/helpers/commontator/threads_helper_spec.rb
|
242
236
|
- spec/app/mailers/commontator/subscriptions_mailer_spec.rb
|
243
237
|
- spec/app/models/commontator/comment_spec.rb
|
244
238
|
- spec/app/models/commontator/subscription_spec.rb
|
@@ -1,17 +0,0 @@
|
|
1
|
-
module Commontator
|
2
|
-
module CommentsHelper
|
3
|
-
def created_timestamp(comment)
|
4
|
-
t 'commontator.comment.status.created_at',
|
5
|
-
:created_at => l(comment.created_at, :format => :commontator)
|
6
|
-
end
|
7
|
-
|
8
|
-
def updated_timestamp(comment)
|
9
|
-
editor = comment.editor
|
10
|
-
return '' if editor.nil?
|
11
|
-
|
12
|
-
t 'commontator.comment.status.updated_at',
|
13
|
-
:editor_name => editor.commontator_config.user_name_proc.call(editor),
|
14
|
-
:updated_at => l(comment.updated_at, :format => :commontator)
|
15
|
-
end
|
16
|
-
end
|
17
|
-
end
|
@@ -1,29 +0,0 @@
|
|
1
|
-
require 'test_helper'
|
2
|
-
|
3
|
-
module Commontator
|
4
|
-
describe CommentsHelper do
|
5
|
-
before do
|
6
|
-
setup_helper_spec
|
7
|
-
end
|
8
|
-
|
9
|
-
it 'must make proper timestamps' do
|
10
|
-
editor_name = @user.commontator_config.user_name_proc.call(@user)
|
11
|
-
created_timestamp(@comment).must_equal t('commontator.comment.status.created_at',
|
12
|
-
:created_at => l(@comment.created_at,
|
13
|
-
:format => :commontator))
|
14
|
-
updated_timestamp(@comment).must_equal ''
|
15
|
-
|
16
|
-
@comment.body = 'Something else'
|
17
|
-
@comment.editor = @user
|
18
|
-
@comment.save!
|
19
|
-
|
20
|
-
created_timestamp(@comment).must_equal t('commontator.comment.status.created_at',
|
21
|
-
:created_at => l(@comment.created_at,
|
22
|
-
:format => :commontator))
|
23
|
-
updated_timestamp(@comment).must_equal t('commontator.comment.status.updated_at',
|
24
|
-
:editor_name => editor_name,
|
25
|
-
:updated_at => l(@comment.updated_at,
|
26
|
-
:format => :commontator))
|
27
|
-
end
|
28
|
-
end
|
29
|
-
end
|