chalk_dust 0.0.1 → 0.0.2

Sign up to get free protection for your applications and to get access to all the features.
@@ -3,4 +3,3 @@ rvm:
3
3
  - '1.9.2'
4
4
  - '1.9.3'
5
5
  - jruby-19mode
6
- - rbx-19mode
data/README.md CHANGED
@@ -15,7 +15,16 @@ activity items.
15
15
 
16
16
  Add this line to your application's Gemfile:
17
17
 
18
- gem 'chalk_dust'
18
+ ```ruby
19
+ gem 'chalk_dust'
20
+ ```
21
+
22
+ ChalkDust has a dependency on ActiveRecord and a soft dependency on Rails. If
23
+ you are using Rails you can install the migrations as follows:
24
+
25
+ ```
26
+ rails generate chalk_dust:install_migrations
27
+ ```
19
28
 
20
29
  ## Usage
21
30
 
@@ -1,4 +1,5 @@
1
1
  require "chalk_dust/version"
2
+ require "chalk_dust/rails" if defined?(Rails)
2
3
 
3
4
  module ChalkDust
4
5
  class Connection < ActiveRecord::Base
@@ -0,0 +1,5 @@
1
+ class ChalkDustRailtie < Rails::Railtie
2
+ generators do
3
+ require "chalk_dust/rails/generators/install_migrations"
4
+ end
5
+ end
@@ -0,0 +1,18 @@
1
+ require 'rails/generators/migration'
2
+ require 'rails/generators/active_record/migration'
3
+
4
+ module ChalkDust
5
+ module Generators
6
+ class InstallMigrations < Rails::Generators::Base
7
+ include Rails::Generators::Migration
8
+ extend ActiveRecord::Generators::Migration
9
+
10
+ source_root File.expand_path("../templates", __FILE__)
11
+
12
+ desc "Generates (but does not run) the migrations for chalk dust"
13
+ def install_migrations
14
+ migration_template "migration.rb", "db/migrate/chalk_dust_create_tables"
15
+ end
16
+ end
17
+ end
18
+ end
@@ -0,0 +1,26 @@
1
+ class ChalkDustCreateTables < ActiveRecord::Migration
2
+ def change
3
+ create_table :connections, :force => true do |t|
4
+ t.integer :subscriber_id
5
+ t.string :subscriber_type
6
+ t.integer :publisher_id
7
+ t.string :publisher_type
8
+ t.timestamps
9
+ end
10
+
11
+ add_index :connections, [:publisher_id, :publisher_type]
12
+
13
+ create_table :activity_items, :force => true do |t|
14
+ t.integer :performer_id
15
+ t.string :performer_type
16
+ t.string :event
17
+ t.integer :target_id
18
+ t.string :target_type
19
+ t.integer :owner_id
20
+ t.string :owner_type
21
+ t.timestamps
22
+ end
23
+
24
+ add_index :activity_items, [:owner_id, :owner_type, :created_at]
25
+ end
26
+ end
@@ -1,3 +1,3 @@
1
1
  module ChalkDust
2
- VERSION = "0.0.1"
2
+ VERSION = "0.0.2"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: chalk_dust
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.0.2
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2013-04-10 00:00:00.000000000 Z
12
+ date: 2013-04-11 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: activerecord
@@ -124,6 +124,9 @@ files:
124
124
  - Rakefile
125
125
  - chalk_dust.gemspec
126
126
  - lib/chalk_dust.rb
127
+ - lib/chalk_dust/rails.rb
128
+ - lib/chalk_dust/rails/generators/install_migrations.rb
129
+ - lib/chalk_dust/rails/generators/templates/migration.rb
127
130
  - lib/chalk_dust/version.rb
128
131
  - spec/lib/chalk_dust/activity_feeds_spec.rb
129
132
  - spec/lib/chalk_dust/publishing_spec.rb
@@ -143,21 +146,15 @@ required_ruby_version: !ruby/object:Gem::Requirement
143
146
  - - ! '>='
144
147
  - !ruby/object:Gem::Version
145
148
  version: '0'
146
- segments:
147
- - 0
148
- hash: -4022978035697313999
149
149
  required_rubygems_version: !ruby/object:Gem::Requirement
150
150
  none: false
151
151
  requirements:
152
152
  - - ! '>='
153
153
  - !ruby/object:Gem::Version
154
154
  version: '0'
155
- segments:
156
- - 0
157
- hash: -4022978035697313999
158
155
  requirements: []
159
156
  rubyforge_project:
160
- rubygems_version: 1.8.23
157
+ rubygems_version: 1.8.24
161
158
  signing_key:
162
159
  specification_version: 3
163
160
  summary: Subscribe to and build activity feeds for your models, for example followings
@@ -169,3 +166,4 @@ test_files:
169
166
  - spec/spec_helper.rb
170
167
  - spec/support/models.rb
171
168
  - spec/support/schema.rb
169
+ has_rdoc: