acts_as_mongo_rateable 0.2.0 → 0.2.1

Sign up to get free protection for your applications and to get access to all the features.
data/Rakefile CHANGED
@@ -25,7 +25,7 @@ Rake::RDocTask.new(:rdoc) do |rdoc|
25
25
  end
26
26
 
27
27
 
28
- Echoe.new('acts_as_mongo_rateable', '0.2.0') do |p|
28
+ Echoe.new('acts_as_mongo_rateable', '0.2.1') do |p|
29
29
  p.description = "A ratings system for Rails apps using MongoDB, with bayesian and straight averages, and weighting."
30
30
  p.url = "http://github.com/mepatterson/acts_as_mongo_rateable"
31
31
  p.author = "M. E. Patterson"
@@ -2,12 +2,11 @@
2
2
 
3
3
  Gem::Specification.new do |s|
4
4
  s.name = %q{acts_as_mongo_rateable}
5
- s.version = "0.2.0"
5
+ s.version = "0.2.1"
6
6
 
7
7
  s.required_rubygems_version = Gem::Requirement.new(">= 1.2") if s.respond_to? :required_rubygems_version=
8
8
  s.authors = ["M. E. Patterson"]
9
- s.cert_chain = ["/Users/mattp/gem-public_cert.pem"]
10
- s.date = %q{2010-06-04}
9
+ s.date = %q{2010-09-21}
11
10
  s.description = %q{A ratings system for Rails apps using MongoDB, with bayesian and straight averages, and weighting.}
12
11
  s.email = %q{madraziel @nospam@ gmail.com}
13
12
  s.extra_rdoc_files = ["README.markdown", "lib/acts_as_mongo_rateable/acts_as_mongo_rateable.rb", "lib/acts_as_mongo_rateable/app/models/rating.rb", "lib/mongo_rateable.rb", "tasks/mongo_rateable_tasks.rake"]
@@ -16,8 +15,7 @@ Gem::Specification.new do |s|
16
15
  s.rdoc_options = ["--line-numbers", "--inline-source", "--title", "Acts_as_mongo_rateable", "--main", "README.markdown"]
17
16
  s.require_paths = ["lib"]
18
17
  s.rubyforge_project = %q{acts_as_mongo_rateable}
19
- s.rubygems_version = %q{1.3.7}
20
- s.signing_key = %q{/Users/mattp/gem-private_key.pem}
18
+ s.rubygems_version = %q{1.3.6}
21
19
  s.summary = %q{A ratings system for Rails apps using MongoDB, with bayesian and straight averages, and weighting.}
22
20
  s.test_files = ["test/mongo_rateable_test.rb", "test/test_helper.rb"]
23
21
 
@@ -25,7 +23,7 @@ Gem::Specification.new do |s|
25
23
  current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION
26
24
  s.specification_version = 3
27
25
 
28
- if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
26
+ if Gem::Version.new(Gem::RubyGemsVersion) >= Gem::Version.new('1.2.0') then
29
27
  else
30
28
  end
31
29
  else
@@ -38,7 +38,7 @@ module ActsAsMongoRateable
38
38
  def bayesian_rating(stats=nil)
39
39
  return 0 if rating_stats['count'] == 0
40
40
  stats ||= self.class.all({:select => 'id, rating_stats'})
41
- system_counts = stats.map{ |p| [ p.id.to_s, p.rating_stats['count'] ] }
41
+ system_counts = stats.map{ |p| [ p.id.to_s, p.rating_stats['count'] || 0 ] }
42
42
  avg_rating = stats.map{|p| p.rating_stats['average'] || 0 }.sum / stats.size.to_f
43
43
  avg_num_votes = system_counts.inject(0){|sum, r| sum += r.to_a.flatten[1] } / system_counts.size.to_f
44
44
  my_rating = rating_stats['average'] || 0
@@ -104,6 +104,5 @@ end
104
104
  %w{ models observers }.each do |dir|
105
105
  path = File.join(File.dirname(__FILE__), 'app', dir)
106
106
  $LOAD_PATH << path
107
- ActiveSupport::Dependencies.load_paths << path
108
- ActiveSupport::Dependencies.load_once_paths.delete(path)
107
+ ActiveSupport::Dependencies.autoload_paths << path
109
108
  end
@@ -12,7 +12,7 @@ class ActiveSupport::TestCase
12
12
  # Drop all columns after each test case.
13
13
  def teardown
14
14
  MongoMapper.database.collections.each do |coll|
15
- coll.drop
15
+ coll.remove
16
16
  end
17
17
  end
18
18
 
metadata CHANGED
@@ -1,42 +1,20 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: acts_as_mongo_rateable
3
3
  version: !ruby/object:Gem::Version
4
- hash: 23
5
4
  prerelease: false
6
5
  segments:
7
6
  - 0
8
7
  - 2
9
- - 0
10
- version: 0.2.0
8
+ - 1
9
+ version: 0.2.1
11
10
  platform: ruby
12
11
  authors:
13
12
  - M. E. Patterson
14
13
  autorequire:
15
14
  bindir: bin
16
- cert_chain:
17
- - |
18
- -----BEGIN CERTIFICATE-----
19
- MIIDNDCCAhygAwIBAgIBADANBgkqhkiG9w0BAQUFADBAMRIwEAYDVQQDDAltYWRy
20
- YXppZWwxFTATBgoJkiaJk/IsZAEZFgVnbWFpbDETMBEGCgmSJomT8ixkARkWA2Nv
21
- bTAeFw0xMDA2MDUwNDUxMThaFw0xMTA2MDUwNDUxMThaMEAxEjAQBgNVBAMMCW1h
22
- ZHJhemllbDEVMBMGCgmSJomT8ixkARkWBWdtYWlsMRMwEQYKCZImiZPyLGQBGRYD
23
- Y29tMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA2YYU8nBcWrz3Gls3
24
- B4tKCLGU/v11vuLeDU51r0/mUL/ev4GAZOrlBRaIn4U3J53W4Wa3fHGNqDyB7dt4
25
- eJS2a//eBv5MXtDxS0kuOeLen4sJiACN7WzoX/WaMiCdeLFebRFr6zDKtYMQZ1lM
26
- x+DWXbFLBuWfihZ8TapkBBG8Yuw2J+OcJla7t0IR3KHJSpOe0e9D/rHydly2v7kH
27
- 6naqt5n4jtpTXrmgLeGUQeVR60BJrHIbHXjgUCkPz3b/prreaRl/a4Cufv0cTPMD
28
- BFSOlmK6AKLii9gdaZMnLbF7b1Jc3rAcYNAsLHoUBGoq0Top8CTC732YrNZ7NmFp
29
- /Jn0nQIDAQABozkwNzAJBgNVHRMEAjAAMAsGA1UdDwQEAwIEsDAdBgNVHQ4EFgQU
30
- drmilB9ksqsW9hFPopqQEhcFdh8wDQYJKoZIhvcNAQEFBQADggEBAHPZLmxi4DYD
31
- qdSsUv4oTlWoK5nCbEpnJRpJZXn1rn30Zaoc5v7kQfVwz/x/4uZmLdvfysZmuvKZ
32
- GTMlYv/qSylO0SqbZeKhvsehQ+ENQdTon10zPtVvvnxiUE/As79eRmmxNGypJnwy
33
- WZH2x1I+Hd25mRbt1UspT2vmuEwTgzkmxGHnl7cmiO4BYXlzHHk8KRSEdIDZUm5T
34
- B+pavzaE15aDJrbpy+/awgxQEZb7O/mgzkFoTKlgV4VyDWSDjtU+aEI1sJk0DiSs
35
- Zm3n8B2/BZXgeEcymjLxZGMrvkax12f02NF2l+C8f0/DzS+jlVsewUzux0WmYCR5
36
- 47YifzlLjIM=
37
- -----END CERTIFICATE-----
15
+ cert_chain: []
38
16
 
39
- date: 2010-06-04 00:00:00 -05:00
17
+ date: 2010-09-21 00:00:00 -05:00
40
18
  default_executable:
41
19
  dependencies: []
42
20
 
@@ -82,20 +60,16 @@ rdoc_options:
82
60
  require_paths:
83
61
  - lib
84
62
  required_ruby_version: !ruby/object:Gem::Requirement
85
- none: false
86
63
  requirements:
87
64
  - - ">="
88
65
  - !ruby/object:Gem::Version
89
- hash: 3
90
66
  segments:
91
67
  - 0
92
68
  version: "0"
93
69
  required_rubygems_version: !ruby/object:Gem::Requirement
94
- none: false
95
70
  requirements:
96
71
  - - ">="
97
72
  - !ruby/object:Gem::Version
98
- hash: 11
99
73
  segments:
100
74
  - 1
101
75
  - 2
@@ -103,7 +77,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
103
77
  requirements: []
104
78
 
105
79
  rubyforge_project: acts_as_mongo_rateable
106
- rubygems_version: 1.3.7
80
+ rubygems_version: 1.3.6
107
81
  signing_key:
108
82
  specification_version: 3
109
83
  summary: A ratings system for Rails apps using MongoDB, with bayesian and straight averages, and weighting.
data.tar.gz.sig DELETED
@@ -1,3 +0,0 @@
1
- �Zw{��x�s;�s�wVa�ƌPoP5T@��}R`wm_;P���z�����ْM������3��NU�EQhWN�t=�w��)�����b�
2
-
3
- Q '������d�� �I �#�u����i*�I~d.�fDY�6�Q��S��u�� ])ȬV��^�R�rI��-�h�\G^������3�_@�� ����{��*�}~����Z�N��W�x�\�5�M����!
metadata.gz.sig DELETED
Binary file