Permalink
Browse files

update readme and gemspec

  • Loading branch information...
1 parent e21bed7 commit bfc4f28744b0efb04eac7ea582849695fa47f9c3 @siuying committed Jan 21, 2012
View
@@ -0,0 +1 @@
+{"active":{"default":"1afb7771-2825-4c28-b4d4-87e11ab92be8"}}
View
@@ -1,23 +1,41 @@
-= coletivo
+= coletivo-mongoid
+
+A simple Rails 3 recommendations engine for Mongoid models.
-A simple Rails 3 recommendations engine.
Coletivo uses {Euclidean Distance}[http://en.wikipedia.org/wiki/Euclidean_distance] or {Pearson's Correlation Coefficient}[http://en.wikipedia.org/wiki/Pearson_product-moment_correlation_coefficient] to calculate the similarity between persons and their preferences.
+This is a fork of {coletivo}[https://github.com/diogenes/coletivo], if you need ActiveRecord support, check coletivo.
+
== Installation:
- sudo gem install coletivo
- rails g coletivo
- rake db:migrate
+ sudo gem install coletivo-mongoid
+
+ or in your rails app, add following line in Gemfile:
+
+ gem "coletivo-mongoid"
== Usage:
At your Rails model that represents a person (can be an _User_, _Member_, or something like that):
- class User < ActiveRecord::Base
+ class User
+ include Mongoid::Document
+ include Coletivo::Models::Person
+ include Coletivo::Models::Recommendable
has_own_preferences
# ...
end
+
+At your models that represent something that can be recommend (such as _Movie_):
+
+ class Movie
+ include Mongoid::Document
+ include Coletivo::Models::Person
+ include Coletivo::Models::Recommendable
+
+ # ...
+ end
So, a person can rate things:
@@ -34,7 +52,7 @@ By default, the similarity strategy used is Euclidean Distance, but you can chan
Movie.find_recommendations_for(current_user, :strategy => :pearson)
-== Contributing to coletivo
+== Contributing to coletivo-mongoid
* Check out the latest master to make sure the feature hasn't been implemented or the bug hasn't been fixed yet
* Check out the issue tracker to make sure someone already hasn't requested it and/or contributed it
@@ -46,5 +64,7 @@ By default, the similarity strategy used is Euclidean Distance, but you can chan
== Copyright
-Copyright (c) 2011 Diógenes Falcão. See LICENSE.txt for
-further details.
+Copyright (c) 2011 Diógenes Falcão.
+Copyright (c) 2012 Francis Chong.
+
+See LICENSE.txt for further details.
View
@@ -14,13 +14,13 @@ require 'rake'
require 'jeweler'
Jeweler::Tasks.new do |gem|
# gem is a Gem::Specification... see http://docs.rubygems.org/read/chapter/20 for more options
- gem.name = "coletivo"
- gem.homepage = "http://github.com/diogenes/coletivo"
+ gem.name = "coletivo-mongoid"
+ gem.homepage = "http://github.com/siuying/coletivo-mongoid"
gem.license = "MIT"
- gem.summary = %Q{A simple Rails 3 recommendations engine}
- gem.description = %Q{A simple Rails 3 recommendations engine}
- gem.email = "diogenes.araujo@gmail.com"
- gem.authors = ["Diógenes Falcão"]
+ gem.summary = %Q{A simple Rails 3 recommendations engine using Mongoid models}
+ gem.description = %Q{A simple Rails 3 recommendations engine using Mongoid models}
+ gem.email = "francis@ignition.hk"
+ gem.authors = ["Francis Chong", "Diógenes Falcão"]
gem.files = Dir["{lib}/**/*"]
# dependencies defined in Gemfile
end
@@ -0,0 +1,66 @@
+# Generated by jeweler
+# DO NOT EDIT THIS FILE DIRECTLY
+# Instead, edit Jeweler::Tasks in Rakefile, and run 'rake gemspec'
+# -*- encoding: utf-8 -*-
+
+Gem::Specification.new do |s|
+ s.name = "coletivo-mongoid"
+ s.version = "0.0.3"
+
+ s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
+ s.authors = ["Francis Chong", "Di\u{f3}genes Falc\u{e3}o"]
+ s.date = "2012-01-21"
+ s.description = "A simple Rails 3 recommendations engine using Mongoid models"
+ s.email = "francis@ignition.hk"
+ s.extra_rdoc_files = [
+ "LICENSE.txt",
+ "README.rdoc"
+ ]
+ s.files = [
+ "lib/coletivo.rb",
+ "lib/coletivo/models/person.rb",
+ "lib/coletivo/models/person_rating.rb",
+ "lib/coletivo/models/recommendable.rb",
+ "lib/coletivo/rails/engine.rb",
+ "lib/coletivo/similarity/base_strategy.rb",
+ "lib/coletivo/similarity/engine.rb",
+ "lib/coletivo/similarity/euclidean_distance_strategy.rb",
+ "lib/coletivo/similarity/pearson_correlation_strategy.rb"
+ ]
+ s.homepage = "http://github.com/siuying/coletivo-mongoid"
+ s.licenses = ["MIT"]
+ s.require_paths = ["lib"]
+ s.rubygems_version = "1.8.10"
+ s.summary = "A simple Rails 3 recommendations engine using Mongoid models"
+
+ if s.respond_to? :specification_version then
+ s.specification_version = 3
+
+ if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
+ s.add_runtime_dependency(%q<rails>, [">= 3.0.7"])
+ s.add_development_dependency(%q<shoulda>, ["~> 3.0.0.beta2"])
+ s.add_development_dependency(%q<bundler>, ["~> 1.0.14"])
+ s.add_development_dependency(%q<jeweler>, ["~> 1.6.2"])
+ s.add_development_dependency(%q<turn>, [">= 0"])
+ s.add_development_dependency(%q<mongoid>, [">= 2.0.0"])
+ s.add_development_dependency(%q<bson_ext>, [">= 0"])
+ else
+ s.add_dependency(%q<rails>, [">= 3.0.7"])
+ s.add_dependency(%q<shoulda>, ["~> 3.0.0.beta2"])
+ s.add_dependency(%q<bundler>, ["~> 1.0.14"])
+ s.add_dependency(%q<jeweler>, ["~> 1.6.2"])
+ s.add_dependency(%q<turn>, [">= 0"])
+ s.add_dependency(%q<mongoid>, [">= 2.0.0"])
+ s.add_dependency(%q<bson_ext>, [">= 0"])
+ end
+ else
+ s.add_dependency(%q<rails>, [">= 3.0.7"])
+ s.add_dependency(%q<shoulda>, ["~> 3.0.0.beta2"])
+ s.add_dependency(%q<bundler>, ["~> 1.0.14"])
+ s.add_dependency(%q<jeweler>, ["~> 1.6.2"])
+ s.add_dependency(%q<turn>, [">= 0"])
+ s.add_dependency(%q<mongoid>, [">= 2.0.0"])
+ s.add_dependency(%q<bson_ext>, [">= 0"])
+ end
+end
+
View
@@ -4,14 +4,14 @@
# -*- encoding: utf-8 -*-
Gem::Specification.new do |s|
- s.name = %q{coletivo}
+ s.name = "coletivo-mongoid"
s.version = "0.0.3"
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
- s.authors = ["Di\303\263genes Falc\303\243o"]
- s.date = %q{2011-10-31}
- s.description = %q{A simple Rails 3 recommendations engine}
- s.email = %q{diogenes.araujo@gmail.com}
+ s.authors = ["Di\u{f3}genes Falc\u{e3}o"]
+ s.date = "2012-01-21"
+ s.description = "A simple Rails 3 recommendations engine"
+ s.email = "diogenes.araujo@gmail.com"
s.extra_rdoc_files = [
"LICENSE.txt",
"README.rdoc"
@@ -21,23 +21,19 @@ Gem::Specification.new do |s|
"lib/coletivo/models/person.rb",
"lib/coletivo/models/person_rating.rb",
"lib/coletivo/models/recommendable.rb",
- "lib/coletivo/rails/active_record.rb",
"lib/coletivo/rails/engine.rb",
"lib/coletivo/similarity/base_strategy.rb",
"lib/coletivo/similarity/engine.rb",
"lib/coletivo/similarity/euclidean_distance_strategy.rb",
- "lib/coletivo/similarity/pearson_correlation_strategy.rb",
- "lib/generators/coletivo/coletivo_generator.rb",
- "lib/generators/coletivo/templates/person_ratings_migration.rb"
+ "lib/coletivo/similarity/pearson_correlation_strategy.rb"
]
- s.homepage = %q{http://github.com/diogenes/coletivo}
+ s.homepage = "http://github.com/diogenes/coletivo"
s.licenses = ["MIT"]
s.require_paths = ["lib"]
- s.rubygems_version = %q{1.3.7}
- s.summary = %q{A simple Rails 3 recommendations engine}
+ s.rubygems_version = "1.8.10"
+ s.summary = "A simple Rails 3 recommendations engine"
if s.respond_to? :specification_version then
- current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION
s.specification_version = 3
if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
@@ -46,22 +42,25 @@ Gem::Specification.new do |s|
s.add_development_dependency(%q<bundler>, ["~> 1.0.14"])
s.add_development_dependency(%q<jeweler>, ["~> 1.6.2"])
s.add_development_dependency(%q<turn>, [">= 0"])
- s.add_development_dependency(%q<sqlite3>, [">= 0"])
+ s.add_development_dependency(%q<mongoid>, [">= 2.0.0"])
+ s.add_development_dependency(%q<bson_ext>, [">= 0"])
else
s.add_dependency(%q<rails>, [">= 3.0.7"])
s.add_dependency(%q<shoulda>, ["~> 3.0.0.beta2"])
s.add_dependency(%q<bundler>, ["~> 1.0.14"])
s.add_dependency(%q<jeweler>, ["~> 1.6.2"])
s.add_dependency(%q<turn>, [">= 0"])
- s.add_dependency(%q<sqlite3>, [">= 0"])
+ s.add_dependency(%q<mongoid>, [">= 2.0.0"])
+ s.add_dependency(%q<bson_ext>, [">= 0"])
end
else
s.add_dependency(%q<rails>, [">= 3.0.7"])
s.add_dependency(%q<shoulda>, ["~> 3.0.0.beta2"])
s.add_dependency(%q<bundler>, ["~> 1.0.14"])
s.add_dependency(%q<jeweler>, ["~> 1.6.2"])
s.add_dependency(%q<turn>, [">= 0"])
- s.add_dependency(%q<sqlite3>, [">= 0"])
+ s.add_dependency(%q<mongoid>, [">= 2.0.0"])
+ s.add_dependency(%q<bson_ext>, [">= 0"])
end
end
@@ -1,24 +0,0 @@
-require 'rails/generators'
-require 'rails/generators/migration'
-
-class ColetivoGenerator < Rails::Generators::Base
- include Rails::Generators::Migration
-
- def self.source_root
- File.join(File.dirname(__FILE__), 'templates')
- end
-
- # Implement the required interface for Rails::Generators::Migration.
- def self.next_migration_number(dirname) #:nodoc:
- if ActiveRecord::Base.timestamped_migrations
- Time.now.utc.strftime("%Y%m%d%H%M%S")
- else
- "%.3d" % (current_migration_number(dirname) + 1)
- end
- end
-
- def create_migration_file
- migration_template 'person_ratings_migration.rb',
- 'db/migrate/create_person_ratings.rb'
- end
-end
@@ -1,21 +0,0 @@
-class CreatePersonRatings < ActiveRecord::Migration
- def self.up
- create_table :person_ratings do |t|
- t.integer :person_id
- t.string :person_type
-
- t.integer :rateable_id
- t.string :rateable_type
-
- t.decimal :weight, :precision => 5, :scale => 2
-
- t.timestamps
- end
-
- add_index :person_ratings, :rateable_type, :unique => false
- end
-
- def self.down
- drop_table :person_ratings
- end
-end

0 comments on commit bfc4f28

Please sign in to comment.