recommendable 0.1.2
Sign up to get free protection for your applications and to get access to all the features.
- data/.gitignore +57 -0
- data/.travis.yml +3 -0
- data/Gemfile +17 -0
- data/Gemfile.lock +118 -0
- data/LICENSE.txt +20 -0
- data/README.markdown +340 -0
- data/Rakefile +26 -0
- data/TODO +6 -0
- data/app/jobs/recommendable/recommendation_refresher.rb +12 -0
- data/app/models/recommendable/dislike.rb +9 -0
- data/app/models/recommendable/ignore.rb +9 -0
- data/app/models/recommendable/like.rb +9 -0
- data/app/models/recommendable/stashed_item.rb +9 -0
- data/config/routes.rb +3 -0
- data/db/migrate/20120124193723_create_likes.rb +17 -0
- data/db/migrate/20120124193728_create_dislikes.rb +17 -0
- data/db/migrate/20120127092558_create_ignores.rb +17 -0
- data/db/migrate/20120131173909_create_stashed_items.rb +17 -0
- data/lib/generators/recommendable/USAGE +8 -0
- data/lib/generators/recommendable/install_generator.rb +47 -0
- data/lib/generators/recommendable/templates/initializer.rb +18 -0
- data/lib/recommendable.rb +19 -0
- data/lib/recommendable/acts_as_recommendable.rb +85 -0
- data/lib/recommendable/acts_as_recommended_to.rb +659 -0
- data/lib/recommendable/engine.rb +13 -0
- data/lib/recommendable/exceptions.rb +4 -0
- data/lib/recommendable/railtie.rb +6 -0
- data/lib/recommendable/version.rb +3 -0
- data/lib/tasks/recommendable_tasks.rake +1 -0
- data/recommendable.gemspec +32 -0
- data/script/rails +8 -0
- data/spec/configuration_spec.rb +9 -0
- data/spec/dummy/README.rdoc +261 -0
- data/spec/dummy/Rakefile +7 -0
- data/spec/dummy/app/assets/javascripts/application.js +15 -0
- data/spec/dummy/app/assets/stylesheets/application.css +13 -0
- data/spec/dummy/app/controllers/application_controller.rb +3 -0
- data/spec/dummy/app/helpers/application_helper.rb +2 -0
- data/spec/dummy/app/mailers/.gitkeep +0 -0
- data/spec/dummy/app/models/.gitkeep +0 -0
- data/spec/dummy/app/models/bully.rb +2 -0
- data/spec/dummy/app/models/movie.rb +3 -0
- data/spec/dummy/app/models/php_framework.rb +2 -0
- data/spec/dummy/app/models/user.rb +3 -0
- data/spec/dummy/app/views/layouts/application.html.erb +14 -0
- data/spec/dummy/config.ru +4 -0
- data/spec/dummy/config/application.rb +56 -0
- data/spec/dummy/config/boot.rb +10 -0
- data/spec/dummy/config/database.yml +25 -0
- data/spec/dummy/config/environment.rb +5 -0
- data/spec/dummy/config/environments/development.rb +37 -0
- data/spec/dummy/config/environments/production.rb +67 -0
- data/spec/dummy/config/environments/test.rb +37 -0
- data/spec/dummy/config/initializers/backtrace_silencers.rb +7 -0
- data/spec/dummy/config/initializers/inflections.rb +15 -0
- data/spec/dummy/config/initializers/mime_types.rb +5 -0
- data/spec/dummy/config/initializers/recommendable.rb +16 -0
- data/spec/dummy/config/initializers/secret_token.rb +7 -0
- data/spec/dummy/config/initializers/session_store.rb +8 -0
- data/spec/dummy/config/initializers/wrap_parameters.rb +14 -0
- data/spec/dummy/config/locales/en.yml +5 -0
- data/spec/dummy/config/routes.rb +4 -0
- data/spec/dummy/db/migrate/20120128005553_create_likes.recommendable.rb +18 -0
- data/spec/dummy/db/migrate/20120128005554_create_dislikes.recommendable.rb +18 -0
- data/spec/dummy/db/migrate/20120128005555_create_ignores.recommendable.rb +18 -0
- data/spec/dummy/db/migrate/20120128020228_create_users.rb +9 -0
- data/spec/dummy/db/migrate/20120128020413_create_movies.rb +10 -0
- data/spec/dummy/db/migrate/20120128024632_create_php_frameworks.rb +9 -0
- data/spec/dummy/db/migrate/20120128024804_create_bullies.rb +9 -0
- data/spec/dummy/db/migrate/20120131195416_create_stashed_items.recommendable.rb +18 -0
- data/spec/dummy/db/schema.rb +89 -0
- data/spec/dummy/lib/assets/.gitkeep +0 -0
- data/spec/dummy/log/.gitkeep +0 -0
- data/spec/dummy/public/404.html +26 -0
- data/spec/dummy/public/422.html +26 -0
- data/spec/dummy/public/500.html +25 -0
- data/spec/dummy/public/favicon.ico +0 -0
- data/spec/dummy/recommendable_dummy_development +0 -0
- data/spec/dummy/recommendable_dummy_test +0 -0
- data/spec/dummy/script/rails +6 -0
- data/spec/factories.rb +16 -0
- data/spec/models/dislike_spec.rb +27 -0
- data/spec/models/ignore_spec.rb +27 -0
- data/spec/models/like_spec.rb +28 -0
- data/spec/models/stashed_item_spec.rb +27 -0
- data/spec/models/user_benchmark_spec.rb +49 -0
- data/spec/models/user_spec.rb +320 -0
- data/spec/spec_helper.rb +28 -0
- metadata +254 -0
data/spec/spec_helper.rb
ADDED
@@ -0,0 +1,28 @@
|
|
1
|
+
# Configure Rails Environment
|
2
|
+
ENV["RAILS_ENV"] = "test"
|
3
|
+
|
4
|
+
require File.expand_path("../dummy/config/environment.rb", __FILE__)
|
5
|
+
require "rails/test_help"
|
6
|
+
|
7
|
+
require 'minitest/autorun'
|
8
|
+
require 'minitest/benchmark' if ENV["BENCH"]
|
9
|
+
require 'minitest/pride'
|
10
|
+
|
11
|
+
require 'miniskirt'
|
12
|
+
require 'factories'
|
13
|
+
|
14
|
+
Rails.backtrace_cleaner.remove_silencers!
|
15
|
+
|
16
|
+
# Load support files
|
17
|
+
Dir["#{File.dirname(__FILE__)}/support/**/*.rb"].each { |f| require f }
|
18
|
+
|
19
|
+
class MiniTest::Spec
|
20
|
+
include ActiveSupport::Testing::SetupAndTeardown
|
21
|
+
include ActiveRecord::TestFixtures
|
22
|
+
|
23
|
+
alias :method_name :__name__ if defined? :__name__
|
24
|
+
self.fixture_path = File.join( Rails.root, 'test', 'fixtures' )
|
25
|
+
end
|
26
|
+
|
27
|
+
# Select the Redis test database
|
28
|
+
Recommendable.redis.select "15"
|
metadata
ADDED
@@ -0,0 +1,254 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: recommendable
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.1.2
|
5
|
+
prerelease:
|
6
|
+
platform: ruby
|
7
|
+
authors:
|
8
|
+
- David Celis
|
9
|
+
autorequire:
|
10
|
+
bindir: bin
|
11
|
+
cert_chain: []
|
12
|
+
date: 2012-01-28 00:00:00.000000000 Z
|
13
|
+
dependencies:
|
14
|
+
- !ruby/object:Gem::Dependency
|
15
|
+
name: sqlite3
|
16
|
+
requirement: &70238498735420 !ruby/object:Gem::Requirement
|
17
|
+
none: false
|
18
|
+
requirements:
|
19
|
+
- - ! '>='
|
20
|
+
- !ruby/object:Gem::Version
|
21
|
+
version: '0'
|
22
|
+
type: :development
|
23
|
+
prerelease: false
|
24
|
+
version_requirements: *70238498735420
|
25
|
+
- !ruby/object:Gem::Dependency
|
26
|
+
name: minitest
|
27
|
+
requirement: &70238498734880 !ruby/object:Gem::Requirement
|
28
|
+
none: false
|
29
|
+
requirements:
|
30
|
+
- - ! '>='
|
31
|
+
- !ruby/object:Gem::Version
|
32
|
+
version: '0'
|
33
|
+
type: :development
|
34
|
+
prerelease: false
|
35
|
+
version_requirements: *70238498734880
|
36
|
+
- !ruby/object:Gem::Dependency
|
37
|
+
name: shoulda
|
38
|
+
requirement: &70238498734380 !ruby/object:Gem::Requirement
|
39
|
+
none: false
|
40
|
+
requirements:
|
41
|
+
- - ! '>='
|
42
|
+
- !ruby/object:Gem::Version
|
43
|
+
version: '0'
|
44
|
+
type: :development
|
45
|
+
prerelease: false
|
46
|
+
version_requirements: *70238498734380
|
47
|
+
- !ruby/object:Gem::Dependency
|
48
|
+
name: yard
|
49
|
+
requirement: &70238498749840 !ruby/object:Gem::Requirement
|
50
|
+
none: false
|
51
|
+
requirements:
|
52
|
+
- - ~>
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: 0.6.0
|
55
|
+
type: :development
|
56
|
+
prerelease: false
|
57
|
+
version_requirements: *70238498749840
|
58
|
+
- !ruby/object:Gem::Dependency
|
59
|
+
name: bundler
|
60
|
+
requirement: &70238498749020 !ruby/object:Gem::Requirement
|
61
|
+
none: false
|
62
|
+
requirements:
|
63
|
+
- - ~>
|
64
|
+
- !ruby/object:Gem::Version
|
65
|
+
version: 1.0.0
|
66
|
+
type: :development
|
67
|
+
prerelease: false
|
68
|
+
version_requirements: *70238498749020
|
69
|
+
- !ruby/object:Gem::Dependency
|
70
|
+
name: jeweler
|
71
|
+
requirement: &70238498748140 !ruby/object:Gem::Requirement
|
72
|
+
none: false
|
73
|
+
requirements:
|
74
|
+
- - ~>
|
75
|
+
- !ruby/object:Gem::Version
|
76
|
+
version: 1.6.4
|
77
|
+
type: :development
|
78
|
+
prerelease: false
|
79
|
+
version_requirements: *70238498748140
|
80
|
+
- !ruby/object:Gem::Dependency
|
81
|
+
name: rcov
|
82
|
+
requirement: &70238498746940 !ruby/object:Gem::Requirement
|
83
|
+
none: false
|
84
|
+
requirements:
|
85
|
+
- - ! '>='
|
86
|
+
- !ruby/object:Gem::Version
|
87
|
+
version: '0'
|
88
|
+
type: :development
|
89
|
+
prerelease: false
|
90
|
+
version_requirements: *70238498746940
|
91
|
+
- !ruby/object:Gem::Dependency
|
92
|
+
name: rails
|
93
|
+
requirement: &70238498745320 !ruby/object:Gem::Requirement
|
94
|
+
none: false
|
95
|
+
requirements:
|
96
|
+
- - ! '>='
|
97
|
+
- !ruby/object:Gem::Version
|
98
|
+
version: 3.0.0
|
99
|
+
type: :runtime
|
100
|
+
prerelease: false
|
101
|
+
version_requirements: *70238498745320
|
102
|
+
- !ruby/object:Gem::Dependency
|
103
|
+
name: redis
|
104
|
+
requirement: &70238498744040 !ruby/object:Gem::Requirement
|
105
|
+
none: false
|
106
|
+
requirements:
|
107
|
+
- - ~>
|
108
|
+
- !ruby/object:Gem::Version
|
109
|
+
version: 2.2.0
|
110
|
+
type: :runtime
|
111
|
+
prerelease: false
|
112
|
+
version_requirements: *70238498744040
|
113
|
+
- !ruby/object:Gem::Dependency
|
114
|
+
name: resque
|
115
|
+
requirement: &70238498758460 !ruby/object:Gem::Requirement
|
116
|
+
none: false
|
117
|
+
requirements:
|
118
|
+
- - ~>
|
119
|
+
- !ruby/object:Gem::Version
|
120
|
+
version: 1.19.0
|
121
|
+
type: :runtime
|
122
|
+
prerelease: false
|
123
|
+
version_requirements: *70238498758460
|
124
|
+
- !ruby/object:Gem::Dependency
|
125
|
+
name: resque-loner
|
126
|
+
requirement: &70238498757620 !ruby/object:Gem::Requirement
|
127
|
+
none: false
|
128
|
+
requirements:
|
129
|
+
- - ~>
|
130
|
+
- !ruby/object:Gem::Version
|
131
|
+
version: 1.2.0
|
132
|
+
type: :runtime
|
133
|
+
prerelease: false
|
134
|
+
version_requirements: *70238498757620
|
135
|
+
description: Allow a model (typically User) to Like and/or Dislike models in your
|
136
|
+
app. Generate recommendations quickly using redis.
|
137
|
+
email: david@davidcelis.com
|
138
|
+
executables: []
|
139
|
+
extensions: []
|
140
|
+
extra_rdoc_files: []
|
141
|
+
files:
|
142
|
+
- .gitignore
|
143
|
+
- .travis.yml
|
144
|
+
- Gemfile
|
145
|
+
- Gemfile.lock
|
146
|
+
- LICENSE.txt
|
147
|
+
- README.markdown
|
148
|
+
- Rakefile
|
149
|
+
- TODO
|
150
|
+
- app/jobs/recommendable/recommendation_refresher.rb
|
151
|
+
- app/models/recommendable/dislike.rb
|
152
|
+
- app/models/recommendable/ignore.rb
|
153
|
+
- app/models/recommendable/like.rb
|
154
|
+
- app/models/recommendable/stashed_item.rb
|
155
|
+
- config/routes.rb
|
156
|
+
- db/migrate/20120124193723_create_likes.rb
|
157
|
+
- db/migrate/20120124193728_create_dislikes.rb
|
158
|
+
- db/migrate/20120127092558_create_ignores.rb
|
159
|
+
- db/migrate/20120131173909_create_stashed_items.rb
|
160
|
+
- lib/generators/recommendable/USAGE
|
161
|
+
- lib/generators/recommendable/install_generator.rb
|
162
|
+
- lib/generators/recommendable/templates/initializer.rb
|
163
|
+
- lib/recommendable.rb
|
164
|
+
- lib/recommendable/acts_as_recommendable.rb
|
165
|
+
- lib/recommendable/acts_as_recommended_to.rb
|
166
|
+
- lib/recommendable/engine.rb
|
167
|
+
- lib/recommendable/exceptions.rb
|
168
|
+
- lib/recommendable/railtie.rb
|
169
|
+
- lib/recommendable/version.rb
|
170
|
+
- lib/tasks/recommendable_tasks.rake
|
171
|
+
- recommendable.gemspec
|
172
|
+
- script/rails
|
173
|
+
- spec/configuration_spec.rb
|
174
|
+
- spec/dummy/README.rdoc
|
175
|
+
- spec/dummy/Rakefile
|
176
|
+
- spec/dummy/app/assets/javascripts/application.js
|
177
|
+
- spec/dummy/app/assets/stylesheets/application.css
|
178
|
+
- spec/dummy/app/controllers/application_controller.rb
|
179
|
+
- spec/dummy/app/helpers/application_helper.rb
|
180
|
+
- spec/dummy/app/mailers/.gitkeep
|
181
|
+
- spec/dummy/app/models/.gitkeep
|
182
|
+
- spec/dummy/app/models/bully.rb
|
183
|
+
- spec/dummy/app/models/movie.rb
|
184
|
+
- spec/dummy/app/models/php_framework.rb
|
185
|
+
- spec/dummy/app/models/user.rb
|
186
|
+
- spec/dummy/app/views/layouts/application.html.erb
|
187
|
+
- spec/dummy/config.ru
|
188
|
+
- spec/dummy/config/application.rb
|
189
|
+
- spec/dummy/config/boot.rb
|
190
|
+
- spec/dummy/config/database.yml
|
191
|
+
- spec/dummy/config/environment.rb
|
192
|
+
- spec/dummy/config/environments/development.rb
|
193
|
+
- spec/dummy/config/environments/production.rb
|
194
|
+
- spec/dummy/config/environments/test.rb
|
195
|
+
- spec/dummy/config/initializers/backtrace_silencers.rb
|
196
|
+
- spec/dummy/config/initializers/inflections.rb
|
197
|
+
- spec/dummy/config/initializers/mime_types.rb
|
198
|
+
- spec/dummy/config/initializers/recommendable.rb
|
199
|
+
- spec/dummy/config/initializers/secret_token.rb
|
200
|
+
- spec/dummy/config/initializers/session_store.rb
|
201
|
+
- spec/dummy/config/initializers/wrap_parameters.rb
|
202
|
+
- spec/dummy/config/locales/en.yml
|
203
|
+
- spec/dummy/config/routes.rb
|
204
|
+
- spec/dummy/db/migrate/20120128005553_create_likes.recommendable.rb
|
205
|
+
- spec/dummy/db/migrate/20120128005554_create_dislikes.recommendable.rb
|
206
|
+
- spec/dummy/db/migrate/20120128005555_create_ignores.recommendable.rb
|
207
|
+
- spec/dummy/db/migrate/20120128020228_create_users.rb
|
208
|
+
- spec/dummy/db/migrate/20120128020413_create_movies.rb
|
209
|
+
- spec/dummy/db/migrate/20120128024632_create_php_frameworks.rb
|
210
|
+
- spec/dummy/db/migrate/20120128024804_create_bullies.rb
|
211
|
+
- spec/dummy/db/migrate/20120131195416_create_stashed_items.recommendable.rb
|
212
|
+
- spec/dummy/db/schema.rb
|
213
|
+
- spec/dummy/lib/assets/.gitkeep
|
214
|
+
- spec/dummy/log/.gitkeep
|
215
|
+
- spec/dummy/public/404.html
|
216
|
+
- spec/dummy/public/422.html
|
217
|
+
- spec/dummy/public/500.html
|
218
|
+
- spec/dummy/public/favicon.ico
|
219
|
+
- spec/dummy/recommendable_dummy_development
|
220
|
+
- spec/dummy/recommendable_dummy_test
|
221
|
+
- spec/dummy/script/rails
|
222
|
+
- spec/factories.rb
|
223
|
+
- spec/models/dislike_spec.rb
|
224
|
+
- spec/models/ignore_spec.rb
|
225
|
+
- spec/models/like_spec.rb
|
226
|
+
- spec/models/stashed_item_spec.rb
|
227
|
+
- spec/models/user_benchmark_spec.rb
|
228
|
+
- spec/models/user_spec.rb
|
229
|
+
- spec/spec_helper.rb
|
230
|
+
homepage: http://github.com/davidcelis/recommendable
|
231
|
+
licenses: []
|
232
|
+
post_install_message:
|
233
|
+
rdoc_options: []
|
234
|
+
require_paths:
|
235
|
+
- lib
|
236
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
237
|
+
none: false
|
238
|
+
requirements:
|
239
|
+
- - ! '>='
|
240
|
+
- !ruby/object:Gem::Version
|
241
|
+
version: '0'
|
242
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
243
|
+
none: false
|
244
|
+
requirements:
|
245
|
+
- - ! '>='
|
246
|
+
- !ruby/object:Gem::Version
|
247
|
+
version: '0'
|
248
|
+
requirements: []
|
249
|
+
rubyforge_project:
|
250
|
+
rubygems_version: 1.8.11
|
251
|
+
signing_key:
|
252
|
+
specification_version: 3
|
253
|
+
summary: Add like-based and/or dislike-based recommendations to your app.
|
254
|
+
test_files: []
|