data_fabric 1.2.7 → 1.3.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (118) hide show
  1. data/CHANGELOG +7 -0
  2. data/README.rdoc +9 -8
  3. data/Rakefile +9 -41
  4. data/TESTING.rdoc +3 -3
  5. data/example23/Rakefile +28 -27
  6. data/example23/config/environment.rb +4 -2
  7. data/example30/Gemfile +5 -0
  8. data/example30/Gemfile.lock +79 -0
  9. data/example30/README +256 -0
  10. data/example30/Rakefile +52 -0
  11. data/{example → example30}/app/controllers/accounts_controller.rb +0 -0
  12. data/{example/app/controllers/application.rb → example30/app/controllers/application_controller.rb} +0 -0
  13. data/{example → example30}/app/controllers/figments_controller.rb +0 -0
  14. data/example30/app/helpers/application_helper.rb +2 -0
  15. data/{example → example30}/app/models/account.rb +0 -0
  16. data/{example → example30}/app/models/figment.rb +0 -0
  17. data/{example → example30}/app/views/accounts/index.html.erb +2 -2
  18. data/{example → example30}/app/views/layouts/application.html.erb +0 -0
  19. data/example30/config.ru +4 -0
  20. data/example30/config/application.rb +42 -0
  21. data/example30/config/boot.rb +13 -0
  22. data/{example → example30}/config/database.yml +0 -0
  23. data/example30/config/environment.rb +5 -0
  24. data/example30/config/environments/development.rb +26 -0
  25. data/example30/config/environments/production.rb +49 -0
  26. data/example30/config/environments/test.rb +35 -0
  27. data/example30/config/initializers/backtrace_silencers.rb +7 -0
  28. data/{example → example30}/config/initializers/inflections.rb +2 -2
  29. data/{example → example30}/config/initializers/mime_types.rb +0 -0
  30. data/example30/config/initializers/secret_token.rb +7 -0
  31. data/example30/config/initializers/session_store.rb +8 -0
  32. data/example30/config/locales/en.yml +5 -0
  33. data/example30/config/routes.rb +65 -0
  34. data/example30/db/development.sqlite3 +0 -0
  35. data/{example → example30}/db/migrate/20080702154628_create_accounts.rb +0 -0
  36. data/{example → example30}/db/migrate/20080702154820_create_figments.rb +0 -0
  37. data/example30/db/s0_development.sqlite3 +0 -0
  38. data/example30/db/s0_test.sqlite3 +0 -0
  39. data/example30/db/s1_development.sqlite3 +0 -0
  40. data/example30/db/s1_test.sqlite3 +0 -0
  41. data/{example23 → example30}/db/schema.rb +7 -6
  42. data/example30/db/seeds.rb +7 -0
  43. data/example30/db/test.sqlite3 +0 -0
  44. data/example30/log/development.log +132 -0
  45. data/example30/log/test.log +444 -0
  46. data/example30/script/rails +6 -0
  47. data/{example → example30}/test/fixtures/accounts.yml +0 -0
  48. data/{example → example30}/test/functional/accounts_controller_test.rb +0 -0
  49. data/{example → example30}/test/integration/account_figments_test.rb +0 -0
  50. data/example30/test/performance/browsing_test.rb +9 -0
  51. data/example30/test/test_helper.rb +13 -0
  52. data/lib/data_fabric.rb +14 -21
  53. data/lib/data_fabric/{ar22.rb → connection_proxy.rb} +43 -63
  54. data/lib/data_fabric/extensions.rb +29 -0
  55. data/lib/data_fabric/version.rb +1 -1
  56. data/test/connection_test.rb +17 -12
  57. data/test/database_test.rb +3 -11
  58. data/test/test_helper.rb +3 -8
  59. data/test/thread_test.rb +0 -14
  60. data/test/vr_austin_master.db +0 -0
  61. data/test/vr_austin_slave.db +0 -0
  62. data/test/vr_dallas_master.db +0 -0
  63. data/test/vr_dallas_slave.db +0 -0
  64. metadata +72 -99
  65. data/example/Rakefile +0 -58
  66. data/example/app/helpers/accounts_helper.rb +0 -2
  67. data/example/app/helpers/application_helper.rb +0 -3
  68. data/example/app/helpers/figments_helper.rb +0 -2
  69. data/example/config/boot.rb +0 -109
  70. data/example/config/environment.rb +0 -67
  71. data/example/config/environments/development.rb +0 -17
  72. data/example/config/environments/production.rb +0 -22
  73. data/example/config/environments/test.rb +0 -22
  74. data/example/config/initializers/new_rails_defaults.rb +0 -15
  75. data/example/config/routes.rb +0 -45
  76. data/example/db/schema.rb +0 -28
  77. data/example/public/404.html +0 -30
  78. data/example/public/422.html +0 -30
  79. data/example/public/500.html +0 -30
  80. data/example/public/dispatch.cgi +0 -10
  81. data/example/public/dispatch.fcgi +0 -24
  82. data/example/public/dispatch.rb +0 -10
  83. data/example/public/favicon.ico +0 -0
  84. data/example/public/images/rails.png +0 -0
  85. data/example/public/robots.txt +0 -5
  86. data/example/script/about +0 -3
  87. data/example/script/console +0 -3
  88. data/example/script/dbconsole +0 -3
  89. data/example/script/destroy +0 -3
  90. data/example/script/generate +0 -3
  91. data/example/script/performance/benchmarker +0 -3
  92. data/example/script/performance/profiler +0 -3
  93. data/example/script/performance/request +0 -3
  94. data/example/script/plugin +0 -3
  95. data/example/script/process/inspector +0 -3
  96. data/example/script/process/reaper +0 -3
  97. data/example/script/process/spawner +0 -3
  98. data/example/script/runner +0 -3
  99. data/example/script/server +0 -3
  100. data/example/test/test_helper.rb +0 -41
  101. data/example23/db/development.sqlite3 +0 -0
  102. data/example23/db/s0_development.sqlite3 +0 -0
  103. data/example23/db/s0_test.sqlite3 +0 -0
  104. data/example23/db/s1_development.sqlite3 +0 -0
  105. data/example23/db/s1_test.sqlite3 +0 -0
  106. data/example23/db/test.sqlite3 +0 -0
  107. data/example23/log/development.log +0 -295
  108. data/example23/log/test.log +0 -551
  109. data/example23/vendor/plugins/data_fabric/init.rb +0 -3
  110. data/example23/vendor/plugins/data_fabric/lib/data_fabric.rb +0 -106
  111. data/example23/vendor/plugins/data_fabric/lib/data_fabric/ar20.rb +0 -133
  112. data/example23/vendor/plugins/data_fabric/lib/data_fabric/ar22.rb +0 -181
  113. data/example23/vendor/plugins/data_fabric/lib/data_fabric/dash.rb +0 -20
  114. data/example23/vendor/plugins/data_fabric/lib/data_fabric/version.rb +0 -7
  115. data/init.rb +0 -3
  116. data/lib/data_fabric/ar20.rb +0 -133
  117. data/lib/data_fabric/dash.rb +0 -20
  118. data/rails/init.rb +0 -1
@@ -0,0 +1,6 @@
1
+ #!/usr/bin/env ruby
2
+ # This command will automatically be run when you run "rails" with Rails 3 gems installed from the root of your application.
3
+
4
+ APP_PATH = File.expand_path('../../config/application', __FILE__)
5
+ require File.expand_path('../../config/boot', __FILE__)
6
+ require 'rails/commands'
File without changes
@@ -0,0 +1,9 @@
1
+ require 'test_helper'
2
+ require 'rails/performance_test_help'
3
+
4
+ # Profiling results for each test method are written to tmp/performance.
5
+ class BrowsingTest < ActionDispatch::PerformanceTest
6
+ def test_homepage
7
+ get '/'
8
+ end
9
+ end
@@ -0,0 +1,13 @@
1
+ ENV["RAILS_ENV"] = "test"
2
+ require File.expand_path('../../config/environment', __FILE__)
3
+ require 'rails/test_help'
4
+
5
+ class ActiveSupport::TestCase
6
+ # Setup all fixtures in test/fixtures/*.(yml|csv) for all tests in alphabetical order.
7
+ #
8
+ # Note: You'll currently still have to declare fixtures explicitly in integration tests
9
+ # -- they do not yet inherit this setting
10
+ fixtures :all
11
+
12
+ # Add more helper methods to be used by all tests here...
13
+ end
data/lib/data_fabric.rb CHANGED
@@ -1,5 +1,7 @@
1
1
  require 'active_record'
2
2
  require 'active_record/version'
3
+ require 'active_record/connection_adapters/abstract/connection_pool'
4
+ require 'active_record/connection_adapters/abstract/connection_specification'
3
5
  require 'data_fabric/version'
4
6
 
5
7
  # DataFabric adds a new level of flexibility to ActiveRecord connection handling.
@@ -38,20 +40,12 @@ require 'data_fabric/version'
38
40
  # end
39
41
  module DataFabric
40
42
 
41
- # Set this logger to log DataFabric operations.
42
- # The logger should quack like a standard Ruby Logger.
43
- mattr_accessor :logger
44
-
45
- def self.init
46
- logger = ActiveRecord::Base.logger unless logger
47
- log { "Loading data_fabric #{DataFabric::Version::STRING} with ActiveRecord #{ActiveRecord::VERSION::STRING}" }
48
-
49
- if ActiveRecord::VERSION::STRING < '2.2.0'
50
- require 'data_fabric/ar20'
51
- else
52
- require 'data_fabric/ar22'
53
- end
54
- ActiveRecord::Base.send(:include, DataFabric::Extensions)
43
+ def self.logger
44
+ @logger ||= ActiveRecord::Base.logger || Logger.new('/dev/null')
45
+ end
46
+
47
+ def self.logger=(log)
48
+ @logger = log
55
49
  end
56
50
 
57
51
  def self.activate_shard(shards, &block)
@@ -85,9 +79,9 @@ module DataFabric
85
79
  def self.active_shard(group)
86
80
  raise ArgumentError, 'No shard has been activated' unless Thread.current[:shards]
87
81
 
88
- returning(Thread.current[:shards][group.to_s]) do |shard|
89
- raise ArgumentError, "No active shard for #{group}" unless shard
90
- end
82
+ shard = Thread.current[:shards][group.to_s]
83
+ raise ArgumentError, "No active shard for #{group}" unless shard
84
+ shard
91
85
  end
92
86
 
93
87
  def self.shard_active_for?(group)
@@ -99,8 +93,7 @@ module DataFabric
99
93
  Thread.current[:shards] = {} unless Thread.current[:shards]
100
94
  end
101
95
 
102
- def self.log(level=Logger::INFO, &block)
103
- logger && logger.add(level, &block)
104
- end
105
-
106
96
  end
97
+
98
+ require 'data_fabric/extensions'
99
+ ActiveRecord::Base.send(:include, DataFabric::Extensions)
@@ -1,49 +1,47 @@
1
+ module DataFabric
2
+ module ActiveRecordConnectionMethods
3
+ def self.included(base)
4
+ base.alias_method_chain :reload, :master
5
+ end
1
6
 
2
- class ActiveRecord::ConnectionAdapters::ConnectionHandler
3
- def clear_active_connections_with_data_fabric!
4
- clear_active_connections_without_data_fabric!
5
- DataFabric::ConnectionProxy.shard_pools.each_value { |pool| pool.release_connection }
7
+ def reload_with_master(*args, &block)
8
+ connection.with_master { reload_without_master }
9
+ end
6
10
  end
7
- alias_method_chain :clear_active_connections!, :data_fabric
8
- end
9
11
 
10
- module DataFabric
11
- module Extensions
12
- def self.included(model)
13
- # Wire up ActiveRecord::Base
14
- model.extend ClassMethods
15
- ConnectionProxy.shard_pools = {}
16
- end
17
-
18
- # Class methods injected into ActiveRecord::Base
19
- module ClassMethods
20
- def data_fabric(options)
21
- DataFabric.log { "Creating data_fabric proxy for class #{name}" }
22
- @proxy = DataFabric::ConnectionProxy.new(self, options)
23
-
24
- class << self
25
- def connection
26
- @proxy || superclass.connection
27
- end
28
-
29
- def connected?
30
- @proxy.connected?
31
- end
32
-
33
- def remove_connection(klass=self)
34
- DataFabric.log(Logger::WARN) { "remove_connection not implemented by data_fabric" }
35
- end
36
-
37
- def connection_pool
38
- raise "dynamic connection switching means you cannot get direct access to a pool"
39
- end
40
- end
41
- end
12
+ class StringProxy
13
+ def initialize(&block)
14
+ @proc = block
15
+ end
16
+ def to_s
17
+ @proc.call
18
+ end
19
+ end
20
+
21
+ class PoolProxy
22
+ def initialize(proxy)
23
+ @proxy = proxy
24
+ end
25
+ def connection
26
+ @proxy
27
+ end
28
+ def release_connection
29
+ DataFabric.logger.debug { 'data_fabric does not implement release_connection' }
30
+ end
31
+ def spec
32
+ @proxy.spec
33
+ end
34
+ def with_connection
35
+ yield @proxy
36
+ end
37
+ def connected?
38
+ @proxy.connected?
42
39
  end
43
40
  end
44
41
 
45
42
  class ConnectionProxy
46
43
  cattr_accessor :shard_pools
44
+ attr_accessor :spec
47
45
 
48
46
  def initialize(model_class, options)
49
47
  @model_class = model_class
@@ -73,7 +71,7 @@ module DataFabric
73
71
  end
74
72
 
75
73
  def method_missing(method, *args, &block)
76
- DataFabric.log(Logger::DEBUG) { "Calling #{method} on #{connection}" }
74
+ DataFabric.logger.debug { "Calling #{method} on #{connection}" }
77
75
  connection.send(method, *args, &block)
78
76
  end
79
77
 
@@ -94,6 +92,10 @@ module DataFabric
94
92
  current_pool.connected?
95
93
  end
96
94
 
95
+ def connection
96
+ current_pool.connection
97
+ end
98
+
97
99
  private
98
100
 
99
101
  def in_transaction?
@@ -114,7 +116,7 @@ module DataFabric
114
116
  config = config.symbolize_keys
115
117
  adapter_method = "#{config[:adapter]}_connection"
116
118
  initialize_adapter(config[:adapter])
117
- ActiveRecord::Base::ConnectionSpecification.new(config, adapter_method)
119
+ @spec = ActiveRecord::Base::ConnectionSpecification.new(config, adapter_method)
118
120
  end
119
121
 
120
122
  def initialize_adapter(adapter)
@@ -143,10 +145,6 @@ module DataFabric
143
145
  end
144
146
  end
145
147
 
146
- def connection
147
- current_pool.connection
148
- end
149
-
150
148
  def set_role(role)
151
149
  Thread.current[:data_fabric_role] = role
152
150
  end
@@ -160,22 +158,4 @@ module DataFabric
160
158
  end
161
159
  end
162
160
 
163
- module ActiveRecordConnectionMethods
164
- def self.included(base)
165
- base.alias_method_chain :reload, :master
166
- end
167
-
168
- def reload_with_master(*args, &block)
169
- connection.with_master { reload_without_master }
170
- end
171
- end
172
-
173
- class StringProxy
174
- def initialize(&block)
175
- @proc = block
176
- end
177
- def to_s
178
- @proc.call
179
- end
180
- end
181
- end
161
+ end
@@ -0,0 +1,29 @@
1
+ require 'data_fabric/connection_proxy'
2
+
3
+ class ActiveRecord::ConnectionAdapters::ConnectionHandler
4
+ def clear_active_connections_with_data_fabric!
5
+ clear_active_connections_without_data_fabric!
6
+ DataFabric::ConnectionProxy.shard_pools.each_value { |pool| pool.release_connection }
7
+ end
8
+ alias_method_chain :clear_active_connections!, :data_fabric
9
+ end
10
+
11
+ module DataFabric
12
+ module Extensions
13
+ def self.included(model)
14
+ DataFabric.logger.info { "Loading data_fabric #{DataFabric::Version::STRING} with ActiveRecord #{ActiveRecord::VERSION::STRING}" }
15
+
16
+ # Wire up ActiveRecord::Base
17
+ model.extend ClassMethods
18
+ ConnectionProxy.shard_pools = {}
19
+ end
20
+
21
+ # Class methods injected into ActiveRecord::Base
22
+ module ClassMethods
23
+ def data_fabric(options)
24
+ DataFabric.logger.info { "Creating data_fabric proxy for class #{name}" }
25
+ connection_handler.connection_pools[name] = PoolProxy.new(ConnectionProxy.new(self, options))
26
+ end
27
+ end
28
+ end
29
+ end
@@ -1,5 +1,5 @@
1
1
  module DataFabric
2
2
  module Version
3
- STRING = '1.2.7'
3
+ STRING = '1.3.0'
4
4
  end
5
5
  end
@@ -14,21 +14,29 @@ class TheWholeEnchilada < ActiveRecord::Base
14
14
  end
15
15
 
16
16
  class AdapterMock < ActiveRecord::ConnectionAdapters::AbstractAdapter
17
- # Minimum required to perform a find with no results
17
+ # Minimum required to perform a find with no results.
18
+ # Works on 2.3.10, 3.0.0 and 3.0.3.
18
19
  def columns(table_name, name=nil)
19
- []
20
+ [ActiveRecord::ConnectionAdapters::Column.new('id', 0, :integer, false)]
21
+ end
22
+ def primary_key(name)
23
+ :id
24
+ end
25
+ def adapter_name
26
+ 'mysql'
20
27
  end
21
28
  def select(sql, name=nil)
22
29
  []
23
30
  end
24
31
  def execute(sql, name=nil)
25
- 0
32
+ []
26
33
  end
27
-
28
- def name
29
- 'fake-db'
34
+ def tables
35
+ ["enchiladas", "the_whole_burritos"]
36
+ end
37
+ def table_exists?(name)
38
+ true
30
39
  end
31
-
32
40
  def method_missing(name, *args)
33
41
  raise ArgumentError, "#{self.class.name} missing '#{name}': #{args.inspect}"
34
42
  end
@@ -98,11 +106,8 @@ class ConnectionTest < Test::Unit::TestCase
98
106
  private
99
107
 
100
108
  def setup_configuration_for(clazz, name)
101
- if ar22?
102
- flexmock(ActiveRecord::ConnectionAdapters::ConnectionPool).new_instances.should_receive(:new_connection).and_return(AdapterMock.new(RawConnection.new))
103
- else
104
- flexmock(clazz).should_receive(:mysql_connection).and_return(AdapterMock.new(RawConnection.new))
105
- end
109
+ flexmock(ActiveRecord::ConnectionAdapters::ConnectionPool).new_instances.should_receive(
110
+ :new_connection).and_return(AdapterMock.new(RawConnection.new))
106
111
  ActiveRecord::Base.configurations ||= HashWithIndifferentAccess.new
107
112
  ActiveRecord::Base.configurations[name] = HashWithIndifferentAccess.new({ :adapter => 'mysql', :database => name, :host => 'localhost'})
108
113
  end
@@ -10,21 +10,13 @@ class DatabaseTest < Test::Unit::TestCase
10
10
 
11
11
  def setup
12
12
  ActiveRecord::Base.configurations = load_database_yml
13
- if ar22?
14
- DataFabric::ConnectionProxy.shard_pools.clear
15
- end
13
+ DataFabric::ConnectionProxy.shard_pools.clear
16
14
  end
17
15
 
18
- def test_ar22_features
19
- return unless ar22?
20
-
16
+ def test_features
21
17
  DataFabric.activate_shard :city => :dallas do
22
18
  assert_equal 'fiveruns_city_dallas_test_slave', TheWholeBurrito.connection.connection_name
23
-
24
- assert_raises RuntimeError do
25
- TheWholeBurrito.connection_pool
26
- end
27
-
19
+ assert_equal DataFabric::PoolProxy, TheWholeBurrito.connection_pool.class
28
20
  assert !TheWholeBurrito.connected?
29
21
 
30
22
  # Should use the slave
data/test/test_helper.rb CHANGED
@@ -6,6 +6,8 @@ Dir.chdir(ROOT_PATH)
6
6
 
7
7
  require 'rubygems'
8
8
  require 'test/unit'
9
+ require 'erb'
10
+ require 'logger'
9
11
 
10
12
  version = ENV['AR_VERSION']
11
13
  if version
@@ -18,20 +20,13 @@ require 'active_record/version'
18
20
  ActiveRecord::Base.logger = Logger.new(STDOUT)
19
21
  ActiveRecord::Base.logger.level = Logger::WARN
20
22
 
21
- # Bootstrap DF
22
- deps = defined?(ActiveSupport::Dependencies) ? ActiveSupport::Dependencies : Dependencies
23
- deps.load_paths << File.join(File.dirname(__FILE__), '../lib')
24
- require 'init'
23
+ require 'data_fabric'
25
24
 
26
25
  def load_database_yml
27
26
  filename = DATABASE_YML_PATH
28
27
  YAML::load(ERB.new(IO.read(filename)).result)
29
28
  end
30
29
 
31
- def ar22?
32
- ActiveRecord::VERSION::STRING >= '2.2.0'
33
- end
34
-
35
30
  if !File.exist?(DATABASE_YML_PATH)
36
31
  puts "\n*** ERROR ***:\n" <<
37
32
  "You must have a 'test/database.yml' file in order to run the unit tests. " <<
data/test/thread_test.rb CHANGED
@@ -5,20 +5,6 @@ class ThreadTest < Test::Unit::TestCase
5
5
 
6
6
  MUTEX = Mutex.new
7
7
 
8
- if ActiveRecord::VERSION::STRING < '2.2.0'
9
- def test_concurrency_not_allowed
10
- assert_raise ArgumentError do
11
- Object.class_eval %{
12
- class ThreadedEnchilada < ActiveRecord::Base
13
- self.allow_concurrency = true
14
- set_table_name :enchiladas
15
- data_fabric :prefix => 'fiveruns', :replicated => true, :shard_by => :city
16
- end
17
- }
18
- end
19
- end
20
- end
21
-
22
8
  def test_class_and_instance_connections
23
9
  Object.class_eval %{
24
10
  class ThreadedEnchilada < ActiveRecord::Base
Binary file
Binary file
Binary file
Binary file
metadata CHANGED
@@ -4,9 +4,9 @@ version: !ruby/object:Gem::Version
4
4
  prerelease: false
5
5
  segments:
6
6
  - 1
7
- - 2
8
- - 7
9
- version: 1.2.7
7
+ - 3
8
+ - 0
9
+ version: 1.3.0
10
10
  platform: ruby
11
11
  authors:
12
12
  - Mike Perham
@@ -14,11 +14,11 @@ autorequire:
14
14
  bindir: bin
15
15
  cert_chain: []
16
16
 
17
- date: 2010-08-10 00:00:00 -07:00
17
+ date: 2010-11-21 00:00:00 -08:00
18
18
  default_executable:
19
19
  dependencies:
20
20
  - !ruby/object:Gem::Dependency
21
- name: jeweler
21
+ name: flexmock
22
22
  prerelease: false
23
23
  requirement: &id001 !ruby/object:Gem::Requirement
24
24
  none: false
@@ -30,20 +30,7 @@ dependencies:
30
30
  version: "0"
31
31
  type: :development
32
32
  version_requirements: *id001
33
- - !ruby/object:Gem::Dependency
34
- name: flexmock
35
- prerelease: false
36
- requirement: &id002 !ruby/object:Gem::Requirement
37
- none: false
38
- requirements:
39
- - - ">="
40
- - !ruby/object:Gem::Version
41
- segments:
42
- - 0
43
- version: "0"
44
- type: :development
45
- version_requirements: *id002
46
- description:
33
+ description: Sharding and replication support for ActiveRecord 2.x
47
34
  email: mperham@gmail.com
48
35
  executables: []
49
36
 
@@ -52,62 +39,10 @@ extensions: []
52
39
  extra_rdoc_files:
53
40
  - README.rdoc
54
41
  files:
55
- - CHANGELOG
56
- - README.rdoc
57
- - Rakefile
58
- - TESTING.rdoc
59
- - example/Rakefile
60
- - example/app/controllers/accounts_controller.rb
61
- - example/app/controllers/application.rb
62
- - example/app/controllers/figments_controller.rb
63
- - example/app/helpers/accounts_helper.rb
64
- - example/app/helpers/application_helper.rb
65
- - example/app/helpers/figments_helper.rb
66
- - example/app/models/account.rb
67
- - example/app/models/figment.rb
68
- - example/app/views/accounts/index.html.erb
69
- - example/app/views/layouts/application.html.erb
70
- - example/config/boot.rb
71
- - example/config/database.yml
72
- - example/config/environment.rb
73
- - example/config/environments/development.rb
74
- - example/config/environments/production.rb
75
- - example/config/environments/test.rb
76
- - example/config/initializers/inflections.rb
77
- - example/config/initializers/mime_types.rb
78
- - example/config/initializers/new_rails_defaults.rb
79
- - example/config/routes.rb
80
- - example/db/migrate/20080702154628_create_accounts.rb
81
- - example/db/migrate/20080702154820_create_figments.rb
82
- - example/db/schema.rb
83
- - example/public/404.html
84
- - example/public/422.html
85
- - example/public/500.html
86
- - example/public/dispatch.cgi
87
- - example/public/dispatch.fcgi
88
- - example/public/dispatch.rb
89
- - example/public/favicon.ico
90
- - example/public/images/rails.png
91
- - example/public/robots.txt
92
- - example/script/about
93
- - example/script/console
94
- - example/script/dbconsole
95
- - example/script/destroy
96
- - example/script/generate
97
- - example/script/performance/benchmarker
98
- - example/script/performance/profiler
99
- - example/script/performance/request
100
- - example/script/plugin
101
- - example/script/process/inspector
102
- - example/script/process/reaper
103
- - example/script/process/spawner
104
- - example/script/runner
105
- - example/script/server
106
- - example/test/fixtures/accounts.yml
107
- - example/test/functional/accounts_controller_test.rb
108
- - example/test/integration/account_figments_test.rb
109
- - example/test/test_helper.rb
110
- - example23/Rakefile
42
+ - lib/data_fabric/connection_proxy.rb
43
+ - lib/data_fabric/extensions.rb
44
+ - lib/data_fabric/version.rb
45
+ - lib/data_fabric.rb
111
46
  - example23/app/controllers/accounts_controller.rb
112
47
  - example23/app/controllers/application_controller.rb
113
48
  - example23/app/controllers/figments_controller.rb
@@ -127,17 +62,8 @@ files:
127
62
  - example23/config/initializers/new_rails_defaults.rb
128
63
  - example23/config/locales/en.yml
129
64
  - example23/config/routes.rb
130
- - example23/db/development.sqlite3
131
65
  - example23/db/migrate/20080702154628_create_accounts.rb
132
66
  - example23/db/migrate/20080702154820_create_figments.rb
133
- - example23/db/s0_development.sqlite3
134
- - example23/db/s0_test.sqlite3
135
- - example23/db/s1_development.sqlite3
136
- - example23/db/s1_test.sqlite3
137
- - example23/db/schema.rb
138
- - example23/db/test.sqlite3
139
- - example23/log/development.log
140
- - example23/log/test.log
141
67
  - example23/public/404.html
142
68
  - example23/public/422.html
143
69
  - example23/public/500.html
@@ -148,6 +74,7 @@ files:
148
74
  - example23/public/images/rails.png
149
75
  - example23/public/index.html
150
76
  - example23/public/robots.txt
77
+ - example23/Rakefile
151
78
  - example23/script/about
152
79
  - example23/script/console
153
80
  - example23/script/dbconsole
@@ -167,19 +94,55 @@ files:
167
94
  - example23/test/integration/account_figments_test.rb
168
95
  - example23/test/performance/browsing_test.rb
169
96
  - example23/test/test_helper.rb
170
- - example23/vendor/plugins/data_fabric/init.rb
171
- - example23/vendor/plugins/data_fabric/lib/data_fabric.rb
172
- - example23/vendor/plugins/data_fabric/lib/data_fabric/ar20.rb
173
- - example23/vendor/plugins/data_fabric/lib/data_fabric/ar22.rb
174
- - example23/vendor/plugins/data_fabric/lib/data_fabric/dash.rb
175
- - example23/vendor/plugins/data_fabric/lib/data_fabric/version.rb
176
- - init.rb
177
- - lib/data_fabric.rb
178
- - lib/data_fabric/ar20.rb
179
- - lib/data_fabric/ar22.rb
180
- - lib/data_fabric/dash.rb
181
- - lib/data_fabric/version.rb
182
- - rails/init.rb
97
+ - example30/app/controllers/accounts_controller.rb
98
+ - example30/app/controllers/application_controller.rb
99
+ - example30/app/controllers/figments_controller.rb
100
+ - example30/app/helpers/application_helper.rb
101
+ - example30/app/models/account.rb
102
+ - example30/app/models/figment.rb
103
+ - example30/app/views/accounts/index.html.erb
104
+ - example30/app/views/layouts/application.html.erb
105
+ - example30/config/application.rb
106
+ - example30/config/boot.rb
107
+ - example30/config/database.yml
108
+ - example30/config/environment.rb
109
+ - example30/config/environments/development.rb
110
+ - example30/config/environments/production.rb
111
+ - example30/config/environments/test.rb
112
+ - example30/config/initializers/backtrace_silencers.rb
113
+ - example30/config/initializers/inflections.rb
114
+ - example30/config/initializers/mime_types.rb
115
+ - example30/config/initializers/secret_token.rb
116
+ - example30/config/initializers/session_store.rb
117
+ - example30/config/locales/en.yml
118
+ - example30/config/routes.rb
119
+ - example30/config.ru
120
+ - example30/db/development.sqlite3
121
+ - example30/db/migrate/20080702154628_create_accounts.rb
122
+ - example30/db/migrate/20080702154820_create_figments.rb
123
+ - example30/db/s0_development.sqlite3
124
+ - example30/db/s0_test.sqlite3
125
+ - example30/db/s1_development.sqlite3
126
+ - example30/db/s1_test.sqlite3
127
+ - example30/db/schema.rb
128
+ - example30/db/seeds.rb
129
+ - example30/db/test.sqlite3
130
+ - example30/Gemfile
131
+ - example30/Gemfile.lock
132
+ - example30/log/development.log
133
+ - example30/log/test.log
134
+ - example30/Rakefile
135
+ - example30/README
136
+ - example30/script/rails
137
+ - example30/test/fixtures/accounts.yml
138
+ - example30/test/functional/accounts_controller_test.rb
139
+ - example30/test/integration/account_figments_test.rb
140
+ - example30/test/performance/browsing_test.rb
141
+ - example30/test/test_helper.rb
142
+ - CHANGELOG
143
+ - README.rdoc
144
+ - Rakefile
145
+ - TESTING.rdoc
183
146
  - test/connection_test.rb
184
147
  - test/database.yml
185
148
  - test/database.yml.mysql
@@ -187,13 +150,17 @@ files:
187
150
  - test/shard_test.rb
188
151
  - test/test_helper.rb
189
152
  - test/thread_test.rb
153
+ - test/vr_austin_master.db
154
+ - test/vr_austin_slave.db
155
+ - test/vr_dallas_master.db
156
+ - test/vr_dallas_slave.db
190
157
  has_rdoc: true
191
158
  homepage: http://github.com/mperham/data_fabric
192
159
  licenses: []
193
160
 
194
161
  post_install_message:
195
- rdoc_options:
196
- - --charset=UTF-8
162
+ rdoc_options: []
163
+
197
164
  require_paths:
198
165
  - lib
199
166
  required_ruby_version: !ruby/object:Gem::Requirement
@@ -221,7 +188,13 @@ specification_version: 3
221
188
  summary: Sharding and replication support for ActiveRecord 2.x
222
189
  test_files:
223
190
  - test/connection_test.rb
191
+ - test/database.yml
192
+ - test/database.yml.mysql
224
193
  - test/database_test.rb
225
194
  - test/shard_test.rb
226
195
  - test/test_helper.rb
227
196
  - test/thread_test.rb
197
+ - test/vr_austin_master.db
198
+ - test/vr_austin_slave.db
199
+ - test/vr_dallas_master.db
200
+ - test/vr_dallas_slave.db