live-activity 0.3.4 → 0.3.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.travis.yml +6 -1
- data/CHANGELOG.md +5 -0
- data/Gemfile +2 -1
- data/README.md +1 -1
- data/Rakefile +0 -7
- data/lib/generators/{live_stream.rb → live_activity.rb} +0 -0
- data/lib/generators/{live_stream → live_activity}/activity/activity_generator.rb +1 -1
- data/lib/generators/{live_stream → live_activity}/activity/templates/activity.rb +0 -0
- data/lib/generators/{live_stream → live_activity}/migration/migration_generator.rb +2 -2
- data/lib/generators/{live_stream → live_activity}/migration/templates/migration.rb +1 -6
- data/lib/live_activity/activity.rb +3 -0
- data/lib/live_activity/definition.rb +2 -1
- data/lib/live_activity/definition_dsl.rb +1 -1
- data/lib/live_activity/version.rb +1 -1
- data/live-activity.gemspec +4 -1
- data/test/migrations/001_create_activities.rb +1 -6
- data/test/migrations/006_create_activities_users.rb +17 -0
- data/test/test_helper.rb +9 -1
- data/test/unit/activity_test.rb +10 -0
- metadata +27 -9
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 687349dee0f379d285ab9a208d537b170b064223
|
4
|
+
data.tar.gz: bb123d00cb41b4c9bebebf5f0a22bbfdcd81898a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 08d86992884bb7de883a507c2c8d5b324445db4cc406dbe7e3ebe70482e869f57ba0c675c2ed9afb6d4d8e2d14756da72dfbf7d9cb2e48fd7e60546d654c1fa7
|
7
|
+
data.tar.gz: 67b4a783a24e6953bba013fb841bdcff80ff4b4e5f215126af59a7a2b840e3ba594ca9e9e61b850eb2fe71890d7f7f416dab1cf5dbb0d7f3fec7a9ba8024dab8
|
data/.travis.yml
CHANGED
data/CHANGELOG.md
ADDED
data/Gemfile
CHANGED
data/README.md
CHANGED
data/Rakefile
CHANGED
@@ -1,16 +1,9 @@
|
|
1
1
|
require "bundler/gem_tasks"
|
2
2
|
require 'rake'
|
3
|
-
require 'yard'
|
4
|
-
require 'yard/rake/yardoc_task'
|
5
3
|
require 'rake/testtask'
|
6
4
|
|
7
5
|
task :default => :test
|
8
6
|
|
9
|
-
desc 'Generate documentation for the live_stream plugin.'
|
10
|
-
YARD::Rake::YardocTask.new do |doc|
|
11
|
-
doc.files = ['lib/**/*.rb']
|
12
|
-
end
|
13
|
-
|
14
7
|
Rake::TestTask.new do |t|
|
15
8
|
t.libs << "test"
|
16
9
|
t.test_files = FileList['test/test*.rb', 'test/unit/*_test.rb']
|
File without changes
|
File without changes
|
@@ -1,7 +1,7 @@
|
|
1
|
-
require 'generators/
|
1
|
+
require 'generators/live_activity'
|
2
2
|
require 'rails/generators/active_record'
|
3
3
|
|
4
|
-
module
|
4
|
+
module LiveActivity
|
5
5
|
module Generators
|
6
6
|
# Migration generator that creates migration file from template
|
7
7
|
class MigrationGenerator < ActiveRecord::Generators::Base
|
@@ -8,6 +8,7 @@ class CreateActivities < ActiveRecord::Migration
|
|
8
8
|
t.belongs_to :act_target, :polymorphic => true
|
9
9
|
|
10
10
|
t.string :verb
|
11
|
+
t.string :reverses
|
11
12
|
t.string :description
|
12
13
|
t.string :options
|
13
14
|
t.string :bond_type
|
@@ -15,12 +16,6 @@ class CreateActivities < ActiveRecord::Migration
|
|
15
16
|
t.timestamps
|
16
17
|
end
|
17
18
|
|
18
|
-
create_table :activities_users, :id => false do |t|
|
19
|
-
t.references :activity, :user
|
20
|
-
end
|
21
|
-
|
22
|
-
add_index :activities_users, [:activity_id, :user_id ]
|
23
|
-
|
24
19
|
add_index :activities, [:verb]
|
25
20
|
add_index :activities, [:actor_id, :actor_type]
|
26
21
|
add_index :activities, [:act_object_id, :act_object_type]
|
@@ -2,7 +2,7 @@ module LiveActivity
|
|
2
2
|
|
3
3
|
class Definition
|
4
4
|
|
5
|
-
attr_reader :name, :actor, :act_object, :act_target, :grouped_actor, :bond_type, :options, :receivers
|
5
|
+
attr_reader :name, :actor, :act_object, :act_target, :grouped_actor, :bond_type, :reverses, :options, :receivers
|
6
6
|
|
7
7
|
# @param dsl [LiveActivity::DefinitionDSL] A DSL act_object
|
8
8
|
def initialize(definition)
|
@@ -13,6 +13,7 @@ module LiveActivity
|
|
13
13
|
@grouped_actor = definition[:grouped_actor] || nil
|
14
14
|
@bond_type = definition[:bond_type] || nil
|
15
15
|
@options = definition[:options] || []
|
16
|
+
@reverses = definition[:reverses] || nil
|
16
17
|
end
|
17
18
|
|
18
19
|
#
|
data/live-activity.gemspec
CHANGED
@@ -11,6 +11,7 @@ Gem::Specification.new do |s|
|
|
11
11
|
s.summary = %q{Activity Streams for rails}
|
12
12
|
s.description = %q{LiveActivity is a simple activity stream gem for use with the ActiveRecord ODM framework}
|
13
13
|
s.homepage = 'https://github.com/digitalplaywright/live-activity'
|
14
|
+
s.license = 'MIT'
|
14
15
|
|
15
16
|
s.rubyforge_project = "live-activity"
|
16
17
|
|
@@ -19,9 +20,11 @@ Gem::Specification.new do |s|
|
|
19
20
|
s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
|
20
21
|
s.require_paths = ["lib"]
|
21
22
|
|
22
|
-
s.required_ruby_version = '>= 1.9.
|
23
|
+
s.required_ruby_version = '>= 1.9.3'
|
23
24
|
|
24
25
|
s.add_dependency 'activerecord', '>= 3'
|
25
26
|
s.add_dependency 'activesupport', '>= 3'
|
26
27
|
s.add_dependency 'actionpack', '>= 3'
|
28
|
+
s.add_development_dependency 'rake'
|
29
|
+
|
27
30
|
end
|
@@ -8,6 +8,7 @@ class CreateActivities < ActiveRecord::Migration
|
|
8
8
|
t.belongs_to :act_target, :polymorphic => true
|
9
9
|
|
10
10
|
t.string :verb
|
11
|
+
t.string :reverses
|
11
12
|
t.string :description
|
12
13
|
t.string :options
|
13
14
|
t.string :bond_type
|
@@ -15,12 +16,6 @@ class CreateActivities < ActiveRecord::Migration
|
|
15
16
|
t.timestamps
|
16
17
|
end
|
17
18
|
|
18
|
-
create_table :activities_users, :id => false do |t|
|
19
|
-
t.references :activity, :user
|
20
|
-
end
|
21
|
-
|
22
|
-
add_index :activities_users, [:activity_id, :user_id ]
|
23
|
-
|
24
19
|
add_index :activities, [:verb]
|
25
20
|
add_index :activities, [:actor_id, :actor_type]
|
26
21
|
add_index :activities, [:act_object_id, :act_object_type]
|
@@ -0,0 +1,17 @@
|
|
1
|
+
# Migration responsible for creating a table with activities
|
2
|
+
class CreateActivitiesUsers < ActiveRecord::Migration
|
3
|
+
# Create table
|
4
|
+
def self.up
|
5
|
+
|
6
|
+
create_table :activities_users, :id => false do |t|
|
7
|
+
t.references :activity, :user
|
8
|
+
end
|
9
|
+
|
10
|
+
add_index :activities_users, [:activity_id, :user_id ]
|
11
|
+
|
12
|
+
end
|
13
|
+
# Drop table
|
14
|
+
def self.down
|
15
|
+
drop_table :activities_users
|
16
|
+
end
|
17
|
+
end
|
data/test/test_helper.rb
CHANGED
@@ -7,7 +7,7 @@ require 'active_support/testing/setup_and_teardown'
|
|
7
7
|
require 'live_activity'
|
8
8
|
require 'minitest/autorun'
|
9
9
|
|
10
|
-
#
|
10
|
+
#LiveActivity.config # touch config to load ORM, needed in some separate tests
|
11
11
|
|
12
12
|
require 'active_record'
|
13
13
|
require 'active_record/connection_adapters/sqlite3_adapter'
|
@@ -56,6 +56,14 @@ class Activity < ActiveRecord::Base
|
|
56
56
|
bond_type :global
|
57
57
|
end
|
58
58
|
|
59
|
+
activity :test_reverses_bond_type do
|
60
|
+
actor :User
|
61
|
+
act_object :Article
|
62
|
+
act_target :Volume
|
63
|
+
bond_type :global
|
64
|
+
reverses :test_bond_type
|
65
|
+
end
|
66
|
+
|
59
67
|
end
|
60
68
|
|
61
69
|
class User < ActiveRecord::Base
|
data/test/unit/activity_test.rb
CHANGED
@@ -77,6 +77,16 @@ class ActivityTest < ActiveSupport::TestCase
|
|
77
77
|
|
78
78
|
end
|
79
79
|
|
80
|
+
def test_reverses_bond_type
|
81
|
+
_user = User.create()
|
82
|
+
_article = Article.create()
|
83
|
+
_volume = Volume.create()
|
84
|
+
|
85
|
+
_activity = Activity.publish(:test_reverses_bond_type, :actor => _user, :act_object => _article, :act_target => _volume)
|
86
|
+
|
87
|
+
assert _activity.reverses == 'test_bond_type'
|
88
|
+
|
89
|
+
end
|
80
90
|
|
81
91
|
|
82
92
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: live-activity
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.3.
|
4
|
+
version: 0.3.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Andreas Saebjoernsen
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2013-07-
|
11
|
+
date: 2013-07-11 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activerecord
|
@@ -52,6 +52,20 @@ dependencies:
|
|
52
52
|
- - '>='
|
53
53
|
- !ruby/object:Gem::Version
|
54
54
|
version: '3'
|
55
|
+
- !ruby/object:Gem::Dependency
|
56
|
+
name: rake
|
57
|
+
requirement: !ruby/object:Gem::Requirement
|
58
|
+
requirements:
|
59
|
+
- - '>='
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: '0'
|
62
|
+
type: :development
|
63
|
+
prerelease: false
|
64
|
+
version_requirements: !ruby/object:Gem::Requirement
|
65
|
+
requirements:
|
66
|
+
- - '>='
|
67
|
+
- !ruby/object:Gem::Version
|
68
|
+
version: '0'
|
55
69
|
description: LiveActivity is a simple activity stream gem for use with the ActiveRecord
|
56
70
|
ODM framework
|
57
71
|
email:
|
@@ -64,15 +78,16 @@ files:
|
|
64
78
|
- .gitignore
|
65
79
|
- .rspec
|
66
80
|
- .travis.yml
|
81
|
+
- CHANGELOG.md
|
67
82
|
- Gemfile
|
68
83
|
- LICENSE.txt
|
69
84
|
- README.md
|
70
85
|
- Rakefile
|
71
|
-
- lib/generators/
|
72
|
-
- lib/generators/
|
73
|
-
- lib/generators/
|
74
|
-
- lib/generators/
|
75
|
-
- lib/generators/
|
86
|
+
- lib/generators/live_activity.rb
|
87
|
+
- lib/generators/live_activity/activity/activity_generator.rb
|
88
|
+
- lib/generators/live_activity/activity/templates/activity.rb
|
89
|
+
- lib/generators/live_activity/migration/migration_generator.rb
|
90
|
+
- lib/generators/live_activity/migration/templates/migration.rb
|
76
91
|
- lib/live_activity.rb
|
77
92
|
- lib/live_activity/activity.rb
|
78
93
|
- lib/live_activity/actor.rb
|
@@ -86,13 +101,15 @@ files:
|
|
86
101
|
- test/migrations/003_create_users.rb
|
87
102
|
- test/migrations/004_add_nonstandard_to_activities.rb
|
88
103
|
- test/migrations/005_create_volumes.rb
|
104
|
+
- test/migrations/006_create_activities_users.rb
|
89
105
|
- test/test_helper.rb
|
90
106
|
- test/unit/activity_test.rb
|
91
107
|
- test/unit/actor_test.rb
|
92
108
|
- test/unit/definition_dsl_test.rb
|
93
109
|
- test/unit/definition_test.rb
|
94
110
|
homepage: https://github.com/digitalplaywright/live-activity
|
95
|
-
licenses:
|
111
|
+
licenses:
|
112
|
+
- MIT
|
96
113
|
metadata: {}
|
97
114
|
post_install_message:
|
98
115
|
rdoc_options: []
|
@@ -102,7 +119,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
102
119
|
requirements:
|
103
120
|
- - '>='
|
104
121
|
- !ruby/object:Gem::Version
|
105
|
-
version: 1.9.
|
122
|
+
version: 1.9.3
|
106
123
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
107
124
|
requirements:
|
108
125
|
- - '>='
|
@@ -120,6 +137,7 @@ test_files:
|
|
120
137
|
- test/migrations/003_create_users.rb
|
121
138
|
- test/migrations/004_add_nonstandard_to_activities.rb
|
122
139
|
- test/migrations/005_create_volumes.rb
|
140
|
+
- test/migrations/006_create_activities_users.rb
|
123
141
|
- test/test_helper.rb
|
124
142
|
- test/unit/activity_test.rb
|
125
143
|
- test/unit/actor_test.rb
|