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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 07fcec48e728616ac9731c2eaef4e763daa25585
4
- data.tar.gz: c4b6aa9598500b23b50c2b94bd611d5092ea453a
3
+ metadata.gz: b9fb8bf4282ccc0eeb6ef72f38ff05c007e50229
4
+ data.tar.gz: 26d9e3d87b8d9059d9fa0002647d947f261f5224
5
5
  SHA512:
6
- metadata.gz: e27c4646cd1f26fc25f1380189c618034e2fe440ae2c85f7e7c2629c7d1be0b892465f4fd32f122538c29989e9754faee84a5f7a8921ddaee9cc660b752ad530
7
- data.tar.gz: 058cc8e715b3e8a0dd03b926d505b57ca079e2e67d26985dc4ac58e8d1c66a9702a46ec9ac850779ea242b152a858502a32ed74eb2284dfc287e841f4caef9a1
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)
@@ -11,7 +11,7 @@ module Recommendable
11
11
  end
12
12
 
13
13
  def mongoid(klass, ids)
14
- klass.where(:id => ids)
14
+ klass.where(:id.in => ids)
15
15
  end
16
16
 
17
17
  def mongo_mapper(klass, ids)
@@ -2,7 +2,7 @@ module Recommendable
2
2
  MAJOR = 2
3
3
  MINOR = 0
4
4
  PATCH = 4
5
- PRE = nil
5
+ PRE = 20130313
6
6
 
7
7
  VERSION = [MAJOR, MINOR, PATCH, PRE].compact.join '.'
8
8
  end
@@ -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-02-25 00:00:00.000000000 Z
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.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