mm-commentable 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,16 +1,10 @@
1
1
  source "http://rubygems.org"
2
2
 
3
-
4
3
  group :development do
5
-
6
- gem 'mongo', '1.1.2'
7
- gem 'bson_ext', '1.1.2'
8
- gem 'mongo_ext'
9
- gem 'mongo_mapper'
4
+ gem 'bson_ext', '1.3.0'
5
+ gem 'mongo_mapper', '0.9.0'
10
6
  gem 'i18n'
11
7
 
12
- gem 'log_buddy'
13
-
14
8
  gem 'ruby-debug'
15
9
  gem "rspec", "~> 2.1.0"
16
10
  gem "yard", "~> 0.6.0"
data/Gemfile.lock CHANGED
@@ -1,29 +1,30 @@
1
1
  GEM
2
2
  remote: http://rubygems.org/
3
3
  specs:
4
- activesupport (3.0.1)
5
- bson (1.1.2)
6
- bson_ext (1.1.2)
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)
10
- i18n (0.4.2)
11
- jeweler (1.5.1)
15
+ i18n (0.5.0)
16
+ jeweler (1.5.2)
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
- log_buddy (0.5.0)
19
- mongo (1.1.2)
20
- bson (>= 1.1.1)
21
- mongo_ext (0.19.3)
22
- mongo_mapper (0.8.6)
23
- activesupport (>= 2.3.4)
24
- 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)
25
26
  plucky (~> 0.3.6)
26
- plucky (0.3.6)
27
+ plucky (0.3.7)
27
28
  mongo (~> 1.1)
28
29
  rake (0.8.7)
29
30
  rcov (0.9.9)
@@ -40,20 +41,17 @@ GEM
40
41
  ruby-debug-base (~> 0.10.4.0)
41
42
  ruby-debug-base (0.10.4)
42
43
  linecache (>= 0.3)
43
- yard (0.6.2)
44
+ yard (0.6.4)
44
45
 
45
46
  PLATFORMS
46
47
  ruby
47
48
 
48
49
  DEPENDENCIES
49
- bson_ext (= 1.1.2)
50
+ bson_ext (= 1.3.0)
50
51
  bundler (~> 1.0.0)
51
52
  i18n
52
53
  jeweler (~> 1.5.1)
53
- log_buddy
54
- mongo (= 1.1.2)
55
- mongo_ext
56
- mongo_mapper
54
+ mongo_mapper (= 0.9.0)
57
55
  rcov
58
56
  rspec (~> 2.1.0)
59
57
  ruby-debug
data/VERSION CHANGED
@@ -1 +1 @@
1
- 1.1.0
1
+ 1.2.0
@@ -4,14 +4,15 @@ module MongoMapper
4
4
  module Plugins
5
5
  module Commentable
6
6
 
7
- def self.configure(model)
8
- model.class_eval do
9
- key :comments_count, Integer, :default => 0
10
- many :comments
11
- end
7
+ extend ActiveSupport::Concern
8
+
9
+ included do
10
+ key :comments_count, Integer, :default => 0
11
+ many :comments
12
12
  end
13
13
 
14
14
  module InstanceMethods
15
+
15
16
  def commentable?; true; end
16
17
 
17
18
  def add_comment!(comment_body, commentor)
@@ -5,11 +5,11 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{mm-commentable}
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 make you models commentable}
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-commentable}
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 make you models commentable}
41
41
  s.test_files = [
42
42
  "spec/mm-commentable_spec.rb",
@@ -45,16 +45,12 @@ 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<mongo>, ["= 1.1.2"])
53
- s.add_development_dependency(%q<bson_ext>, ["= 1.1.2"])
54
- s.add_development_dependency(%q<mongo_ext>, [">= 0"])
55
- 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"])
56
53
  s.add_development_dependency(%q<i18n>, [">= 0"])
57
- s.add_development_dependency(%q<log_buddy>, [">= 0"])
58
54
  s.add_development_dependency(%q<ruby-debug>, [">= 0"])
59
55
  s.add_development_dependency(%q<rspec>, ["~> 2.1.0"])
60
56
  s.add_development_dependency(%q<yard>, ["~> 0.6.0"])
@@ -62,12 +58,9 @@ Gem::Specification.new do |s|
62
58
  s.add_development_dependency(%q<jeweler>, ["~> 1.5.1"])
63
59
  s.add_development_dependency(%q<rcov>, [">= 0"])
64
60
  else
65
- s.add_dependency(%q<mongo>, ["= 1.1.2"])
66
- s.add_dependency(%q<bson_ext>, ["= 1.1.2"])
67
- s.add_dependency(%q<mongo_ext>, [">= 0"])
68
- 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"])
69
63
  s.add_dependency(%q<i18n>, [">= 0"])
70
- s.add_dependency(%q<log_buddy>, [">= 0"])
71
64
  s.add_dependency(%q<ruby-debug>, [">= 0"])
72
65
  s.add_dependency(%q<rspec>, ["~> 2.1.0"])
73
66
  s.add_dependency(%q<yard>, ["~> 0.6.0"])
@@ -76,12 +69,9 @@ Gem::Specification.new do |s|
76
69
  s.add_dependency(%q<rcov>, [">= 0"])
77
70
  end
78
71
  else
79
- s.add_dependency(%q<mongo>, ["= 1.1.2"])
80
- s.add_dependency(%q<bson_ext>, ["= 1.1.2"])
81
- s.add_dependency(%q<mongo_ext>, [">= 0"])
82
- 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"])
83
74
  s.add_dependency(%q<i18n>, [">= 0"])
84
- s.add_dependency(%q<log_buddy>, [">= 0"])
85
75
  s.add_dependency(%q<ruby-debug>, [">= 0"])
86
76
  s.add_dependency(%q<rspec>, ["~> 2.1.0"])
87
77
  s.add_dependency(%q<yard>, ["~> 0.6.0"])
@@ -81,7 +81,7 @@ describe "Comment" do
81
81
  @comment.should respond_to(:commentor_type=)
82
82
  @comment.should respond_to(:commentor_type)
83
83
 
84
- @comment.commentor.association.should be_belongs_to
84
+ @comment.associations[:commentor].should be_a(MongoMapper::Plugins::Associations::BelongsToAssociation)
85
85
  end
86
86
 
87
87
  end
data/spec/spec_helper.rb CHANGED
@@ -4,10 +4,6 @@ require 'bundler/setup'
4
4
  $LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))
5
5
  $LOAD_PATH.unshift(File.dirname(__FILE__))
6
6
 
7
- require 'fileutils'
8
- require 'ostruct'
9
- require 'log_buddy'
10
-
11
7
  require 'rspec'
12
8
 
13
9
  require 'mm-commentable'
@@ -16,16 +12,9 @@ require 'mm-commentable'
16
12
  # in ./support/ and its subdirectories.
17
13
  Dir["#{File.dirname(__FILE__)}/support/**/*.rb"].each {|f| require f}
18
14
 
19
- log_dir = File.expand_path('../../log', __FILE__)
20
- FileUtils.mkdir_p(log_dir) unless File.exist?(log_dir)
21
-
22
- logger = Logger.new(log_dir + '/test.log')
23
- LogBuddy.init(:logger => logger)
24
-
25
- MongoMapper.connection = Mongo::Connection.new('127.0.0.1', 27017, :logger => logger)
15
+ MongoMapper.connection = Mongo::Connection.new('127.0.0.1', 27017)
26
16
  MongoMapper.database = "mm-test-#{RUBY_VERSION.gsub('.', '-')}"
27
17
  MongoMapper.database.collections.each { |c| c.drop_indexes }
28
18
 
29
-
30
19
  RSpec.configure do |config|
31
20
  end
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mm-commentable
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,72 +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
24
- none: false
25
- requirements:
26
- - - "="
27
- - !ruby/object:Gem::Version
28
- hash: 23
29
- segments:
30
- - 1
31
- - 1
32
- - 2
33
- version: 1.1.2
34
- name: mongo
35
- requirement: *id001
36
23
  type: :development
37
- - !ruby/object:Gem::Dependency
38
- prerelease: false
39
- version_requirements: &id002 !ruby/object:Gem::Requirement
24
+ requirement: &id001 !ruby/object:Gem::Requirement
40
25
  none: false
41
26
  requirements:
42
27
  - - "="
43
28
  - !ruby/object:Gem::Version
44
- hash: 23
29
+ hash: 27
45
30
  segments:
46
31
  - 1
47
- - 1
48
- - 2
49
- version: 1.1.2
32
+ - 3
33
+ - 0
34
+ version: 1.3.0
50
35
  name: bson_ext
51
- requirement: *id002
52
- type: :development
36
+ version_requirements: *id001
53
37
  - !ruby/object:Gem::Dependency
54
38
  prerelease: false
55
- version_requirements: &id003 !ruby/object:Gem::Requirement
56
- none: false
57
- requirements:
58
- - - ">="
59
- - !ruby/object:Gem::Version
60
- hash: 3
61
- segments:
62
- - 0
63
- version: "0"
64
- name: mongo_ext
65
- requirement: *id003
66
39
  type: :development
67
- - !ruby/object:Gem::Dependency
68
- prerelease: false
69
- version_requirements: &id004 !ruby/object:Gem::Requirement
40
+ requirement: &id002 !ruby/object:Gem::Requirement
70
41
  none: false
71
42
  requirements:
72
- - - ">="
43
+ - - "="
73
44
  - !ruby/object:Gem::Version
74
- hash: 3
45
+ hash: 59
75
46
  segments:
76
47
  - 0
77
- version: "0"
48
+ - 9
49
+ - 0
50
+ version: 0.9.0
78
51
  name: mongo_mapper
79
- requirement: *id004
80
- type: :development
52
+ version_requirements: *id002
81
53
  - !ruby/object:Gem::Dependency
82
54
  prerelease: false
83
- version_requirements: &id005 !ruby/object:Gem::Requirement
55
+ type: :development
56
+ requirement: &id003 !ruby/object:Gem::Requirement
84
57
  none: false
85
58
  requirements:
86
59
  - - ">="
@@ -90,25 +63,11 @@ dependencies:
90
63
  - 0
91
64
  version: "0"
92
65
  name: i18n
93
- requirement: *id005
94
- type: :development
66
+ version_requirements: *id003
95
67
  - !ruby/object:Gem::Dependency
96
68
  prerelease: false
97
- version_requirements: &id006 !ruby/object:Gem::Requirement
98
- none: false
99
- requirements:
100
- - - ">="
101
- - !ruby/object:Gem::Version
102
- hash: 3
103
- segments:
104
- - 0
105
- version: "0"
106
- name: log_buddy
107
- requirement: *id006
108
69
  type: :development
109
- - !ruby/object:Gem::Dependency
110
- prerelease: false
111
- version_requirements: &id007 !ruby/object:Gem::Requirement
70
+ requirement: &id004 !ruby/object:Gem::Requirement
112
71
  none: false
113
72
  requirements:
114
73
  - - ">="
@@ -118,11 +77,11 @@ dependencies:
118
77
  - 0
119
78
  version: "0"
120
79
  name: ruby-debug
121
- requirement: *id007
122
- type: :development
80
+ version_requirements: *id004
123
81
  - !ruby/object:Gem::Dependency
124
82
  prerelease: false
125
- version_requirements: &id008 !ruby/object:Gem::Requirement
83
+ type: :development
84
+ requirement: &id005 !ruby/object:Gem::Requirement
126
85
  none: false
127
86
  requirements:
128
87
  - - ~>
@@ -134,11 +93,11 @@ dependencies:
134
93
  - 0
135
94
  version: 2.1.0
136
95
  name: rspec
137
- requirement: *id008
138
- type: :development
96
+ version_requirements: *id005
139
97
  - !ruby/object:Gem::Dependency
140
98
  prerelease: false
141
- version_requirements: &id009 !ruby/object:Gem::Requirement
99
+ type: :development
100
+ requirement: &id006 !ruby/object:Gem::Requirement
142
101
  none: false
143
102
  requirements:
144
103
  - - ~>
@@ -150,11 +109,11 @@ dependencies:
150
109
  - 0
151
110
  version: 0.6.0
152
111
  name: yard
153
- requirement: *id009
154
- type: :development
112
+ version_requirements: *id006
155
113
  - !ruby/object:Gem::Dependency
156
114
  prerelease: false
157
- version_requirements: &id010 !ruby/object:Gem::Requirement
115
+ type: :development
116
+ requirement: &id007 !ruby/object:Gem::Requirement
158
117
  none: false
159
118
  requirements:
160
119
  - - ~>
@@ -166,11 +125,11 @@ dependencies:
166
125
  - 0
167
126
  version: 1.0.0
168
127
  name: bundler
169
- requirement: *id010
170
- type: :development
128
+ version_requirements: *id007
171
129
  - !ruby/object:Gem::Dependency
172
130
  prerelease: false
173
- version_requirements: &id011 !ruby/object:Gem::Requirement
131
+ type: :development
132
+ requirement: &id008 !ruby/object:Gem::Requirement
174
133
  none: false
175
134
  requirements:
176
135
  - - ~>
@@ -182,11 +141,11 @@ dependencies:
182
141
  - 1
183
142
  version: 1.5.1
184
143
  name: jeweler
185
- requirement: *id011
186
- type: :development
144
+ version_requirements: *id008
187
145
  - !ruby/object:Gem::Dependency
188
146
  prerelease: false
189
- version_requirements: &id012 !ruby/object:Gem::Requirement
147
+ type: :development
148
+ requirement: &id009 !ruby/object:Gem::Requirement
190
149
  none: false
191
150
  requirements:
192
151
  - - ">="
@@ -196,8 +155,7 @@ dependencies:
196
155
  - 0
197
156
  version: "0"
198
157
  name: rcov
199
- requirement: *id012
200
- type: :development
158
+ version_requirements: *id009
201
159
  description: A very simple mongomapper plugin to make you models commentable
202
160
  email: luke@icaruswings.com
203
161
  executables: []
@@ -253,7 +211,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
253
211
  requirements: []
254
212
 
255
213
  rubyforge_project:
256
- rubygems_version: 1.3.7
214
+ rubygems_version: 1.6.2
257
215
  signing_key:
258
216
  specification_version: 3
259
217
  summary: A very simple mongomapper plugin to make you models commentable