tekeya 0.0.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (92) hide show
  1. data/.document +0 -0
  2. data/.gitignore +23 -0
  3. data/.rspec +3 -0
  4. data/.yardopts +1 -0
  5. data/Gemfile +39 -0
  6. data/Guardfile +40 -0
  7. data/LICENSE +22 -0
  8. data/README.md +37 -0
  9. data/Rakefile +13 -0
  10. data/TODO.todo +8 -0
  11. data/app/active_record/tekeya/activity.rb +7 -0
  12. data/app/active_record/tekeya/attachment.rb +5 -0
  13. data/app/active_record/tekeya/notification.rb +5 -0
  14. data/app/mongoid/tekeya/activity.rb +9 -0
  15. data/app/mongoid/tekeya/attachment.rb +6 -0
  16. data/app/mongoid/tekeya/notification.rb +10 -0
  17. data/db/migrate/00_create_activities.rb +11 -0
  18. data/db/migrate/01_create_attachments.rb +13 -0
  19. data/db/migrate/02_create_notifications.rb +14 -0
  20. data/lib/tasks/resque_tasks.rake +3 -0
  21. data/lib/tekeya.rb +81 -0
  22. data/lib/tekeya/configuration.rb +48 -0
  23. data/lib/tekeya/entity.rb +432 -0
  24. data/lib/tekeya/entity/group.rb +22 -0
  25. data/lib/tekeya/errors/tekeya_error.rb +11 -0
  26. data/lib/tekeya/errors/tekeya_fatal.rb +11 -0
  27. data/lib/tekeya/errors/tekeya_non_entity.rb +6 -0
  28. data/lib/tekeya/errors/tekeya_non_group.rb +6 -0
  29. data/lib/tekeya/errors/tekeya_relation_already_exists.rb +6 -0
  30. data/lib/tekeya/errors/tekeya_relation_non_existent.rb +6 -0
  31. data/lib/tekeya/feed/activity.rb +101 -0
  32. data/lib/tekeya/feed/activity/feed_item.rb +58 -0
  33. data/lib/tekeya/feed/activity/resque.rb +56 -0
  34. data/lib/tekeya/feed/activity/resque/activity_fanout.rb +61 -0
  35. data/lib/tekeya/feed/activity/resque/delete_activity.rb +43 -0
  36. data/lib/tekeya/feed/activity/resque/feed_copy.rb +34 -0
  37. data/lib/tekeya/feed/activity/resque/untrack_feed.rb +34 -0
  38. data/lib/tekeya/feed/attachable.rb +15 -0
  39. data/lib/tekeya/feed/attachment.rb +19 -0
  40. data/lib/tekeya/feed/notification.rb +93 -0
  41. data/lib/tekeya/railtie.rb +18 -0
  42. data/lib/tekeya/version.rb +3 -0
  43. data/spec/fabricators/attachment_fabricator.rb +3 -0
  44. data/spec/fabricators/group_fabricator.rb +4 -0
  45. data/spec/fabricators/status_fabricator.rb +3 -0
  46. data/spec/fabricators/user_fabricator.rb +3 -0
  47. data/spec/orm/active_record.rb +14 -0
  48. data/spec/orm/mongoid.rb +6 -0
  49. data/spec/rails_app/Rakefile +7 -0
  50. data/spec/rails_app/app/active_record/group.rb +3 -0
  51. data/spec/rails_app/app/active_record/status.rb +3 -0
  52. data/spec/rails_app/app/active_record/user.rb +3 -0
  53. data/spec/rails_app/app/controllers/application_controller.rb +3 -0
  54. data/spec/rails_app/app/helpers/application_helper.rb +2 -0
  55. data/spec/rails_app/app/mongoid/group.rb +6 -0
  56. data/spec/rails_app/app/mongoid/status.rb +6 -0
  57. data/spec/rails_app/app/mongoid/user.rb +7 -0
  58. data/spec/rails_app/app/views/layouts/application.html.erb +14 -0
  59. data/spec/rails_app/config.ru +4 -0
  60. data/spec/rails_app/config/application.rb +35 -0
  61. data/spec/rails_app/config/boot.rb +8 -0
  62. data/spec/rails_app/config/database.yml +21 -0
  63. data/spec/rails_app/config/environment.rb +5 -0
  64. data/spec/rails_app/config/environments/development.rb +18 -0
  65. data/spec/rails_app/config/environments/production.rb +33 -0
  66. data/spec/rails_app/config/environments/test.rb +33 -0
  67. data/spec/rails_app/config/initializers/backtrace_silencers.rb +7 -0
  68. data/spec/rails_app/config/initializers/configure_mongoid.rb +6 -0
  69. data/spec/rails_app/config/initializers/inflections.rb +15 -0
  70. data/spec/rails_app/config/initializers/resque.rb +1 -0
  71. data/spec/rails_app/config/initializers/secret_token.rb +7 -0
  72. data/spec/rails_app/config/locales/en.yml +5 -0
  73. data/spec/rails_app/config/routes.rb +58 -0
  74. data/spec/rails_app/db/migrate/100_create_users.rb +9 -0
  75. data/spec/rails_app/db/migrate/101_create_groups.rb +11 -0
  76. data/spec/rails_app/db/migrate/102_create_statuses.rb +9 -0
  77. data/spec/rails_app/db/seeds.rb +7 -0
  78. data/spec/rails_app/public/404.html +26 -0
  79. data/spec/rails_app/public/422.html +26 -0
  80. data/spec/rails_app/public/500.html +25 -0
  81. data/spec/rails_app/public/favicon.ico +0 -0
  82. data/spec/rails_app/public/index.html +241 -0
  83. data/spec/rails_app/public/robots.txt +5 -0
  84. data/spec/rails_app/script/rails +6 -0
  85. data/spec/spec_helper.rb +78 -0
  86. data/spec/tekeya/activity_spec.rb +170 -0
  87. data/spec/tekeya/entity_spec.rb +158 -0
  88. data/spec/tekeya/notification_spec.rb +49 -0
  89. data/spec/tekeya_helper.rb +7 -0
  90. data/spec/tekeya_spec.rb +51 -0
  91. data/tekeya.gemspec +22 -0
  92. metadata +231 -0
@@ -0,0 +1,7 @@
1
+ Tekeya.configure do |config|
2
+ config.redis_host = "localhost"
3
+ config.redis_port = "9736"
4
+ config.rebatdb_host = "localhost"
5
+ config.rebatdb_port = "2011"
6
+ config.feed_storage_orm = TEKEYA_ORM
7
+ end
@@ -0,0 +1,51 @@
1
+ require File.expand_path(File.dirname(__FILE__) + '/spec_helper')
2
+
3
+ describe "Tekeya" do
4
+ describe "loading" do
5
+ !(defined?(Rails).nil?).should == true
6
+ !(defined?(ActiveRecord).nil?).should == true
7
+ !(defined?(Mongoid).nil?).should == true
8
+ !(defined?(Configuration).nil?).should == true
9
+ !(defined?(Entity).nil?).should == true
10
+ !(defined?(Entity::Group).nil?).should == true
11
+ end
12
+
13
+ describe "configuration" do
14
+ it "should hold the correct data" do
15
+ Tekeya::Configuration.instance.redis_host.should == "localhost"
16
+ Tekeya::Configuration.instance.redis_port.should == "9736"
17
+ Tekeya::Configuration.instance.rebatdb_host.should == "localhost"
18
+ Tekeya::Configuration.instance.rebatdb_port.should == "2011"
19
+ Tekeya::Configuration.instance.feed_storage_orm.should == TEKEYA_ORM
20
+ end
21
+
22
+ describe "YML configuration" do
23
+ before :all do
24
+ conf_file = "#{File.dirname(__FILE__)}/../tmp/tekeya_config.yml"
25
+
26
+ f = File.new(conf_file, 'w')
27
+ doc = %Q{
28
+ test:
29
+ redis_host: 'localhost'
30
+ redis_port: '9736'
31
+ rebatdb_host: 'localhost'
32
+ rebatdb_port: '2011'
33
+ feed_storage_orm: #{TEKEYA_ORM}
34
+ }
35
+
36
+ f.puts(doc)
37
+ f.close
38
+
39
+ Tekeya::Configuration.instance.parse_config_file(conf_file)
40
+ end
41
+
42
+ it "should hold the correct data loaded from the yml" do
43
+ Tekeya::Configuration.instance.redis_host.should == "localhost"
44
+ Tekeya::Configuration.instance.redis_port.should == "9736"
45
+ Tekeya::Configuration.instance.rebatdb_host.should == "localhost"
46
+ Tekeya::Configuration.instance.rebatdb_port.should == "2011"
47
+ Tekeya::Configuration.instance.feed_storage_orm.should == TEKEYA_ORM.to_s
48
+ end
49
+ end
50
+ end
51
+ end
@@ -0,0 +1,22 @@
1
+ # -*- encoding: utf-8 -*-
2
+ require File.expand_path('../lib/tekeya/version', __FILE__)
3
+
4
+ Gem::Specification.new do |gem|
5
+ gem.authors = ["Omar Mekky", "Khaled Gomaa"]
6
+ gem.email = ["omar.mekky@mashsolvents.com", "khaled.gomaa@mashsolvents.com"]
7
+ gem.description = %q{a social engine for Rails applications based on Redis and RebatDB}
8
+ gem.summary = %q{a social engine for Rails applications based on Redis and RebatDB.}
9
+ gem.homepage = ""
10
+
11
+ gem.files = `git ls-files`.split($\)
12
+ gem.executables = gem.files.grep(%r{^bin/}).map{ |f| File.basename(f) }
13
+ gem.test_files = gem.files.grep(%r{^(test|spec|features)/})
14
+ gem.name = "tekeya"
15
+ gem.require_paths = ["lib"]
16
+ gem.version = Tekeya::VERSION
17
+
18
+ gem.add_dependency 'redis', '~> 3.0.1'
19
+ gem.add_dependency 'rebat', '~> 0.1.4'
20
+ gem.add_dependency 'resque', '~> 1.23.0'
21
+ gem.add_dependency 'railties', '~> 3.1'
22
+ end
metadata ADDED
@@ -0,0 +1,231 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: tekeya
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.1
5
+ prerelease:
6
+ platform: ruby
7
+ authors:
8
+ - Omar Mekky
9
+ - Khaled Gomaa
10
+ autorequire:
11
+ bindir: bin
12
+ cert_chain: []
13
+ date: 2012-11-01 00:00:00.000000000 Z
14
+ dependencies:
15
+ - !ruby/object:Gem::Dependency
16
+ name: redis
17
+ requirement: &70216688754400 !ruby/object:Gem::Requirement
18
+ none: false
19
+ requirements:
20
+ - - ~>
21
+ - !ruby/object:Gem::Version
22
+ version: 3.0.1
23
+ type: :runtime
24
+ prerelease: false
25
+ version_requirements: *70216688754400
26
+ - !ruby/object:Gem::Dependency
27
+ name: rebat
28
+ requirement: &70216688751180 !ruby/object:Gem::Requirement
29
+ none: false
30
+ requirements:
31
+ - - ~>
32
+ - !ruby/object:Gem::Version
33
+ version: 0.1.4
34
+ type: :runtime
35
+ prerelease: false
36
+ version_requirements: *70216688751180
37
+ - !ruby/object:Gem::Dependency
38
+ name: resque
39
+ requirement: &70216688745300 !ruby/object:Gem::Requirement
40
+ none: false
41
+ requirements:
42
+ - - ~>
43
+ - !ruby/object:Gem::Version
44
+ version: 1.23.0
45
+ type: :runtime
46
+ prerelease: false
47
+ version_requirements: *70216688745300
48
+ - !ruby/object:Gem::Dependency
49
+ name: railties
50
+ requirement: &70216688741740 !ruby/object:Gem::Requirement
51
+ none: false
52
+ requirements:
53
+ - - ~>
54
+ - !ruby/object:Gem::Version
55
+ version: '3.1'
56
+ type: :runtime
57
+ prerelease: false
58
+ version_requirements: *70216688741740
59
+ description: a social engine for Rails applications based on Redis and RebatDB
60
+ email:
61
+ - omar.mekky@mashsolvents.com
62
+ - khaled.gomaa@mashsolvents.com
63
+ executables: []
64
+ extensions: []
65
+ extra_rdoc_files: []
66
+ files:
67
+ - .document
68
+ - .gitignore
69
+ - .rspec
70
+ - .yardopts
71
+ - Gemfile
72
+ - Guardfile
73
+ - LICENSE
74
+ - README.md
75
+ - Rakefile
76
+ - TODO.todo
77
+ - app/active_record/tekeya/activity.rb
78
+ - app/active_record/tekeya/attachment.rb
79
+ - app/active_record/tekeya/notification.rb
80
+ - app/mongoid/tekeya/activity.rb
81
+ - app/mongoid/tekeya/attachment.rb
82
+ - app/mongoid/tekeya/notification.rb
83
+ - db/migrate/00_create_activities.rb
84
+ - db/migrate/01_create_attachments.rb
85
+ - db/migrate/02_create_notifications.rb
86
+ - lib/tasks/resque_tasks.rake
87
+ - lib/tekeya.rb
88
+ - lib/tekeya/configuration.rb
89
+ - lib/tekeya/entity.rb
90
+ - lib/tekeya/entity/group.rb
91
+ - lib/tekeya/errors/tekeya_error.rb
92
+ - lib/tekeya/errors/tekeya_fatal.rb
93
+ - lib/tekeya/errors/tekeya_non_entity.rb
94
+ - lib/tekeya/errors/tekeya_non_group.rb
95
+ - lib/tekeya/errors/tekeya_relation_already_exists.rb
96
+ - lib/tekeya/errors/tekeya_relation_non_existent.rb
97
+ - lib/tekeya/feed/activity.rb
98
+ - lib/tekeya/feed/activity/feed_item.rb
99
+ - lib/tekeya/feed/activity/resque.rb
100
+ - lib/tekeya/feed/activity/resque/activity_fanout.rb
101
+ - lib/tekeya/feed/activity/resque/delete_activity.rb
102
+ - lib/tekeya/feed/activity/resque/feed_copy.rb
103
+ - lib/tekeya/feed/activity/resque/untrack_feed.rb
104
+ - lib/tekeya/feed/attachable.rb
105
+ - lib/tekeya/feed/attachment.rb
106
+ - lib/tekeya/feed/notification.rb
107
+ - lib/tekeya/railtie.rb
108
+ - lib/tekeya/version.rb
109
+ - spec/fabricators/attachment_fabricator.rb
110
+ - spec/fabricators/group_fabricator.rb
111
+ - spec/fabricators/status_fabricator.rb
112
+ - spec/fabricators/user_fabricator.rb
113
+ - spec/orm/active_record.rb
114
+ - spec/orm/mongoid.rb
115
+ - spec/rails_app/Rakefile
116
+ - spec/rails_app/app/active_record/group.rb
117
+ - spec/rails_app/app/active_record/status.rb
118
+ - spec/rails_app/app/active_record/user.rb
119
+ - spec/rails_app/app/controllers/application_controller.rb
120
+ - spec/rails_app/app/helpers/application_helper.rb
121
+ - spec/rails_app/app/mongoid/group.rb
122
+ - spec/rails_app/app/mongoid/status.rb
123
+ - spec/rails_app/app/mongoid/user.rb
124
+ - spec/rails_app/app/views/layouts/application.html.erb
125
+ - spec/rails_app/config.ru
126
+ - spec/rails_app/config/application.rb
127
+ - spec/rails_app/config/boot.rb
128
+ - spec/rails_app/config/database.yml
129
+ - spec/rails_app/config/environment.rb
130
+ - spec/rails_app/config/environments/development.rb
131
+ - spec/rails_app/config/environments/production.rb
132
+ - spec/rails_app/config/environments/test.rb
133
+ - spec/rails_app/config/initializers/backtrace_silencers.rb
134
+ - spec/rails_app/config/initializers/configure_mongoid.rb
135
+ - spec/rails_app/config/initializers/inflections.rb
136
+ - spec/rails_app/config/initializers/resque.rb
137
+ - spec/rails_app/config/initializers/secret_token.rb
138
+ - spec/rails_app/config/locales/en.yml
139
+ - spec/rails_app/config/routes.rb
140
+ - spec/rails_app/db/migrate/100_create_users.rb
141
+ - spec/rails_app/db/migrate/101_create_groups.rb
142
+ - spec/rails_app/db/migrate/102_create_statuses.rb
143
+ - spec/rails_app/db/seeds.rb
144
+ - spec/rails_app/public/404.html
145
+ - spec/rails_app/public/422.html
146
+ - spec/rails_app/public/500.html
147
+ - spec/rails_app/public/favicon.ico
148
+ - spec/rails_app/public/index.html
149
+ - spec/rails_app/public/robots.txt
150
+ - spec/rails_app/script/rails
151
+ - spec/spec_helper.rb
152
+ - spec/tekeya/activity_spec.rb
153
+ - spec/tekeya/entity_spec.rb
154
+ - spec/tekeya/notification_spec.rb
155
+ - spec/tekeya_helper.rb
156
+ - spec/tekeya_spec.rb
157
+ - tekeya.gemspec
158
+ homepage: ''
159
+ licenses: []
160
+ post_install_message:
161
+ rdoc_options: []
162
+ require_paths:
163
+ - lib
164
+ required_ruby_version: !ruby/object:Gem::Requirement
165
+ none: false
166
+ requirements:
167
+ - - ! '>='
168
+ - !ruby/object:Gem::Version
169
+ version: '0'
170
+ required_rubygems_version: !ruby/object:Gem::Requirement
171
+ none: false
172
+ requirements:
173
+ - - ! '>='
174
+ - !ruby/object:Gem::Version
175
+ version: '0'
176
+ requirements: []
177
+ rubyforge_project:
178
+ rubygems_version: 1.8.17
179
+ signing_key:
180
+ specification_version: 3
181
+ summary: a social engine for Rails applications based on Redis and RebatDB.
182
+ test_files:
183
+ - spec/fabricators/attachment_fabricator.rb
184
+ - spec/fabricators/group_fabricator.rb
185
+ - spec/fabricators/status_fabricator.rb
186
+ - spec/fabricators/user_fabricator.rb
187
+ - spec/orm/active_record.rb
188
+ - spec/orm/mongoid.rb
189
+ - spec/rails_app/Rakefile
190
+ - spec/rails_app/app/active_record/group.rb
191
+ - spec/rails_app/app/active_record/status.rb
192
+ - spec/rails_app/app/active_record/user.rb
193
+ - spec/rails_app/app/controllers/application_controller.rb
194
+ - spec/rails_app/app/helpers/application_helper.rb
195
+ - spec/rails_app/app/mongoid/group.rb
196
+ - spec/rails_app/app/mongoid/status.rb
197
+ - spec/rails_app/app/mongoid/user.rb
198
+ - spec/rails_app/app/views/layouts/application.html.erb
199
+ - spec/rails_app/config.ru
200
+ - spec/rails_app/config/application.rb
201
+ - spec/rails_app/config/boot.rb
202
+ - spec/rails_app/config/database.yml
203
+ - spec/rails_app/config/environment.rb
204
+ - spec/rails_app/config/environments/development.rb
205
+ - spec/rails_app/config/environments/production.rb
206
+ - spec/rails_app/config/environments/test.rb
207
+ - spec/rails_app/config/initializers/backtrace_silencers.rb
208
+ - spec/rails_app/config/initializers/configure_mongoid.rb
209
+ - spec/rails_app/config/initializers/inflections.rb
210
+ - spec/rails_app/config/initializers/resque.rb
211
+ - spec/rails_app/config/initializers/secret_token.rb
212
+ - spec/rails_app/config/locales/en.yml
213
+ - spec/rails_app/config/routes.rb
214
+ - spec/rails_app/db/migrate/100_create_users.rb
215
+ - spec/rails_app/db/migrate/101_create_groups.rb
216
+ - spec/rails_app/db/migrate/102_create_statuses.rb
217
+ - spec/rails_app/db/seeds.rb
218
+ - spec/rails_app/public/404.html
219
+ - spec/rails_app/public/422.html
220
+ - spec/rails_app/public/500.html
221
+ - spec/rails_app/public/favicon.ico
222
+ - spec/rails_app/public/index.html
223
+ - spec/rails_app/public/robots.txt
224
+ - spec/rails_app/script/rails
225
+ - spec/spec_helper.rb
226
+ - spec/tekeya/activity_spec.rb
227
+ - spec/tekeya/entity_spec.rb
228
+ - spec/tekeya/notification_spec.rb
229
+ - spec/tekeya_helper.rb
230
+ - spec/tekeya_spec.rb
231
+ has_rdoc: