db-charmer 1.7.0.pre1 → 1.7.0.pre2

Sign up to get free protection for your applications and to get access to all the features.
data/CHANGES CHANGED
@@ -7,6 +7,9 @@ Heavily reorganized the source code to match Rails code structure (class names,
7
7
  make it much easier for other contributors to work with the code.
8
8
  Added smarter environment detection (using Rails.env, RAILS_ENV or RACK_ENV).
9
9
 
10
+ Changed dependencies a bit: instead of depending on rails, we now require specific components
11
+ (ActiveRecord, ActiveSupport, etc) + we do not require blankslate gem anymore.
12
+
10
13
  Bugfixes: Fix for N+1 queries when accessing shard_info for db_block_group_map sharding method.
11
14
 
12
15
  ----------------------------------------------------------------------------------------
data/Rakefile CHANGED
@@ -12,8 +12,9 @@ begin
12
12
 
13
13
  gemspec.version = DbCharmer::Version::STRING
14
14
 
15
- gemspec.add_dependency('rails', '~> 2.2')
16
- gemspec.add_dependency('blankslate', '>= 0')
15
+ gemspec.add_dependency('activesupport', '~> 2.2')
16
+ gemspec.add_dependency('activerecord', '~> 2.2')
17
+ gemspec.add_dependency('actionpack', '~> 2.2')
17
18
  end
18
19
  Jeweler::GemcutterTasks.new
19
20
  rescue LoadError
data/db-charmer.gemspec CHANGED
@@ -5,11 +5,11 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{db-charmer}
8
- s.version = "1.7.0.pre1"
8
+ s.version = "1.7.0.pre2"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new("> 1.3.1") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Alexey Kovyrin"]
12
- s.date = %q{2011-05-16}
12
+ s.date = %q{2011-05-23}
13
13
  s.description = %q{ActiveRecord Connections Magic (slaves, multiple connections, etc)}
14
14
  s.email = %q{alexey@kovyrin.net}
15
15
  s.extra_rdoc_files = [
@@ -61,15 +61,18 @@ Gem::Specification.new do |s|
61
61
  s.specification_version = 3
62
62
 
63
63
  if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
64
- s.add_runtime_dependency(%q<rails>, ["~> 2.2"])
65
- s.add_runtime_dependency(%q<blankslate>, [">= 0"])
64
+ s.add_runtime_dependency(%q<activesupport>, ["~> 2.2"])
65
+ s.add_runtime_dependency(%q<activerecord>, ["~> 2.2"])
66
+ s.add_runtime_dependency(%q<actionpack>, ["~> 2.2"])
66
67
  else
67
- s.add_dependency(%q<rails>, ["~> 2.2"])
68
- s.add_dependency(%q<blankslate>, [">= 0"])
68
+ s.add_dependency(%q<activesupport>, ["~> 2.2"])
69
+ s.add_dependency(%q<activerecord>, ["~> 2.2"])
70
+ s.add_dependency(%q<actionpack>, ["~> 2.2"])
69
71
  end
70
72
  else
71
- s.add_dependency(%q<rails>, ["~> 2.2"])
72
- s.add_dependency(%q<blankslate>, [">= 0"])
73
+ s.add_dependency(%q<activesupport>, ["~> 2.2"])
74
+ s.add_dependency(%q<activerecord>, ["~> 2.2"])
75
+ s.add_dependency(%q<actionpack>, ["~> 2.2"])
73
76
  end
74
77
  end
75
78
 
data/lib/db_charmer.rb CHANGED
@@ -58,9 +58,6 @@ private
58
58
  end
59
59
  end
60
60
 
61
- # We need blankslate for all the proxies we have
62
- require 'blankslate'
63
-
64
61
  # Add useful methods to global object
65
62
  require 'db_charmer/core_extensions'
66
63
 
@@ -3,7 +3,10 @@ module DbCharmer
3
3
  module MultiDbProxy
4
4
  # Simple proxy class that switches connections and then proxies all the calls
5
5
  # This class is used to implement chained on_db calls
6
- class OnDbProxy < BlankSlate
6
+ class OnDbProxy < ActiveSupport::BasicObject
7
+ # We need to do this because in Rails 2.3 BasicObject does not remove object_id method, which is stupid
8
+ undef_method(:object_id) if instance_methods.member?('object_id')
9
+
7
10
  def initialize(proxy_target, slave)
8
11
  @proxy_target = proxy_target
9
12
  @slave = slave
@@ -1,6 +1,9 @@
1
1
  # Simple proxy that sends all method calls to a real database connection
2
2
  module DbCharmer
3
- class ConnectionProxy < BlankSlate
3
+ class ConnectionProxy < ActiveSupport::BasicObject
4
+ # We need to do this because in Rails 2.3 BasicObject does not remove object_id method, which is stupid
5
+ undef_method(:object_id) if instance_methods.member?('object_id')
6
+
4
7
  def initialize(abstract_class, db_name)
5
8
  @abstract_connection_class = abstract_class
6
9
  @db_name = db_name
@@ -3,7 +3,7 @@ module DbCharmer
3
3
  MAJOR = 1
4
4
  MINOR = 7
5
5
  PATCH = 0
6
- BUILD = 'pre1'
6
+ BUILD = 'pre2'
7
7
 
8
8
  STRING = [MAJOR, MINOR, PATCH, BUILD].compact.join('.')
9
9
  end
metadata CHANGED
@@ -1,15 +1,15 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: db-charmer
3
3
  version: !ruby/object:Gem::Version
4
- hash: 1923832059
4
+ hash: 1923832061
5
5
  prerelease: 6
6
6
  segments:
7
7
  - 1
8
8
  - 7
9
9
  - 0
10
10
  - pre
11
- - 1
12
- version: 1.7.0.pre1
11
+ - 2
12
+ version: 1.7.0.pre2
13
13
  platform: ruby
14
14
  authors:
15
15
  - Alexey Kovyrin
@@ -17,11 +17,11 @@ autorequire:
17
17
  bindir: bin
18
18
  cert_chain: []
19
19
 
20
- date: 2011-05-16 00:00:00 -04:00
20
+ date: 2011-05-23 00:00:00 -04:00
21
21
  default_executable:
22
22
  dependencies:
23
23
  - !ruby/object:Gem::Dependency
24
- name: rails
24
+ name: activesupport
25
25
  prerelease: false
26
26
  requirement: &id001 !ruby/object:Gem::Requirement
27
27
  none: false
@@ -36,19 +36,35 @@ dependencies:
36
36
  type: :runtime
37
37
  version_requirements: *id001
38
38
  - !ruby/object:Gem::Dependency
39
- name: blankslate
39
+ name: activerecord
40
40
  prerelease: false
41
41
  requirement: &id002 !ruby/object:Gem::Requirement
42
42
  none: false
43
43
  requirements:
44
- - - ">="
44
+ - - ~>
45
45
  - !ruby/object:Gem::Version
46
- hash: 3
46
+ hash: 7
47
47
  segments:
48
- - 0
49
- version: "0"
48
+ - 2
49
+ - 2
50
+ version: "2.2"
50
51
  type: :runtime
51
52
  version_requirements: *id002
53
+ - !ruby/object:Gem::Dependency
54
+ name: actionpack
55
+ prerelease: false
56
+ requirement: &id003 !ruby/object:Gem::Requirement
57
+ none: false
58
+ requirements:
59
+ - - ~>
60
+ - !ruby/object:Gem::Version
61
+ hash: 7
62
+ segments:
63
+ - 2
64
+ - 2
65
+ version: "2.2"
66
+ type: :runtime
67
+ version_requirements: *id003
52
68
  description: ActiveRecord Connections Magic (slaves, multiple connections, etc)
53
69
  email: alexey@kovyrin.net
54
70
  executables: []