mm-voteable 1.1.0 → 1.2.0

Sign up to get free protection for your applications and to get access to all the features.
data/Gemfile CHANGED
@@ -1,8 +1,8 @@
1
1
  source "http://rubygems.org"
2
2
 
3
3
  group :development do
4
- gem 'bson_ext'
5
- gem 'mongo_mapper'
4
+ gem 'bson_ext', '1.3.0'
5
+ gem 'mongo_mapper', '0.9.0'
6
6
  gem 'i18n'
7
7
 
8
8
  gem 'ruby-debug'
@@ -1,9 +1,14 @@
1
1
  GEM
2
2
  remote: http://rubygems.org/
3
3
  specs:
4
- activesupport (3.0.4)
5
- bson (1.2.4)
6
- bson_ext (1.2.4)
4
+ activemodel (3.0.6)
5
+ activesupport (= 3.0.6)
6
+ builder (~> 2.1.2)
7
+ i18n (~> 0.5.0)
8
+ activesupport (3.0.6)
9
+ bson (1.3.0)
10
+ bson_ext (1.3.0)
11
+ builder (2.1.2)
7
12
  columnize (0.3.2)
8
13
  diff-lcs (1.1.2)
9
14
  git (1.2.5)
@@ -12,16 +17,14 @@ GEM
12
17
  bundler (~> 1.0.0)
13
18
  git (>= 1.2.5)
14
19
  rake
15
- jnunemaker-validatable (1.8.4)
16
- activesupport (>= 2.3.4)
17
20
  linecache (0.43)
18
- mongo (1.2.4)
19
- bson (>= 1.2.4)
20
- mongo_mapper (0.8.6)
21
- activesupport (>= 2.3.4)
22
- jnunemaker-validatable (~> 1.8.4)
21
+ mongo (1.3.0)
22
+ bson (>= 1.3.0)
23
+ mongo_mapper (0.9.0)
24
+ activemodel (~> 3.0.0)
25
+ activesupport (~> 3.0.0)
23
26
  plucky (~> 0.3.6)
24
- plucky (0.3.6)
27
+ plucky (0.3.7)
25
28
  mongo (~> 1.1)
26
29
  rake (0.8.7)
27
30
  rcov (0.9.9)
@@ -44,11 +47,11 @@ PLATFORMS
44
47
  ruby
45
48
 
46
49
  DEPENDENCIES
47
- bson_ext
50
+ bson_ext (= 1.3.0)
48
51
  bundler (~> 1.0.0)
49
52
  i18n
50
53
  jeweler (~> 1.5.1)
51
- mongo_mapper
54
+ mongo_mapper (= 0.9.0)
52
55
  rcov
53
56
  rspec (~> 2.1.0)
54
57
  ruby-debug
@@ -2,6 +2,8 @@
2
2
 
3
3
  A very simple mongomapper plugin to add vote up/down superpowers to your models.
4
4
 
5
+ v1.2 is a mongomapper 0.9.0 update to support the new plugin system
6
+ if you are using mongomapper 0.8.x please use version 1.1 of the gem
5
7
 
6
8
  == Usage
7
9
 
data/VERSION CHANGED
@@ -1 +1 @@
1
- 1.1.0
1
+ 1.2.0
@@ -3,20 +3,19 @@ require File.join(File.dirname(__FILE__), 'voteable', 'vote')
3
3
  module MongoMapper
4
4
  module Plugins
5
5
  module Voteable
6
-
7
- def self.configure(model)
8
- model.class_eval do
9
- key :votes_count, Integer, :default => 0
10
- key :votes_average, Integer, :default => 0
11
- key :voter_ids, Array, :typecast => 'ObjectId'
12
-
13
- many :votes, :as => 'voteable', :dependent => :destroy
14
-
15
- def voteable?; true; end
16
- end
6
+ extend ActiveSupport::Concern
7
+
8
+ included do
9
+ key :votes_count, Integer, :default => 0
10
+ key :votes_average, Integer, :default => 0
11
+ key :voter_ids, Array, :typecast => 'ObjectId'
12
+
13
+ many :votes, :as => 'voteable', :dependent => :destroy
17
14
  end
18
15
 
19
16
  module InstanceMethods
17
+
18
+ def voteable?; true; end
20
19
 
21
20
  def add_vote!(vote_value, voter)
22
21
  vote = self.votes.build(:value => vote_value, :voter => voter)
@@ -5,11 +5,11 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{mm-voteable}
8
- s.version = "1.1.0"
8
+ s.version = "1.2.0"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Luke Cunningham"]
12
- s.date = %q{2011-02-26}
12
+ s.date = %q{2011-04-14}
13
13
  s.description = %q{A very simple mongomapper plugin to add vote up/down superpowers to your models}
14
14
  s.email = %q{luke@icaruswings.com}
15
15
  s.extra_rdoc_files = [
@@ -36,7 +36,7 @@ Gem::Specification.new do |s|
36
36
  s.homepage = %q{http://github.com/icaruswings/mm-voteable}
37
37
  s.licenses = ["MIT"]
38
38
  s.require_paths = ["lib"]
39
- s.rubygems_version = %q{1.3.7}
39
+ s.rubygems_version = %q{1.6.2}
40
40
  s.summary = %q{A very simple mongomapper plugin to add vote up/down superpowers to your models}
41
41
  s.test_files = [
42
42
  "spec/mm-voteable_spec.rb",
@@ -45,12 +45,11 @@ Gem::Specification.new do |s|
45
45
  ]
46
46
 
47
47
  if s.respond_to? :specification_version then
48
- current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION
49
48
  s.specification_version = 3
50
49
 
51
50
  if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
52
- s.add_development_dependency(%q<bson_ext>, [">= 0"])
53
- s.add_development_dependency(%q<mongo_mapper>, [">= 0"])
51
+ s.add_development_dependency(%q<bson_ext>, ["= 1.3.0"])
52
+ s.add_development_dependency(%q<mongo_mapper>, ["= 0.9.0"])
54
53
  s.add_development_dependency(%q<i18n>, [">= 0"])
55
54
  s.add_development_dependency(%q<ruby-debug>, [">= 0"])
56
55
  s.add_development_dependency(%q<rspec>, ["~> 2.1.0"])
@@ -59,8 +58,8 @@ Gem::Specification.new do |s|
59
58
  s.add_development_dependency(%q<jeweler>, ["~> 1.5.1"])
60
59
  s.add_development_dependency(%q<rcov>, [">= 0"])
61
60
  else
62
- s.add_dependency(%q<bson_ext>, [">= 0"])
63
- s.add_dependency(%q<mongo_mapper>, [">= 0"])
61
+ s.add_dependency(%q<bson_ext>, ["= 1.3.0"])
62
+ s.add_dependency(%q<mongo_mapper>, ["= 0.9.0"])
64
63
  s.add_dependency(%q<i18n>, [">= 0"])
65
64
  s.add_dependency(%q<ruby-debug>, [">= 0"])
66
65
  s.add_dependency(%q<rspec>, ["~> 2.1.0"])
@@ -70,8 +69,8 @@ Gem::Specification.new do |s|
70
69
  s.add_dependency(%q<rcov>, [">= 0"])
71
70
  end
72
71
  else
73
- s.add_dependency(%q<bson_ext>, [">= 0"])
74
- s.add_dependency(%q<mongo_mapper>, [">= 0"])
72
+ s.add_dependency(%q<bson_ext>, ["= 1.3.0"])
73
+ s.add_dependency(%q<mongo_mapper>, ["= 0.9.0"])
75
74
  s.add_dependency(%q<i18n>, [">= 0"])
76
75
  s.add_dependency(%q<ruby-debug>, [">= 0"])
77
76
  s.add_dependency(%q<rspec>, ["~> 2.1.0"])
@@ -38,12 +38,12 @@ describe "Vote" do
38
38
  end
39
39
 
40
40
  it "should have a belongs_to voteable association" do
41
- @vote.voteable.association.should be_belongs_to
41
+ @vote.associations[:voteable].should be_a(MongoMapper::Plugins::Associations::BelongsToAssociation)
42
42
  @vote.voteable.should == @voteable
43
43
  end
44
44
 
45
45
  it "should have an associated voter" do
46
- @vote.voter.association.should be_belongs_to
46
+ @vote.associations[:voter].should be_a(MongoMapper::Plugins::Associations::BelongsToAssociation)
47
47
  @vote.voter.should == @user
48
48
  end
49
49
 
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mm-voteable
3
3
  version: !ruby/object:Gem::Version
4
- hash: 19
5
- prerelease: false
4
+ hash: 31
5
+ prerelease:
6
6
  segments:
7
7
  - 1
8
- - 1
8
+ - 2
9
9
  - 0
10
- version: 1.1.0
10
+ version: 1.2.0
11
11
  platform: ruby
12
12
  authors:
13
13
  - Luke Cunningham
@@ -15,40 +15,45 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2011-02-26 00:00:00 +11:00
18
+ date: 2011-04-14 00:00:00 +10:00
19
19
  default_executable:
20
20
  dependencies:
21
21
  - !ruby/object:Gem::Dependency
22
22
  prerelease: false
23
- version_requirements: &id001 !ruby/object:Gem::Requirement
23
+ type: :development
24
+ requirement: &id001 !ruby/object:Gem::Requirement
24
25
  none: false
25
26
  requirements:
26
- - - ">="
27
+ - - "="
27
28
  - !ruby/object:Gem::Version
28
- hash: 3
29
+ hash: 27
29
30
  segments:
31
+ - 1
32
+ - 3
30
33
  - 0
31
- version: "0"
34
+ version: 1.3.0
32
35
  name: bson_ext
33
- requirement: *id001
34
- type: :development
36
+ version_requirements: *id001
35
37
  - !ruby/object:Gem::Dependency
36
38
  prerelease: false
37
- version_requirements: &id002 !ruby/object:Gem::Requirement
39
+ type: :development
40
+ requirement: &id002 !ruby/object:Gem::Requirement
38
41
  none: false
39
42
  requirements:
40
- - - ">="
43
+ - - "="
41
44
  - !ruby/object:Gem::Version
42
- hash: 3
45
+ hash: 59
43
46
  segments:
44
47
  - 0
45
- version: "0"
48
+ - 9
49
+ - 0
50
+ version: 0.9.0
46
51
  name: mongo_mapper
47
- requirement: *id002
48
- type: :development
52
+ version_requirements: *id002
49
53
  - !ruby/object:Gem::Dependency
50
54
  prerelease: false
51
- version_requirements: &id003 !ruby/object:Gem::Requirement
55
+ type: :development
56
+ requirement: &id003 !ruby/object:Gem::Requirement
52
57
  none: false
53
58
  requirements:
54
59
  - - ">="
@@ -58,11 +63,11 @@ dependencies:
58
63
  - 0
59
64
  version: "0"
60
65
  name: i18n
61
- requirement: *id003
62
- type: :development
66
+ version_requirements: *id003
63
67
  - !ruby/object:Gem::Dependency
64
68
  prerelease: false
65
- version_requirements: &id004 !ruby/object:Gem::Requirement
69
+ type: :development
70
+ requirement: &id004 !ruby/object:Gem::Requirement
66
71
  none: false
67
72
  requirements:
68
73
  - - ">="
@@ -72,11 +77,11 @@ dependencies:
72
77
  - 0
73
78
  version: "0"
74
79
  name: ruby-debug
75
- requirement: *id004
76
- type: :development
80
+ version_requirements: *id004
77
81
  - !ruby/object:Gem::Dependency
78
82
  prerelease: false
79
- version_requirements: &id005 !ruby/object:Gem::Requirement
83
+ type: :development
84
+ requirement: &id005 !ruby/object:Gem::Requirement
80
85
  none: false
81
86
  requirements:
82
87
  - - ~>
@@ -88,11 +93,11 @@ dependencies:
88
93
  - 0
89
94
  version: 2.1.0
90
95
  name: rspec
91
- requirement: *id005
92
- type: :development
96
+ version_requirements: *id005
93
97
  - !ruby/object:Gem::Dependency
94
98
  prerelease: false
95
- version_requirements: &id006 !ruby/object:Gem::Requirement
99
+ type: :development
100
+ requirement: &id006 !ruby/object:Gem::Requirement
96
101
  none: false
97
102
  requirements:
98
103
  - - ~>
@@ -104,11 +109,11 @@ dependencies:
104
109
  - 0
105
110
  version: 0.6.0
106
111
  name: yard
107
- requirement: *id006
108
- type: :development
112
+ version_requirements: *id006
109
113
  - !ruby/object:Gem::Dependency
110
114
  prerelease: false
111
- version_requirements: &id007 !ruby/object:Gem::Requirement
115
+ type: :development
116
+ requirement: &id007 !ruby/object:Gem::Requirement
112
117
  none: false
113
118
  requirements:
114
119
  - - ~>
@@ -120,11 +125,11 @@ dependencies:
120
125
  - 0
121
126
  version: 1.0.0
122
127
  name: bundler
123
- requirement: *id007
124
- type: :development
128
+ version_requirements: *id007
125
129
  - !ruby/object:Gem::Dependency
126
130
  prerelease: false
127
- version_requirements: &id008 !ruby/object:Gem::Requirement
131
+ type: :development
132
+ requirement: &id008 !ruby/object:Gem::Requirement
128
133
  none: false
129
134
  requirements:
130
135
  - - ~>
@@ -136,11 +141,11 @@ dependencies:
136
141
  - 1
137
142
  version: 1.5.1
138
143
  name: jeweler
139
- requirement: *id008
140
- type: :development
144
+ version_requirements: *id008
141
145
  - !ruby/object:Gem::Dependency
142
146
  prerelease: false
143
- version_requirements: &id009 !ruby/object:Gem::Requirement
147
+ type: :development
148
+ requirement: &id009 !ruby/object:Gem::Requirement
144
149
  none: false
145
150
  requirements:
146
151
  - - ">="
@@ -150,8 +155,7 @@ dependencies:
150
155
  - 0
151
156
  version: "0"
152
157
  name: rcov
153
- requirement: *id009
154
- type: :development
158
+ version_requirements: *id009
155
159
  description: A very simple mongomapper plugin to add vote up/down superpowers to your models
156
160
  email: luke@icaruswings.com
157
161
  executables: []
@@ -207,7 +211,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
207
211
  requirements: []
208
212
 
209
213
  rubyforge_project:
210
- rubygems_version: 1.3.7
214
+ rubygems_version: 1.6.2
211
215
  signing_key:
212
216
  specification_version: 3
213
217
  summary: A very simple mongomapper plugin to add vote up/down superpowers to your models