bullet 4.0.0 → 4.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -29,11 +29,19 @@ module Support
29
29
  end
30
30
 
31
31
  def setup_db
32
- Mongoid.database = Mongo::Connection.new("localhost", 27017).db("bullet")
32
+ if Mongoid::VERSION =~ /\A2\.4/
33
+ Mongoid.configure do |config|
34
+ config.master = Mongo::Connection.new.db("bullet")
35
+ end
36
+ elsif Mongoid::VERSION =~ /\A3/
37
+ Mongoid.configure do |config|
38
+ config.connect_to("bullet")
39
+ end
40
+ end
33
41
  end
34
42
 
35
43
  def teardown_db
36
- Mongoid.database.collections.select {|c| c.name !~ /system/ }.map(&:drop)
44
+ Mongoid.purge!
37
45
  end
38
46
 
39
47
  extend self
data/test.sh ADDED
@@ -0,0 +1,4 @@
1
+ bundle && bundle exec rspec spec
2
+ BUNDLE_GEMFILE=Gemfile.rails-3.1.5 bundle && bundle exec rspec spec
3
+ BUNDLE_GEMFILE=Gemfile.rails-3.0.13 bundle && bundle exec rspec spec
4
+ BUNDLE_GEMFILE=Gemfile.rails-2.3.14 bundle && bundle exec rspec spec
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bullet
3
3
  version: !ruby/object:Gem::Version
4
- version: 4.0.0
4
+ version: 4.1.1
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,11 +9,11 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-05-09 00:00:00.000000000 Z
12
+ date: 2012-06-06 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: uniform_notifier
16
- requirement: &70311383422560 !ruby/object:Gem::Requirement
16
+ requirement: &70259190750800 !ruby/object:Gem::Requirement
17
17
  none: false
18
18
  requirements:
19
19
  - - ~>
@@ -21,7 +21,7 @@ dependencies:
21
21
  version: 1.0.0
22
22
  type: :runtime
23
23
  prerelease: false
24
- version_requirements: *70311383422560
24
+ version_requirements: *70259190750800
25
25
  description: A rails plugin to kill N+1 queries and unused eager loading.
26
26
  email:
27
27
  - flyerhzm@gmail.com
@@ -38,10 +38,10 @@ files:
38
38
  - Gemfile.lock
39
39
  - Gemfile.rails-2.3.14
40
40
  - Gemfile.rails-2.3.14.lock
41
- - Gemfile.rails-3.0.12
42
- - Gemfile.rails-3.0.12.lock
43
- - Gemfile.rails-3.1.4
44
- - Gemfile.rails-3.1.4.lock
41
+ - Gemfile.rails-3.0.13
42
+ - Gemfile.rails-3.0.13.lock
43
+ - Gemfile.rails-3.1.5
44
+ - Gemfile.rails-3.1.5.lock
45
45
  - Guardfile
46
46
  - Hacking.textile
47
47
  - MIT-LICENSE
@@ -54,6 +54,7 @@ files:
54
54
  - lib/bullet/active_record2.rb
55
55
  - lib/bullet/active_record3.rb
56
56
  - lib/bullet/active_record31.rb
57
+ - lib/bullet/dependency.rb
57
58
  - lib/bullet/detector.rb
58
59
  - lib/bullet/detector/association.rb
59
60
  - lib/bullet/detector/base.rb
@@ -62,7 +63,8 @@ files:
62
63
  - lib/bullet/detector/unused_eager_association.rb
63
64
  - lib/bullet/ext/object.rb
64
65
  - lib/bullet/ext/string.rb
65
- - lib/bullet/mongoid.rb
66
+ - lib/bullet/mongoid24.rb
67
+ - lib/bullet/mongoid3.rb
66
68
  - lib/bullet/notification.rb
67
69
  - lib/bullet/notification/base.rb
68
70
  - lib/bullet/notification/counter_cache.rb
@@ -135,6 +137,7 @@ files:
135
137
  - spec/support/sqlite_seed.rb
136
138
  - tasks/bullet_tasks.rake
137
139
  - test.result
140
+ - test.sh
138
141
  homepage: http://github.com/flyerhzm/bullet
139
142
  licenses: []
140
143
  post_install_message:
@@ -149,7 +152,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
149
152
  version: '0'
150
153
  segments:
151
154
  - 0
152
- hash: -3387566190207483190
155
+ hash: 3239988902273692039
153
156
  required_rubygems_version: !ruby/object:Gem::Requirement
154
157
  none: false
155
158
  requirements:
@@ -158,7 +161,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
158
161
  version: 1.3.6
159
162
  requirements: []
160
163
  rubyforge_project:
161
- rubygems_version: 1.8.15
164
+ rubygems_version: 1.8.17
162
165
  signing_key:
163
166
  specification_version: 3
164
167
  summary: A rails plugin to kill N+1 queries and unused eager loading.