activity_notification 0.0.8 → 0.0.9
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +11 -1
- data/README.md +63 -28
- data/activity_notification.gemspec +4 -2
- data/app/controllers/activity_notification/notifications_controller.rb +1 -1
- data/app/controllers/activity_notification/notifications_with_devise_controller.rb +10 -10
- data/app/views/activity_notification/notifications/default/_index.html.erb +9 -4
- data/lib/activity_notification.rb +7 -6
- data/lib/activity_notification/apis/notification_api.rb +14 -15
- data/lib/activity_notification/common.rb +15 -7
- data/lib/activity_notification/config.rb +2 -0
- data/lib/activity_notification/helpers/view_helpers.rb +5 -4
- data/lib/activity_notification/mailers/helpers.rb +9 -9
- data/lib/activity_notification/models.rb +16 -0
- data/lib/activity_notification/models/{notifiable.rb → concerns/notifiable.rb} +15 -10
- data/lib/activity_notification/models/{notifier.rb → concerns/notifier.rb} +6 -0
- data/lib/activity_notification/models/{target.rb → concerns/target.rb} +34 -17
- data/lib/activity_notification/renderable.rb +2 -1
- data/lib/activity_notification/roles/acts_as_notifiable.rb +38 -23
- data/lib/activity_notification/roles/acts_as_notifier.rb +11 -0
- data/lib/activity_notification/roles/acts_as_target.rb +9 -18
- data/lib/activity_notification/version.rb +1 -1
- data/lib/generators/activity_notification/{migration → active_record}/migration_generator.rb +5 -4
- data/lib/generators/activity_notification/controllers_generator.rb +1 -1
- data/lib/generators/activity_notification/install_generator.rb +3 -6
- data/lib/generators/activity_notification/{notification → models}/notification_generator.rb +5 -4
- data/lib/generators/activity_notification/views_generator.rb +20 -22
- data/lib/generators/templates/active_record/migration.rb +1 -1
- data/lib/generators/templates/activity_notification.rb +13 -3
- data/{config → lib/generators/templates}/locales/en.yml +0 -0
- data/lib/generators/templates/notification/notification.rb +4 -1
- data/spec/concerns/{notification_api_spec.rb → apis/notification_api_spec.rb} +169 -45
- data/spec/concerns/common_spec.rb +150 -0
- data/spec/concerns/models/notifiable_spec.rb +435 -0
- data/spec/concerns/models/notifier_spec.rb +23 -0
- data/spec/concerns/models/target_spec.rb +579 -0
- data/spec/concerns/renderable_spec.rb +110 -0
- data/spec/controllers/notifications_controller_shared_examples.rb +457 -0
- data/spec/controllers/notifications_controller_spec.rb +12 -0
- data/spec/controllers/notifications_with_devise_controller_spec.rb +81 -0
- data/spec/factories/admins.rb +5 -0
- data/spec/factories/articles.rb +1 -1
- data/spec/factories/comments.rb +1 -1
- data/spec/factories/dummy/dummy_notifiable.rb +4 -0
- data/spec/factories/dummy/dummy_notifier.rb +4 -0
- data/spec/factories/dummy/dummy_target.rb +4 -0
- data/spec/factories/notifications.rb +1 -1
- data/spec/factories/users.rb +7 -1
- data/spec/generators/active_record/migration_generator_spec.rb +41 -0
- data/spec/generators/controllers_generator_spec.rb +62 -0
- data/spec/generators/install_generator_spec.rb +43 -0
- data/spec/generators/models/notification_generator_spec.rb +41 -0
- data/spec/generators/views_generator_spec.rb +111 -0
- data/spec/helpers/polymorphic_helpers_spec.rb +89 -0
- data/spec/helpers/view_helpers_spec.rb +258 -0
- data/spec/mailers/mailer_spec.rb +98 -0
- data/spec/models/dummy/dummy_notifiable_spec.rb +6 -0
- data/spec/models/dummy/dummy_notifier_spec.rb +6 -0
- data/spec/models/dummy/dummy_target_spec.rb +6 -0
- data/spec/models/notification_spec.rb +5 -4
- data/spec/rails_app/app/assets/javascripts/application.js +2 -0
- data/spec/rails_app/app/controllers/articles_controller.rb +62 -0
- data/spec/rails_app/app/controllers/comments_controller.rb +34 -0
- data/spec/rails_app/app/models/admin.rb +8 -0
- data/spec/rails_app/app/models/article.rb +6 -6
- data/spec/rails_app/app/models/comment.rb +2 -2
- data/spec/rails_app/app/models/dummy/dummy_base.rb +2 -0
- data/spec/rails_app/app/models/dummy/dummy_notifiable.rb +4 -0
- data/spec/rails_app/app/models/dummy/dummy_notifier.rb +4 -0
- data/spec/rails_app/app/models/dummy/dummy_target.rb +4 -0
- data/spec/rails_app/app/models/user.rb +5 -5
- data/spec/rails_app/app/views/activity_notification/notifications/default/custom/_path_test.html.erb +1 -0
- data/spec/rails_app/app/views/activity_notification/notifications/default/custom/_test.html.erb +1 -0
- data/spec/rails_app/app/views/activity_notification/notifications/users/_custom_index.html.erb +1 -0
- data/spec/rails_app/app/views/activity_notification/notifications/users/custom/_test.html.erb +1 -0
- data/spec/rails_app/app/views/articles/_form.html.erb +20 -0
- data/spec/rails_app/app/views/articles/edit.html.erb +6 -0
- data/spec/rails_app/app/views/articles/index.html.erb +67 -0
- data/spec/rails_app/app/views/articles/new.html.erb +5 -0
- data/spec/rails_app/app/views/articles/show.html.erb +38 -0
- data/spec/rails_app/app/views/layouts/_header.html.erb +8 -0
- data/spec/rails_app/app/views/layouts/application.html.erb +3 -4
- data/spec/rails_app/config/initializers/activity_notification.rb +13 -3
- data/spec/rails_app/config/initializers/devise.rb +274 -274
- data/spec/rails_app/config/locales/activity_notification.en.yml +20 -0
- data/spec/rails_app/config/locales/devise.en.yml +62 -0
- data/spec/rails_app/config/routes.rb +6 -2
- data/spec/rails_app/db/migrate/20160715050433_create_test_tables.rb +6 -2
- data/spec/rails_app/db/schema.rb +8 -0
- data/spec/rails_app/db/seeds.rb +43 -0
- data/spec/roles/acts_as_notifiable_spec.rb +32 -0
- data/spec/roles/acts_as_notifier_spec.rb +17 -0
- data/spec/roles/acts_as_target_spec.rb +40 -0
- data/spec/spec_helper.rb +18 -14
- metadata +136 -12
@@ -0,0 +1,20 @@
|
|
1
|
+
# Additional translations of ActivityNotification
|
2
|
+
|
3
|
+
en:
|
4
|
+
notification:
|
5
|
+
user:
|
6
|
+
article:
|
7
|
+
create:
|
8
|
+
text: 'Article has been created'
|
9
|
+
destroy:
|
10
|
+
text: 'Some user removed an article!'
|
11
|
+
comment:
|
12
|
+
post:
|
13
|
+
text: "<p>%{notifier_name} posted comments to your article %{article_title}</p>"
|
14
|
+
reply:
|
15
|
+
text: "<p>%{notifier_name} and %{group_member_count} people replied for your comments</p>"
|
16
|
+
mail_subject: 'New comment to your article'
|
17
|
+
admin:
|
18
|
+
article:
|
19
|
+
post:
|
20
|
+
text: '[Admin] Article has been created'
|
@@ -0,0 +1,62 @@
|
|
1
|
+
# Additional translations at https://github.com/plataformatec/devise/wiki/I18n
|
2
|
+
|
3
|
+
en:
|
4
|
+
devise:
|
5
|
+
confirmations:
|
6
|
+
confirmed: "Your email address has been successfully confirmed."
|
7
|
+
send_instructions: "You will receive an email with instructions for how to confirm your email address in a few minutes."
|
8
|
+
send_paranoid_instructions: "If your email address exists in our database, you will receive an email with instructions for how to confirm your email address in a few minutes."
|
9
|
+
failure:
|
10
|
+
already_authenticated: "You are already signed in."
|
11
|
+
inactive: "Your account is not activated yet."
|
12
|
+
invalid: "Invalid %{authentication_keys} or password."
|
13
|
+
locked: "Your account is locked."
|
14
|
+
last_attempt: "You have one more attempt before your account is locked."
|
15
|
+
not_found_in_database: "Invalid %{authentication_keys} or password."
|
16
|
+
timeout: "Your session expired. Please sign in again to continue."
|
17
|
+
unauthenticated: "You need to sign in or sign up before continuing."
|
18
|
+
unconfirmed: "You have to confirm your email address before continuing."
|
19
|
+
mailer:
|
20
|
+
confirmation_instructions:
|
21
|
+
subject: "Confirmation instructions"
|
22
|
+
reset_password_instructions:
|
23
|
+
subject: "Reset password instructions"
|
24
|
+
unlock_instructions:
|
25
|
+
subject: "Unlock instructions"
|
26
|
+
password_change:
|
27
|
+
subject: "Password Changed"
|
28
|
+
omniauth_callbacks:
|
29
|
+
failure: "Could not authenticate you from %{kind} because \"%{reason}\"."
|
30
|
+
success: "Successfully authenticated from %{kind} account."
|
31
|
+
passwords:
|
32
|
+
no_token: "You can't access this page without coming from a password reset email. If you do come from a password reset email, please make sure you used the full URL provided."
|
33
|
+
send_instructions: "You will receive an email with instructions on how to reset your password in a few minutes."
|
34
|
+
send_paranoid_instructions: "If your email address exists in our database, you will receive a password recovery link at your email address in a few minutes."
|
35
|
+
updated: "Your password has been changed successfully. You are now signed in."
|
36
|
+
updated_not_active: "Your password has been changed successfully."
|
37
|
+
registrations:
|
38
|
+
destroyed: "Bye! Your account has been successfully cancelled. We hope to see you again soon."
|
39
|
+
signed_up: "Welcome! You have signed up successfully."
|
40
|
+
signed_up_but_inactive: "You have signed up successfully. However, we could not sign you in because your account is not yet activated."
|
41
|
+
signed_up_but_locked: "You have signed up successfully. However, we could not sign you in because your account is locked."
|
42
|
+
signed_up_but_unconfirmed: "A message with a confirmation link has been sent to your email address. Please follow the link to activate your account."
|
43
|
+
update_needs_confirmation: "You updated your account successfully, but we need to verify your new email address. Please check your email and follow the confirm link to confirm your new email address."
|
44
|
+
updated: "Your account has been updated successfully."
|
45
|
+
sessions:
|
46
|
+
signed_in: "Signed in successfully."
|
47
|
+
signed_out: "Signed out successfully."
|
48
|
+
already_signed_out: "Signed out successfully."
|
49
|
+
unlocks:
|
50
|
+
send_instructions: "You will receive an email with instructions for how to unlock your account in a few minutes."
|
51
|
+
send_paranoid_instructions: "If your account exists, you will receive an email with instructions for how to unlock it in a few minutes."
|
52
|
+
unlocked: "Your account has been unlocked successfully. Please sign in to continue."
|
53
|
+
errors:
|
54
|
+
messages:
|
55
|
+
already_confirmed: "was already confirmed, please try signing in"
|
56
|
+
confirmation_period_expired: "needs to be confirmed within %{period}, please request a new one"
|
57
|
+
expired: "has expired, please request a new one"
|
58
|
+
not_found: "not found"
|
59
|
+
not_locked: "was not locked"
|
60
|
+
not_saved:
|
61
|
+
one: "1 error prohibited this %{resource} from being saved:"
|
62
|
+
other: "%{count} errors prohibited this %{resource} from being saved:"
|
@@ -5,18 +5,22 @@ class CreateTestTables < ActiveRecord::Migration
|
|
5
5
|
## Database authenticatable
|
6
6
|
t.string :email, null: false, default: "", index: true, unique: true
|
7
7
|
t.string :encrypted_password, null: false, default: ""
|
8
|
-
|
9
8
|
## Confirmable
|
10
9
|
t.string :confirmation_token
|
11
10
|
t.datetime :confirmed_at
|
12
11
|
t.datetime :confirmation_sent_at
|
13
|
-
|
14
12
|
# Apps
|
15
13
|
t.string :name
|
16
14
|
|
17
15
|
t.timestamps
|
18
16
|
end
|
19
17
|
|
18
|
+
create_table :admins do |t|
|
19
|
+
t.references :user, index: true
|
20
|
+
|
21
|
+
t.timestamps
|
22
|
+
end
|
23
|
+
|
20
24
|
create_table :articles do |t|
|
21
25
|
t.references :user, index: true
|
22
26
|
t.string :title
|
data/spec/rails_app/db/schema.rb
CHANGED
@@ -13,6 +13,14 @@
|
|
13
13
|
|
14
14
|
ActiveRecord::Schema.define(version: 20160715050433) do
|
15
15
|
|
16
|
+
create_table "admins", force: :cascade do |t|
|
17
|
+
t.integer "user_id"
|
18
|
+
t.datetime "created_at"
|
19
|
+
t.datetime "updated_at"
|
20
|
+
end
|
21
|
+
|
22
|
+
add_index "admins", ["user_id"], name: "index_admins_on_user_id"
|
23
|
+
|
16
24
|
create_table "articles", force: :cascade do |t|
|
17
25
|
t.integer "user_id"
|
18
26
|
t.string "title"
|
@@ -0,0 +1,43 @@
|
|
1
|
+
# coding: utf-8
|
2
|
+
# This file is seed file for test data on development environment.
|
3
|
+
|
4
|
+
ActivityNotification::Notification.delete_all
|
5
|
+
Comment.delete_all
|
6
|
+
Article.delete_all
|
7
|
+
Admin.delete_all
|
8
|
+
User.delete_all
|
9
|
+
User.connection.execute("UPDATE sqlite_sequence SET seq = 0;")
|
10
|
+
|
11
|
+
['ichiro', 'stephen', 'klay'].each do |name|
|
12
|
+
user = User.new(
|
13
|
+
email: "#{name}@example.com",
|
14
|
+
password: 'changeit',
|
15
|
+
password_confirmation: 'changeit',
|
16
|
+
name: name,
|
17
|
+
)
|
18
|
+
user.skip_confirmation!
|
19
|
+
user.save!
|
20
|
+
end
|
21
|
+
|
22
|
+
['ichiro'].each do |name|
|
23
|
+
user = User.find_by_name(name)
|
24
|
+
Admin.create(user: user)
|
25
|
+
end
|
26
|
+
|
27
|
+
User.all.each do |user|
|
28
|
+
article = user.articles.create(
|
29
|
+
title: "#{user.name}'s first article",
|
30
|
+
body: "This is the first #{user.name}'s article. Please read it!"
|
31
|
+
)
|
32
|
+
article.notify :users, send_email: false
|
33
|
+
end
|
34
|
+
|
35
|
+
Article.all.each do |article|
|
36
|
+
User.all.each do |user|
|
37
|
+
comment = article.comments.create(
|
38
|
+
user: user,
|
39
|
+
body: "This is the first #{user.name}'s comment for #{article.user.name}'s article."
|
40
|
+
)
|
41
|
+
comment.notify :users, send_email: false
|
42
|
+
end
|
43
|
+
end
|
@@ -0,0 +1,32 @@
|
|
1
|
+
describe ActivityNotification::ActsAsNotifiable do
|
2
|
+
let(:dummy_model_class) { Dummy::DummyBase }
|
3
|
+
|
4
|
+
describe "as public class methods" do
|
5
|
+
describe "acts_as_notifiable" do
|
6
|
+
it "have not included Notifiable before calling" do
|
7
|
+
expect(dummy_model_class.respond_to?(:available_as_notifiable?)).to be_falsey
|
8
|
+
end
|
9
|
+
|
10
|
+
it "includes Notifiable" do
|
11
|
+
dummy_model_class.acts_as_notifiable :users
|
12
|
+
expect(dummy_model_class.respond_to?(:available_as_notifiable?)).to be_truthy
|
13
|
+
expect(dummy_model_class.available_as_notifiable?).to be_truthy
|
14
|
+
end
|
15
|
+
|
16
|
+
context "with no options" do
|
17
|
+
it "returns hash of specified options" do
|
18
|
+
expect(dummy_model_class.acts_as_notifiable :users).to eq({})
|
19
|
+
end
|
20
|
+
end
|
21
|
+
|
22
|
+
#TODO test other options
|
23
|
+
end
|
24
|
+
|
25
|
+
describe "available_notifiable_options" do
|
26
|
+
it "returns list of available options in acts_as_notifiable" do
|
27
|
+
expect(dummy_model_class.available_notifiable_options)
|
28
|
+
.to eq([:targets, :group, :notifier, :parameters, :email_allowed, :notifiable_path])
|
29
|
+
end
|
30
|
+
end
|
31
|
+
end
|
32
|
+
end
|
@@ -0,0 +1,17 @@
|
|
1
|
+
describe ActivityNotification::ActsAsNotifier do
|
2
|
+
let(:dummy_model_class) { Dummy::DummyBase }
|
3
|
+
|
4
|
+
describe "as public class methods" do
|
5
|
+
describe "acts_as_notifier" do
|
6
|
+
it "have not included Notifier before calling" do
|
7
|
+
expect(dummy_model_class.respond_to?(:available_as_notifier?)).to be_falsey
|
8
|
+
end
|
9
|
+
|
10
|
+
it "includes Notifier" do
|
11
|
+
dummy_model_class.acts_as_notifier
|
12
|
+
expect(dummy_model_class.respond_to?(:available_as_notifier?)).to be_truthy
|
13
|
+
expect(dummy_model_class.available_as_notifier?).to be_truthy
|
14
|
+
end
|
15
|
+
end
|
16
|
+
end
|
17
|
+
end
|
@@ -0,0 +1,40 @@
|
|
1
|
+
describe ActivityNotification::ActsAsTarget do
|
2
|
+
let(:dummy_model_class) { Dummy::DummyBase }
|
3
|
+
|
4
|
+
describe "as public class methods" do
|
5
|
+
describe "acts_as_target" do
|
6
|
+
it "have not included Target before calling" do
|
7
|
+
expect(dummy_model_class.respond_to?(:available_as_target?)).to be_falsey
|
8
|
+
end
|
9
|
+
|
10
|
+
it "includes Target" do
|
11
|
+
dummy_model_class.acts_as_target
|
12
|
+
expect(dummy_model_class.respond_to?(:available_as_target?)).to be_truthy
|
13
|
+
expect(dummy_model_class.available_as_target?).to be_truthy
|
14
|
+
end
|
15
|
+
|
16
|
+
context "with no options" do
|
17
|
+
it "returns hash of specified options" do
|
18
|
+
expect(dummy_model_class.acts_as_target).to eq({})
|
19
|
+
end
|
20
|
+
end
|
21
|
+
|
22
|
+
#TODO test other options
|
23
|
+
end
|
24
|
+
|
25
|
+
describe "acts_as_notification_target" do
|
26
|
+
it "is an alias of acts_as_target" do
|
27
|
+
#TODO make better way to test alias
|
28
|
+
#expect(dummy_model_class.acts_as_notification_target).to receive(:acts_as_target)
|
29
|
+
expect(dummy_model_class.respond_to?(:acts_as_notification_target)).to be_truthy
|
30
|
+
end
|
31
|
+
end
|
32
|
+
|
33
|
+
describe "available_target_options" do
|
34
|
+
it "returns list of available options in acts_as_target" do
|
35
|
+
expect(dummy_model_class.available_target_options)
|
36
|
+
.to eq([:email, :email_allowed, :devise_resource])
|
37
|
+
end
|
38
|
+
end
|
39
|
+
end
|
40
|
+
end
|
data/spec/spec_helper.rb
CHANGED
@@ -3,25 +3,28 @@ ENV["RAILS_ENV"] ||= "test"
|
|
3
3
|
require 'bundler/setup'
|
4
4
|
Bundler.setup
|
5
5
|
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
6
|
+
require 'simplecov'
|
7
|
+
require 'coveralls'
|
8
|
+
Coveralls.wear!
|
9
|
+
SimpleCov.formatter = SimpleCov::Formatter::MultiFormatter.new [
|
10
|
+
SimpleCov::Formatter::HTMLFormatter,
|
11
|
+
Coveralls::SimpleCov::Formatter
|
12
|
+
]
|
13
|
+
SimpleCov.start('rails') do
|
14
|
+
add_filter '/spec/'
|
15
|
+
add_filter '/lib/generators/templates/'
|
16
|
+
add_filter '/lib/activity_notification/version.rb'
|
17
|
+
end
|
16
18
|
|
19
|
+
# Testing with Devise
|
20
|
+
require 'devise'
|
17
21
|
# Dummy application
|
18
22
|
require 'rails_app/config/environment'
|
19
23
|
|
20
|
-
|
21
|
-
|
22
|
-
require 'activity_notification'
|
24
|
+
require 'rspec/rails'
|
25
|
+
require 'ammeter/init'
|
23
26
|
require 'factory_girl_rails'
|
24
|
-
|
27
|
+
require 'activity_notification'
|
25
28
|
|
26
29
|
# For active record ORM
|
27
30
|
require 'active_record'
|
@@ -31,4 +34,5 @@ RSpec.configure do |config|
|
|
31
34
|
config.before(:all) do
|
32
35
|
FactoryGirl.reload
|
33
36
|
end
|
37
|
+
config.include Devise::Test::ControllerHelpers, type: :controller
|
34
38
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: activity_notification
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.9
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Shota Yamazaki
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-
|
11
|
+
date: 2016-08-19 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|
@@ -66,6 +66,20 @@ dependencies:
|
|
66
66
|
- - "~>"
|
67
67
|
- !ruby/object:Gem::Version
|
68
68
|
version: 1.3.11
|
69
|
+
- !ruby/object:Gem::Dependency
|
70
|
+
name: jquery-rails
|
71
|
+
requirement: !ruby/object:Gem::Requirement
|
72
|
+
requirements:
|
73
|
+
- - "~>"
|
74
|
+
- !ruby/object:Gem::Version
|
75
|
+
version: 4.1.1
|
76
|
+
type: :development
|
77
|
+
prerelease: false
|
78
|
+
version_requirements: !ruby/object:Gem::Requirement
|
79
|
+
requirements:
|
80
|
+
- - "~>"
|
81
|
+
- !ruby/object:Gem::Version
|
82
|
+
version: 4.1.1
|
69
83
|
- !ruby/object:Gem::Dependency
|
70
84
|
name: rspec-rails
|
71
85
|
requirement: !ruby/object:Gem::Requirement
|
@@ -108,6 +122,20 @@ dependencies:
|
|
108
122
|
- - "~>"
|
109
123
|
- !ruby/object:Gem::Version
|
110
124
|
version: 0.12.0
|
125
|
+
- !ruby/object:Gem::Dependency
|
126
|
+
name: ammeter
|
127
|
+
requirement: !ruby/object:Gem::Requirement
|
128
|
+
requirements:
|
129
|
+
- - "~>"
|
130
|
+
- !ruby/object:Gem::Version
|
131
|
+
version: 1.1.3
|
132
|
+
type: :development
|
133
|
+
prerelease: false
|
134
|
+
version_requirements: !ruby/object:Gem::Requirement
|
135
|
+
requirements:
|
136
|
+
- - "~>"
|
137
|
+
- !ruby/object:Gem::Version
|
138
|
+
version: 1.1.3
|
111
139
|
- !ruby/object:Gem::Dependency
|
112
140
|
name: devise
|
113
141
|
requirement: !ruby/object:Gem::Requirement
|
@@ -122,7 +150,7 @@ dependencies:
|
|
122
150
|
- - "~>"
|
123
151
|
- !ruby/object:Gem::Version
|
124
152
|
version: 4.2.0
|
125
|
-
description: Integrated user activity notifications for Rails. Provides functions
|
153
|
+
description: Integrated user activity notifications for Ruby on Rails. Provides functions
|
126
154
|
to configure multiple notification targets and make activity notifications with
|
127
155
|
notifiable models, like adding comments, responding etc.
|
128
156
|
email:
|
@@ -152,7 +180,6 @@ files:
|
|
152
180
|
- app/views/activity_notification/notifications/default/open.js.erb
|
153
181
|
- app/views/activity_notification/notifications/default/open_all.js.erb
|
154
182
|
- app/views/activity_notification/notifications/default/show.html.erb
|
155
|
-
- config/locales/en.yml
|
156
183
|
- lib/activity_notification.rb
|
157
184
|
- lib/activity_notification/apis/notification_api.rb
|
158
185
|
- lib/activity_notification/common.rb
|
@@ -161,20 +188,22 @@ files:
|
|
161
188
|
- lib/activity_notification/helpers/polymorphic_helpers.rb
|
162
189
|
- lib/activity_notification/helpers/view_helpers.rb
|
163
190
|
- lib/activity_notification/mailers/helpers.rb
|
164
|
-
- lib/activity_notification/models
|
191
|
+
- lib/activity_notification/models.rb
|
192
|
+
- lib/activity_notification/models/concerns/notifiable.rb
|
193
|
+
- lib/activity_notification/models/concerns/notifier.rb
|
194
|
+
- lib/activity_notification/models/concerns/target.rb
|
165
195
|
- lib/activity_notification/models/notification.rb
|
166
|
-
- lib/activity_notification/models/notifier.rb
|
167
|
-
- lib/activity_notification/models/target.rb
|
168
196
|
- lib/activity_notification/rails.rb
|
169
197
|
- lib/activity_notification/rails/routes.rb
|
170
198
|
- lib/activity_notification/renderable.rb
|
171
199
|
- lib/activity_notification/roles/acts_as_notifiable.rb
|
200
|
+
- lib/activity_notification/roles/acts_as_notifier.rb
|
172
201
|
- lib/activity_notification/roles/acts_as_target.rb
|
173
202
|
- lib/activity_notification/version.rb
|
203
|
+
- lib/generators/activity_notification/active_record/migration_generator.rb
|
174
204
|
- lib/generators/activity_notification/controllers_generator.rb
|
175
205
|
- lib/generators/activity_notification/install_generator.rb
|
176
|
-
- lib/generators/activity_notification/
|
177
|
-
- lib/generators/activity_notification/notification/notification_generator.rb
|
206
|
+
- lib/generators/activity_notification/models/notification_generator.rb
|
178
207
|
- lib/generators/activity_notification/views_generator.rb
|
179
208
|
- lib/generators/templates/README
|
180
209
|
- lib/generators/templates/active_record/migration.rb
|
@@ -182,24 +211,66 @@ files:
|
|
182
211
|
- lib/generators/templates/controllers/README
|
183
212
|
- lib/generators/templates/controllers/notifications_controller.rb
|
184
213
|
- lib/generators/templates/controllers/notifications_with_devise_controller.rb
|
214
|
+
- lib/generators/templates/locales/en.yml
|
185
215
|
- lib/generators/templates/notification/notification.rb
|
186
216
|
- lib/tasks/activity_notification_tasks.rake
|
187
|
-
- spec/concerns/notification_api_spec.rb
|
217
|
+
- spec/concerns/apis/notification_api_spec.rb
|
218
|
+
- spec/concerns/common_spec.rb
|
219
|
+
- spec/concerns/models/notifiable_spec.rb
|
220
|
+
- spec/concerns/models/notifier_spec.rb
|
221
|
+
- spec/concerns/models/target_spec.rb
|
222
|
+
- spec/concerns/renderable_spec.rb
|
223
|
+
- spec/controllers/notifications_controller_shared_examples.rb
|
224
|
+
- spec/controllers/notifications_controller_spec.rb
|
225
|
+
- spec/controllers/notifications_with_devise_controller_spec.rb
|
226
|
+
- spec/factories/admins.rb
|
188
227
|
- spec/factories/articles.rb
|
189
228
|
- spec/factories/comments.rb
|
229
|
+
- spec/factories/dummy/dummy_notifiable.rb
|
230
|
+
- spec/factories/dummy/dummy_notifier.rb
|
231
|
+
- spec/factories/dummy/dummy_target.rb
|
190
232
|
- spec/factories/notifications.rb
|
191
233
|
- spec/factories/users.rb
|
234
|
+
- spec/generators/active_record/migration_generator_spec.rb
|
235
|
+
- spec/generators/controllers_generator_spec.rb
|
236
|
+
- spec/generators/install_generator_spec.rb
|
237
|
+
- spec/generators/models/notification_generator_spec.rb
|
238
|
+
- spec/generators/views_generator_spec.rb
|
239
|
+
- spec/helpers/polymorphic_helpers_spec.rb
|
240
|
+
- spec/helpers/view_helpers_spec.rb
|
241
|
+
- spec/mailers/mailer_spec.rb
|
242
|
+
- spec/models/dummy/dummy_notifiable_spec.rb
|
243
|
+
- spec/models/dummy/dummy_notifier_spec.rb
|
244
|
+
- spec/models/dummy/dummy_target_spec.rb
|
192
245
|
- spec/models/notification_spec.rb
|
193
246
|
- spec/rails_app/Rakefile
|
247
|
+
- spec/rails_app/app/assets/javascripts/application.js
|
194
248
|
- spec/rails_app/app/controllers/application_controller.rb
|
249
|
+
- spec/rails_app/app/controllers/articles_controller.rb
|
250
|
+
- spec/rails_app/app/controllers/comments_controller.rb
|
195
251
|
- spec/rails_app/app/controllers/concerns/.keep
|
196
252
|
- spec/rails_app/app/helpers/application_helper.rb
|
197
253
|
- spec/rails_app/app/mailers/.keep
|
198
254
|
- spec/rails_app/app/models/.keep
|
255
|
+
- spec/rails_app/app/models/admin.rb
|
199
256
|
- spec/rails_app/app/models/article.rb
|
200
257
|
- spec/rails_app/app/models/comment.rb
|
201
258
|
- spec/rails_app/app/models/concerns/.keep
|
259
|
+
- spec/rails_app/app/models/dummy/dummy_base.rb
|
260
|
+
- spec/rails_app/app/models/dummy/dummy_notifiable.rb
|
261
|
+
- spec/rails_app/app/models/dummy/dummy_notifier.rb
|
262
|
+
- spec/rails_app/app/models/dummy/dummy_target.rb
|
202
263
|
- spec/rails_app/app/models/user.rb
|
264
|
+
- spec/rails_app/app/views/activity_notification/notifications/default/custom/_path_test.html.erb
|
265
|
+
- spec/rails_app/app/views/activity_notification/notifications/default/custom/_test.html.erb
|
266
|
+
- spec/rails_app/app/views/activity_notification/notifications/users/_custom_index.html.erb
|
267
|
+
- spec/rails_app/app/views/activity_notification/notifications/users/custom/_test.html.erb
|
268
|
+
- spec/rails_app/app/views/articles/_form.html.erb
|
269
|
+
- spec/rails_app/app/views/articles/edit.html.erb
|
270
|
+
- spec/rails_app/app/views/articles/index.html.erb
|
271
|
+
- spec/rails_app/app/views/articles/new.html.erb
|
272
|
+
- spec/rails_app/app/views/articles/show.html.erb
|
273
|
+
- spec/rails_app/app/views/layouts/_header.html.erb
|
203
274
|
- spec/rails_app/app/views/layouts/application.html.erb
|
204
275
|
- spec/rails_app/bin/bundle
|
205
276
|
- spec/rails_app/bin/rails
|
@@ -223,15 +294,21 @@ files:
|
|
223
294
|
- spec/rails_app/config/initializers/mime_types.rb
|
224
295
|
- spec/rails_app/config/initializers/session_store.rb
|
225
296
|
- spec/rails_app/config/initializers/wrap_parameters.rb
|
297
|
+
- spec/rails_app/config/locales/activity_notification.en.yml
|
298
|
+
- spec/rails_app/config/locales/devise.en.yml
|
226
299
|
- spec/rails_app/config/routes.rb
|
227
300
|
- spec/rails_app/config/secrets.yml
|
228
301
|
- spec/rails_app/db/migrate/20160715050420_create_notifications.rb
|
229
302
|
- spec/rails_app/db/migrate/20160715050433_create_test_tables.rb
|
230
303
|
- spec/rails_app/db/schema.rb
|
304
|
+
- spec/rails_app/db/seeds.rb
|
231
305
|
- spec/rails_app/public/404.html
|
232
306
|
- spec/rails_app/public/422.html
|
233
307
|
- spec/rails_app/public/500.html
|
234
308
|
- spec/rails_app/public/favicon.ico
|
309
|
+
- spec/roles/acts_as_notifiable_spec.rb
|
310
|
+
- spec/roles/acts_as_notifier_spec.rb
|
311
|
+
- spec/roles/acts_as_target_spec.rb
|
235
312
|
- spec/spec_helper.rb
|
236
313
|
homepage: https://github.com/simukappu/activity_notification
|
237
314
|
licenses:
|
@@ -256,24 +333,65 @@ rubyforge_project:
|
|
256
333
|
rubygems_version: 2.5.1
|
257
334
|
signing_key:
|
258
335
|
specification_version: 4
|
259
|
-
summary: Integrated user activity notifications for Rails
|
336
|
+
summary: Integrated user activity notifications for Ruby on Rails
|
260
337
|
test_files:
|
261
|
-
- spec/concerns/notification_api_spec.rb
|
338
|
+
- spec/concerns/apis/notification_api_spec.rb
|
339
|
+
- spec/concerns/common_spec.rb
|
340
|
+
- spec/concerns/models/notifiable_spec.rb
|
341
|
+
- spec/concerns/models/notifier_spec.rb
|
342
|
+
- spec/concerns/models/target_spec.rb
|
343
|
+
- spec/concerns/renderable_spec.rb
|
344
|
+
- spec/controllers/notifications_controller_shared_examples.rb
|
345
|
+
- spec/controllers/notifications_controller_spec.rb
|
346
|
+
- spec/controllers/notifications_with_devise_controller_spec.rb
|
347
|
+
- spec/factories/admins.rb
|
262
348
|
- spec/factories/articles.rb
|
263
349
|
- spec/factories/comments.rb
|
350
|
+
- spec/factories/dummy/dummy_notifiable.rb
|
351
|
+
- spec/factories/dummy/dummy_notifier.rb
|
352
|
+
- spec/factories/dummy/dummy_target.rb
|
264
353
|
- spec/factories/notifications.rb
|
265
354
|
- spec/factories/users.rb
|
355
|
+
- spec/generators/active_record/migration_generator_spec.rb
|
356
|
+
- spec/generators/controllers_generator_spec.rb
|
357
|
+
- spec/generators/install_generator_spec.rb
|
358
|
+
- spec/generators/models/notification_generator_spec.rb
|
359
|
+
- spec/generators/views_generator_spec.rb
|
360
|
+
- spec/helpers/polymorphic_helpers_spec.rb
|
361
|
+
- spec/helpers/view_helpers_spec.rb
|
362
|
+
- spec/mailers/mailer_spec.rb
|
363
|
+
- spec/models/dummy/dummy_notifiable_spec.rb
|
364
|
+
- spec/models/dummy/dummy_notifier_spec.rb
|
365
|
+
- spec/models/dummy/dummy_target_spec.rb
|
266
366
|
- spec/models/notification_spec.rb
|
267
367
|
- spec/rails_app/Rakefile
|
368
|
+
- spec/rails_app/app/assets/javascripts/application.js
|
268
369
|
- spec/rails_app/app/controllers/application_controller.rb
|
370
|
+
- spec/rails_app/app/controllers/articles_controller.rb
|
371
|
+
- spec/rails_app/app/controllers/comments_controller.rb
|
269
372
|
- spec/rails_app/app/controllers/concerns/.keep
|
270
373
|
- spec/rails_app/app/helpers/application_helper.rb
|
271
374
|
- spec/rails_app/app/mailers/.keep
|
272
375
|
- spec/rails_app/app/models/.keep
|
376
|
+
- spec/rails_app/app/models/admin.rb
|
273
377
|
- spec/rails_app/app/models/article.rb
|
274
378
|
- spec/rails_app/app/models/comment.rb
|
275
379
|
- spec/rails_app/app/models/concerns/.keep
|
380
|
+
- spec/rails_app/app/models/dummy/dummy_base.rb
|
381
|
+
- spec/rails_app/app/models/dummy/dummy_notifiable.rb
|
382
|
+
- spec/rails_app/app/models/dummy/dummy_notifier.rb
|
383
|
+
- spec/rails_app/app/models/dummy/dummy_target.rb
|
276
384
|
- spec/rails_app/app/models/user.rb
|
385
|
+
- spec/rails_app/app/views/activity_notification/notifications/default/custom/_path_test.html.erb
|
386
|
+
- spec/rails_app/app/views/activity_notification/notifications/default/custom/_test.html.erb
|
387
|
+
- spec/rails_app/app/views/activity_notification/notifications/users/_custom_index.html.erb
|
388
|
+
- spec/rails_app/app/views/activity_notification/notifications/users/custom/_test.html.erb
|
389
|
+
- spec/rails_app/app/views/articles/_form.html.erb
|
390
|
+
- spec/rails_app/app/views/articles/edit.html.erb
|
391
|
+
- spec/rails_app/app/views/articles/index.html.erb
|
392
|
+
- spec/rails_app/app/views/articles/new.html.erb
|
393
|
+
- spec/rails_app/app/views/articles/show.html.erb
|
394
|
+
- spec/rails_app/app/views/layouts/_header.html.erb
|
277
395
|
- spec/rails_app/app/views/layouts/application.html.erb
|
278
396
|
- spec/rails_app/bin/bundle
|
279
397
|
- spec/rails_app/bin/rails
|
@@ -297,13 +415,19 @@ test_files:
|
|
297
415
|
- spec/rails_app/config/initializers/mime_types.rb
|
298
416
|
- spec/rails_app/config/initializers/session_store.rb
|
299
417
|
- spec/rails_app/config/initializers/wrap_parameters.rb
|
418
|
+
- spec/rails_app/config/locales/activity_notification.en.yml
|
419
|
+
- spec/rails_app/config/locales/devise.en.yml
|
300
420
|
- spec/rails_app/config/routes.rb
|
301
421
|
- spec/rails_app/config/secrets.yml
|
302
422
|
- spec/rails_app/db/migrate/20160715050420_create_notifications.rb
|
303
423
|
- spec/rails_app/db/migrate/20160715050433_create_test_tables.rb
|
304
424
|
- spec/rails_app/db/schema.rb
|
425
|
+
- spec/rails_app/db/seeds.rb
|
305
426
|
- spec/rails_app/public/404.html
|
306
427
|
- spec/rails_app/public/422.html
|
307
428
|
- spec/rails_app/public/500.html
|
308
429
|
- spec/rails_app/public/favicon.ico
|
430
|
+
- spec/roles/acts_as_notifiable_spec.rb
|
431
|
+
- spec/roles/acts_as_notifier_spec.rb
|
432
|
+
- spec/roles/acts_as_target_spec.rb
|
309
433
|
- spec/spec_helper.rb
|