db-charmer 1.7.1 → 1.8.0.pre1
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.
- data/CHANGES +11 -0
- data/README.rdoc +26 -9
- data/lib/db_charmer.rb +8 -0
- data/lib/db_charmer/action_controller/force_slave_reads.rb +1 -1
- data/lib/db_charmer/core_extensions.rb +1 -1
- data/lib/db_charmer/version.rb +3 -3
- metadata +27 -27
- data/.gitignore +0 -4
- data/Makefile +0 -2
- data/Rakefile +0 -4
- data/db-charmer.gemspec +0 -29
data/CHANGES
CHANGED
@@ -1,3 +1,14 @@
|
|
1
|
+
1.8.0 (2012-11-12):
|
2
|
+
|
3
|
+
Added support for Rails versions up to 3.2.9. Please note, that Rails 3.2.4 is not officially
|
4
|
+
supported. Your code may work on that version, but no bug reports will be accepted about this
|
5
|
+
version.
|
6
|
+
|
7
|
+
Tests for DbCharmer have been moved to the gem repository to make Travis-CI integration more
|
8
|
+
stable. We do not put test files into the gem inself so it should not be a problem for most
|
9
|
+
of the users. If you still use db-charmer as a plugin, please switch to gem mode.
|
10
|
+
|
11
|
+
----------------------------------------------------------------------------------------
|
1
12
|
1.7.1 (2012-04-22):
|
2
13
|
|
3
14
|
Beta feature: Rails 3.1 and 3.2 support
|
data/README.rdoc
CHANGED
@@ -16,7 +16,7 @@ For more information on the project, you can check out our web site at http://ko
|
|
16
16
|
== Installation
|
17
17
|
|
18
18
|
There are two options when approaching +DbCharmer+ installation:
|
19
|
-
* using the gem (recommended and the only way of using it with Rails 3.
|
19
|
+
* using the gem (recommended and the only way of using it with Rails 3.2+)
|
20
20
|
* install as a Rails plugin (works in Rails 2.x only)
|
21
21
|
|
22
22
|
To install as a gem, add this to your Gemfile:
|
@@ -276,7 +276,7 @@ This option could be used to disable automated slave reads on your models so tha
|
|
276
276
|
call <tt>on_slave</tt> or use other methods to enable slave reads when you need it. Example:
|
277
277
|
|
278
278
|
class User < ActiveRecord::Base
|
279
|
-
db_magic :slave => slave01, :
|
279
|
+
db_magic :slave => slave01, :force_slave_reads => false
|
280
280
|
end
|
281
281
|
|
282
282
|
2) <tt>force_slave_reads</tt> +ActionController+ class method. This method could be used to
|
@@ -582,17 +582,30 @@ the DbCharmer Users Group mailing list:
|
|
582
582
|
|
583
583
|
== What Ruby and Rails implementations does it work for?
|
584
584
|
|
585
|
-
We have a continuous integration setup for this gem on with Rails 2.
|
586
|
-
different versions of Ruby.
|
587
|
-
http://github.com/kovyrin/db-charmer-sandbox web site.
|
585
|
+
We have a continuous integration setup for this gem on with Rails 2.3, 3.0, 3.1 and 3.2 using a few
|
586
|
+
different versions of Ruby.
|
588
587
|
|
589
|
-
|
588
|
+
CI is running on TravisCI.org: https://travis-ci.org/kovyrin/db-charmer
|
589
|
+
|
590
|
+
At the moment we have the following build matrix:
|
591
|
+
|
592
|
+
* Rails versions:
|
593
|
+
- 2.x {<img src="https://secure.travis-ci.org/kovyrin/db-charmer-sandbox.png?branch=rails23" alt="Build Status: Rails 2.x" />}[https://travis-ci.org/kovyrin/db-charmer-sandbox]
|
594
|
+
- 3.x {<img src="https://secure.travis-ci.org/kovyrin/db-charmer.png?branch=master" alt="Build Status: Rails 3.x" />}[https://travis-ci.org/kovyrin/db-charmer]
|
595
|
+
* Ruby versions:
|
596
|
+
- 1.8.7
|
597
|
+
- Ruby Enterprise Edition (1.8.7)
|
598
|
+
- 1.9.3 (Rails 3 only since older versions do not support new ruby releases)
|
599
|
+
* Databases:
|
600
|
+
- MySQL
|
601
|
+
|
602
|
+
In addition to CI testing, this gem is used in production on Scribd.com (one of the largest RoR
|
590
603
|
sites in the world) with Ruby Enterprise Edition and Rails 2.2, Rails 2.3, Sinatra and plain
|
591
604
|
Rack applications.
|
592
605
|
|
593
|
-
Starting with version 1.
|
594
|
-
|
595
|
-
|
606
|
+
Starting with version 1.8.0 we support Rails versions up to 3.2.8. Please note, that Rails 3.2.4
|
607
|
+
is not officially supported. Your code may work on that version, but no bug reports will be
|
608
|
+
accepted about this version.
|
596
609
|
|
597
610
|
|
598
611
|
== Who are the authors?
|
@@ -605,8 +618,12 @@ Other contributors who have helped with the development of this library are (alp
|
|
605
618
|
* Allen Madsen
|
606
619
|
* Andrew Geweke
|
607
620
|
* Ashley Martens
|
621
|
+
* Cauê Guerra
|
622
|
+
* David Dai
|
608
623
|
* Dmytro Shteflyuk
|
609
624
|
* Eric Lindvall
|
625
|
+
* Eugene Pimenov
|
626
|
+
* Jonathan Viney
|
610
627
|
* Gregory Man
|
611
628
|
* Michael Birk
|
612
629
|
* Tyler McMullen
|
data/lib/db_charmer.rb
CHANGED
@@ -24,6 +24,11 @@ module DbCharmer
|
|
24
24
|
::ActiveRecord::VERSION::MAJOR == 2
|
25
25
|
end
|
26
26
|
|
27
|
+
# Used in all Rails2-specific places
|
28
|
+
def self.rails324?
|
29
|
+
ActiveRecord::VERSION::STRING == '3.2.4'
|
30
|
+
end
|
31
|
+
|
27
32
|
# Accessors
|
28
33
|
@@connections_should_exist = true
|
29
34
|
mattr_accessor :connections_should_exist
|
@@ -91,6 +96,9 @@ private
|
|
91
96
|
end
|
92
97
|
end
|
93
98
|
|
99
|
+
# Print warning about the broken Rails 2.3.4
|
100
|
+
puts "WARNING: Rails 3.2.4 is not officially supported by DbCharmer. Please upgrade." if DbCharmer.rails324?
|
101
|
+
|
94
102
|
# Add useful methods to global object
|
95
103
|
require 'db_charmer/core_extensions'
|
96
104
|
|
@@ -4,7 +4,7 @@ module DbCharmer
|
|
4
4
|
|
5
5
|
module ClassMethods
|
6
6
|
@@db_charmer_force_slave_reads_actions = {}
|
7
|
-
def force_slave_reads(params)
|
7
|
+
def force_slave_reads(params = {})
|
8
8
|
@@db_charmer_force_slave_reads_actions[self.name] = {
|
9
9
|
:except => params[:except] ? [*params[:except]].map(&:to_s) : [],
|
10
10
|
:only => params[:only] ? [*params[:only]].map(&:to_s) : []
|
data/lib/db_charmer/version.rb
CHANGED
metadata
CHANGED
@@ -1,13 +1,15 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: db-charmer
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
5
|
-
prerelease:
|
4
|
+
hash: 1690807325
|
5
|
+
prerelease: 6
|
6
6
|
segments:
|
7
7
|
- 1
|
8
|
-
-
|
8
|
+
- 8
|
9
|
+
- 0
|
10
|
+
- pre
|
9
11
|
- 1
|
10
|
-
version: 1.
|
12
|
+
version: 1.8.0.pre1
|
11
13
|
platform: ruby
|
12
14
|
authors:
|
13
15
|
- Oleksiy Kovyrin
|
@@ -15,7 +17,7 @@ autorequire:
|
|
15
17
|
bindir: bin
|
16
18
|
cert_chain: []
|
17
19
|
|
18
|
-
date: 2012-
|
20
|
+
date: 2012-11-13 00:00:00 Z
|
19
21
|
dependencies:
|
20
22
|
- !ruby/object:Gem::Dependency
|
21
23
|
name: activesupport
|
@@ -25,12 +27,12 @@ dependencies:
|
|
25
27
|
requirements:
|
26
28
|
- - <=
|
27
29
|
- !ruby/object:Gem::Version
|
28
|
-
hash:
|
30
|
+
hash: 29
|
29
31
|
segments:
|
30
32
|
- 3
|
31
33
|
- 2
|
32
|
-
-
|
33
|
-
version: 3.2.
|
34
|
+
- 9
|
35
|
+
version: 3.2.9
|
34
36
|
type: :runtime
|
35
37
|
version_requirements: *id001
|
36
38
|
- !ruby/object:Gem::Dependency
|
@@ -41,12 +43,12 @@ dependencies:
|
|
41
43
|
requirements:
|
42
44
|
- - <=
|
43
45
|
- !ruby/object:Gem::Version
|
44
|
-
hash:
|
46
|
+
hash: 29
|
45
47
|
segments:
|
46
48
|
- 3
|
47
49
|
- 2
|
48
|
-
-
|
49
|
-
version: 3.2.
|
50
|
+
- 9
|
51
|
+
version: 3.2.9
|
50
52
|
type: :runtime
|
51
53
|
version_requirements: *id002
|
52
54
|
- !ruby/object:Gem::Dependency
|
@@ -101,15 +103,6 @@ extra_rdoc_files:
|
|
101
103
|
- LICENSE
|
102
104
|
- README.rdoc
|
103
105
|
files:
|
104
|
-
- .gitignore
|
105
|
-
- CHANGES
|
106
|
-
- LICENSE
|
107
|
-
- Makefile
|
108
|
-
- README.rdoc
|
109
|
-
- Rakefile
|
110
|
-
- db-charmer.gemspec
|
111
|
-
- init.rb
|
112
|
-
- lib/db_charmer.rb
|
113
106
|
- lib/db_charmer/action_controller/force_slave_reads.rb
|
114
107
|
- lib/db_charmer/active_record/association_preload.rb
|
115
108
|
- lib/db_charmer/active_record/class_attributes.rb
|
@@ -133,16 +126,21 @@ files:
|
|
133
126
|
- lib/db_charmer/rails31/active_record/migration/command_recorder.rb
|
134
127
|
- lib/db_charmer/rails31/active_record/preloader/association.rb
|
135
128
|
- lib/db_charmer/rails31/active_record/preloader/has_and_belongs_to_many.rb
|
136
|
-
- lib/db_charmer/sharding.rb
|
137
129
|
- lib/db_charmer/sharding/connection.rb
|
138
|
-
- lib/db_charmer/sharding/method.rb
|
139
130
|
- lib/db_charmer/sharding/method/db_block_group_map.rb
|
140
131
|
- lib/db_charmer/sharding/method/db_block_map.rb
|
141
132
|
- lib/db_charmer/sharding/method/hash_map.rb
|
142
133
|
- lib/db_charmer/sharding/method/range.rb
|
134
|
+
- lib/db_charmer/sharding/method.rb
|
143
135
|
- lib/db_charmer/sharding/stub_connection.rb
|
136
|
+
- lib/db_charmer/sharding.rb
|
144
137
|
- lib/db_charmer/version.rb
|
138
|
+
- lib/db_charmer.rb
|
145
139
|
- lib/tasks/databases.rake
|
140
|
+
- init.rb
|
141
|
+
- README.rdoc
|
142
|
+
- LICENSE
|
143
|
+
- CHANGES
|
146
144
|
homepage: http://kovyrin.github.com/db-charmer
|
147
145
|
licenses: []
|
148
146
|
|
@@ -163,16 +161,18 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
163
161
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
164
162
|
none: false
|
165
163
|
requirements:
|
166
|
-
- - "
|
164
|
+
- - ">"
|
167
165
|
- !ruby/object:Gem::Version
|
168
|
-
hash:
|
166
|
+
hash: 25
|
169
167
|
segments:
|
170
|
-
-
|
171
|
-
|
168
|
+
- 1
|
169
|
+
- 3
|
170
|
+
- 1
|
171
|
+
version: 1.3.1
|
172
172
|
requirements: []
|
173
173
|
|
174
174
|
rubyforge_project:
|
175
|
-
rubygems_version: 1.8.
|
175
|
+
rubygems_version: 1.8.24
|
176
176
|
signing_key:
|
177
177
|
specification_version: 3
|
178
178
|
summary: ActiveRecord Connections Magic (slaves, multiple connections, etc)
|
data/.gitignore
DELETED
data/Makefile
DELETED
data/Rakefile
DELETED
data/db-charmer.gemspec
DELETED
@@ -1,29 +0,0 @@
|
|
1
|
-
# -*- encoding: utf-8 -*-
|
2
|
-
$:.push File.expand_path('../lib', __FILE__)
|
3
|
-
require 'db_charmer/version'
|
4
|
-
|
5
|
-
Gem::Specification.new do |s|
|
6
|
-
s.name = 'db-charmer'
|
7
|
-
s.version = DbCharmer::Version::STRING
|
8
|
-
s.platform = Gem::Platform::RUBY
|
9
|
-
|
10
|
-
s.authors = [ 'Oleksiy Kovyrin' ]
|
11
|
-
s.email = 'alexey@kovyrin.net'
|
12
|
-
s.homepage = 'http://kovyrin.github.com/db-charmer'
|
13
|
-
s.summary = 'ActiveRecord Connections Magic (slaves, multiple connections, etc)'
|
14
|
-
s.description = 'DbCharmer is a Rails plugin (and gem) that could be used to manage AR model connections, implement master/slave query schemes, sharding and other magic features many high-scale applications need.'
|
15
|
-
|
16
|
-
s.rdoc_options = [ '--charset=UTF-8' ]
|
17
|
-
|
18
|
-
s.files = `git ls-files`.split("\n")
|
19
|
-
s.require_paths = [ 'lib' ]
|
20
|
-
s.extra_rdoc_files = [ 'LICENSE', 'README.rdoc' ]
|
21
|
-
|
22
|
-
# Dependencies
|
23
|
-
s.add_dependency 'activesupport', '<= 3.2.3'
|
24
|
-
s.add_dependency 'activerecord', '<= 3.2.3'
|
25
|
-
|
26
|
-
s.add_development_dependency 'rspec'
|
27
|
-
s.add_development_dependency 'yard'
|
28
|
-
s.add_development_dependency 'actionpack'
|
29
|
-
end
|