recommendable 2.0.4 → 2.0.4.20130313
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/recommendable.rb +4 -1
- data/lib/recommendable/helpers/queriers.rb +1 -1
- data/lib/recommendable/version.rb +1 -1
- data/lib/recommendable/workers/torque_box.rb +15 -0
- metadata +4 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b9fb8bf4282ccc0eeb6ef72f38ff05c007e50229
|
4
|
+
data.tar.gz: 26d9e3d87b8d9059d9fa0002647d947f261f5224
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 03456dbe5383f44f54160e332d2a2375109f1d94caa57b4878842777ede88f0e50714e13611bd6e0f3d3741efc8aa07c5951834d4e09076bf5e51154a2ba992f
|
7
|
+
data.tar.gz: 58bda95c326eba0a1e3296d41ee4241f47a70f2773875c3bd0009ac1509b0c55db06e6185d222ad6a5b0e07e009619c7af6a248bab1aba82399895ef7fb753ad
|
data/lib/recommendable.rb
CHANGED
@@ -10,6 +10,7 @@ require 'recommendable/ratable'
|
|
10
10
|
require 'recommendable/workers/sidekiq'
|
11
11
|
require 'recommendable/workers/resque'
|
12
12
|
require 'recommendable/workers/delayed_job'
|
13
|
+
require 'recommendable/workers/torque_box'
|
13
14
|
require 'recommendable/workers/rails'
|
14
15
|
|
15
16
|
module Recommendable
|
@@ -31,6 +32,8 @@ module Recommendable
|
|
31
32
|
Resque.enqueue(Recommendable::Workers::Resque, user_id)
|
32
33
|
elsif defined?(::Delayed::Job)
|
33
34
|
Delayed::Job.enqueue(Recommendable::Workers::DelayedJob.new(user_id))
|
35
|
+
elsif defined?(::TorqueBox::Messaging::Backgroundable)
|
36
|
+
Recommendable::Workers::TorqueBox.enqueue(user_id)
|
34
37
|
elsif defined?(::Rails::Queueing)
|
35
38
|
unless Rails.queue.any? { |w| w.user_id == user_id }
|
36
39
|
Rails.queue.push(Recommendable::Workers::Rails.new(user_id))
|
@@ -45,4 +48,4 @@ require 'recommendable/orm/active_record' if defined?(ActiveRecord::Base)
|
|
45
48
|
require 'recommendable/orm/data_mapper' if defined?(DataMapper::Resource)
|
46
49
|
require 'recommendable/orm/mongoid' if defined?(Mongoid::Document)
|
47
50
|
require 'recommendable/orm/mongo_mapper' if defined?(MongoMapper::Document)
|
48
|
-
require 'recommendable/orm/sequel' if defined?(Sequel::Model)
|
51
|
+
require 'recommendable/orm/sequel' if defined?(Sequel::Model)
|
@@ -0,0 +1,15 @@
|
|
1
|
+
module Recommendable
|
2
|
+
module Workers
|
3
|
+
class TorqueBox
|
4
|
+
if defined?(::TorqueBox::Messaging::Backgroundable)
|
5
|
+
include ::TorqueBox::Messaging::Backgroundable
|
6
|
+
always_background :enqueue
|
7
|
+
end
|
8
|
+
|
9
|
+
def self.enqueue(user_id)
|
10
|
+
Recommendable::Helpers::Calculations.update_similarities_for(user_id)
|
11
|
+
Recommendable::Helpers::Calculations.update_recommendations_for(user_id)
|
12
|
+
end
|
13
|
+
end
|
14
|
+
end
|
15
|
+
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: recommendable
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.0.4
|
4
|
+
version: 2.0.4.20130313
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- David Celis
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2013-
|
11
|
+
date: 2013-03-13 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|
@@ -168,6 +168,7 @@ files:
|
|
168
168
|
- lib/recommendable/workers/rails.rb
|
169
169
|
- lib/recommendable/workers/resque.rb
|
170
170
|
- lib/recommendable/workers/sidekiq.rb
|
171
|
+
- lib/recommendable/workers/torque_box.rb
|
171
172
|
- lib/recommendable.rb
|
172
173
|
homepage: https://github.com/davidcelis/recommendable
|
173
174
|
licenses: []
|
@@ -188,7 +189,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
188
189
|
version: '0'
|
189
190
|
requirements: []
|
190
191
|
rubyforge_project:
|
191
|
-
rubygems_version: 2.0.
|
192
|
+
rubygems_version: 2.0.2
|
192
193
|
signing_key:
|
193
194
|
specification_version: 4
|
194
195
|
summary: A Like/Dislike recommendation engine for Ruby apps using Redis
|