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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 1e7a59442940106f735c1f51b78cdfffbf2af112
4
- data.tar.gz: f3c6a923933fc08a349f84a66678aeaa59f0e35e
3
+ metadata.gz: 687349dee0f379d285ab9a208d537b170b064223
4
+ data.tar.gz: bb123d00cb41b4c9bebebf5f0a22bbfdcd81898a
5
5
  SHA512:
6
- metadata.gz: eb5d59b18952f24b3d72b26c0f2ebddefbbe233aceeb4137a2f8dfc92845eab8b94b5a7b91d2d2f917c52d292ba7b2100744a19dd7d4b913ea66f9aea8ca1542
7
- data.tar.gz: 46ad711ad33934fa65ac1b30409c51b1431345ac68aa4a50348166684ec60ffbb7851463f95580a1c966542f7c0b7868bdda8a801868a193b6447c19df4ee346
6
+ metadata.gz: 08d86992884bb7de883a507c2c8d5b324445db4cc406dbe7e3ebe70482e869f57ba0c675c2ed9afb6d4d8e2d14756da72dfbf7d9cb2e48fd7e60546d654c1fa7
7
+ data.tar.gz: 67b4a783a24e6953bba013fb841bdcff80ff4b4e5f215126af59a7a2b840e3ba594ca9e9e61b850eb2fe71890d7f7f416dab1cf5dbb0d7f3fec7a9ba8024dab8
@@ -1,2 +1,7 @@
1
+ language: ruby
2
+ services: SQLite3
3
+ gemfile:
4
+ - Gemfile
1
5
  rvm:
2
- - 1.9.2
6
+ - 1.9.3
7
+ - 2.0.0
@@ -0,0 +1,5 @@
1
+ # CHANGELOG
2
+
3
+ ## 0.3.2
4
+
5
+ * Add license to gemspec
data/Gemfile CHANGED
@@ -1,7 +1,8 @@
1
1
  source "http://rubygems.org"
2
2
 
3
3
  group :development, :test do
4
- gem 'sqlite3', '~> 1.3.7'
4
+ gem "sqlite3", :platform => [:ruby, :mswin, :mingw]
5
+ gem "jdbc-sqlite3", :platform => :jruby
5
6
  end
6
7
 
7
8
  # Specify your gem's dependencies in live_activity.gemspec
data/README.md CHANGED
@@ -16,7 +16,7 @@ This gem is inspired by Streama by Christopher Pappas.
16
16
  ### Create migration for activities and migrate the database (in your Rails project):
17
17
 
18
18
  ```ruby
19
- rails g public_activity:migration
19
+ rails g live_activity:migration
20
20
  rake db:migrate
21
21
  ```
22
22
 
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']
@@ -1,4 +1,4 @@
1
- require 'generators/live_stream'
1
+ require 'generators/live_activity'
2
2
  require 'rails/generators/active_record'
3
3
 
4
4
  module LiveActivity
@@ -1,7 +1,7 @@
1
- require 'generators/live_stream'
1
+ require 'generators/live_activity'
2
2
  require 'rails/generators/active_record'
3
3
 
4
- module LiveStream
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]
@@ -68,6 +68,9 @@ module LiveActivity
68
68
 
69
69
  self.verb = data.delete(:verb)
70
70
 
71
+ self.reverses = definition.reverses ? definition.reverses.to_s : nil
72
+
73
+
71
74
  cur_receivers = data.delete(:receivers)
72
75
 
73
76
 
@@ -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
  #
@@ -41,7 +41,7 @@ module LiveActivity
41
41
  end
42
42
  end
43
43
 
44
- data_methods :actor, :act_object, :act_target, :grouped_actor, :bond_type
44
+ data_methods :actor, :act_object, :act_target, :grouped_actor, :reverses, :bond_type
45
45
 
46
46
  end
47
47
 
@@ -1,3 +1,3 @@
1
1
  module LiveActivity
2
- VERSION = "0.3.4"
2
+ VERSION = "0.3.5"
3
3
  end
@@ -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.2'
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
@@ -7,7 +7,7 @@ require 'active_support/testing/setup_and_teardown'
7
7
  require 'live_activity'
8
8
  require 'minitest/autorun'
9
9
 
10
- #LiveStream.config # touch config to load ORM, needed in some separate tests
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
@@ -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
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-10 00:00:00.000000000 Z
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/live_stream.rb
72
- - lib/generators/live_stream/activity/activity_generator.rb
73
- - lib/generators/live_stream/activity/templates/activity.rb
74
- - lib/generators/live_stream/migration/migration_generator.rb
75
- - lib/generators/live_stream/migration/templates/migration.rb
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.2
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