data_fabric 1.2.5 → 1.2.7

Sign up to get free protection for your applications and to get access to all the features.
Files changed (78) hide show
  1. data/CHANGELOG +10 -0
  2. data/README.rdoc +1 -0
  3. data/Rakefile +13 -11
  4. data/{example22 → example23}/Rakefile +0 -0
  5. data/{example22 → example23}/app/controllers/accounts_controller.rb +0 -0
  6. data/{example22/app/controllers/application.rb → example23/app/controllers/application_controller.rb} +0 -0
  7. data/{example22 → example23}/app/controllers/figments_controller.rb +0 -0
  8. data/{example22 → example23}/app/helpers/application_helper.rb +0 -0
  9. data/{example22 → example23}/app/models/account.rb +0 -0
  10. data/{example22 → example23}/app/models/figment.rb +0 -0
  11. data/{example22 → example23}/app/views/accounts/index.html.erb +0 -0
  12. data/{example22 → example23}/app/views/layouts/application.html.erb +0 -0
  13. data/{example22 → example23}/config/boot.rb +0 -0
  14. data/{example22 → example23}/config/database.yml +0 -0
  15. data/{example22 → example23}/config/environment.rb +2 -2
  16. data/{example22 → example23}/config/environments/development.rb +0 -0
  17. data/{example22 → example23}/config/environments/production.rb +0 -0
  18. data/{example22 → example23}/config/environments/test.rb +0 -0
  19. data/{example22 → example23}/config/initializers/inflections.rb +0 -0
  20. data/{example22 → example23}/config/initializers/mime_types.rb +0 -0
  21. data/{example22 → example23}/config/initializers/new_rails_defaults.rb +0 -0
  22. data/{example22 → example23}/config/locales/en.yml +0 -0
  23. data/{example22 → example23}/config/routes.rb +0 -0
  24. data/example23/db/development.sqlite3 +0 -0
  25. data/{example22 → example23}/db/migrate/20080702154628_create_accounts.rb +0 -0
  26. data/{example22 → example23}/db/migrate/20080702154820_create_figments.rb +0 -0
  27. data/example23/db/s0_development.sqlite3 +0 -0
  28. data/example23/db/s0_test.sqlite3 +0 -0
  29. data/example23/db/s1_development.sqlite3 +0 -0
  30. data/example23/db/s1_test.sqlite3 +0 -0
  31. data/example23/db/schema.rb +28 -0
  32. data/example23/db/test.sqlite3 +0 -0
  33. data/example23/log/development.log +295 -0
  34. data/example23/log/test.log +551 -0
  35. data/{example22 → example23}/public/404.html +0 -0
  36. data/{example22 → example23}/public/422.html +0 -0
  37. data/{example22 → example23}/public/500.html +0 -0
  38. data/{example22 → example23}/public/dispatch.cgi +0 -0
  39. data/{example22 → example23}/public/dispatch.fcgi +0 -0
  40. data/{example22 → example23}/public/dispatch.rb +0 -0
  41. data/{example22 → example23}/public/favicon.ico +0 -0
  42. data/{example22 → example23}/public/images/rails.png +0 -0
  43. data/{example22 → example23}/public/index.html +0 -0
  44. data/{example22 → example23}/public/robots.txt +0 -0
  45. data/{example22 → example23}/script/about +0 -0
  46. data/{example22 → example23}/script/console +0 -0
  47. data/{example22 → example23}/script/dbconsole +0 -0
  48. data/{example22 → example23}/script/destroy +0 -0
  49. data/{example22 → example23}/script/generate +0 -0
  50. data/{example22 → example23}/script/performance/benchmarker +0 -0
  51. data/{example22 → example23}/script/performance/profiler +0 -0
  52. data/{example22 → example23}/script/performance/request +0 -0
  53. data/{example22 → example23}/script/plugin +0 -0
  54. data/{example22 → example23}/script/process/inspector +0 -0
  55. data/{example22 → example23}/script/process/reaper +0 -0
  56. data/{example22 → example23}/script/process/spawner +0 -0
  57. data/{example22 → example23}/script/runner +0 -0
  58. data/{example22 → example23}/script/server +0 -0
  59. data/{example22 → example23}/test/fixtures/accounts.yml +0 -0
  60. data/{example22 → example23}/test/functional/accounts_controller_test.rb +0 -0
  61. data/{example22 → example23}/test/integration/account_figments_test.rb +0 -0
  62. data/{example22 → example23}/test/performance/browsing_test.rb +0 -0
  63. data/example23/test/test_helper.rb +3 -0
  64. data/example23/vendor/plugins/data_fabric/init.rb +3 -0
  65. data/example23/vendor/plugins/data_fabric/lib/data_fabric.rb +106 -0
  66. data/example23/vendor/plugins/data_fabric/lib/data_fabric/ar20.rb +133 -0
  67. data/example23/vendor/plugins/data_fabric/lib/data_fabric/ar22.rb +181 -0
  68. data/example23/vendor/plugins/data_fabric/lib/data_fabric/dash.rb +20 -0
  69. data/example23/vendor/plugins/data_fabric/lib/data_fabric/version.rb +7 -0
  70. data/lib/data_fabric/ar22.rb +2 -2
  71. data/lib/data_fabric/version.rb +1 -6
  72. data/test/connection_test.rb +1 -1
  73. data/test/database_test.rb +1 -1
  74. data/test/shard_test.rb +1 -1
  75. data/test/thread_test.rb +1 -1
  76. metadata +134 -126
  77. data/VERSION.yml +0 -4
  78. data/example22/test/test_helper.rb +0 -38
@@ -0,0 +1,20 @@
1
+ # A data_fabric recipe for use with the FiveRuns Dash metrics service at
2
+ # http://dash.fiveruns.com.
3
+ #
4
+ # Hook into your Rails application by adding the recipe in your
5
+ # config/initializers/dash.rb, like so:
6
+ #
7
+ # require 'data_fabric/dash'
8
+ # Fiveruns::Dash::Rails.start :production => 'your-token' do |config|
9
+ # config.add_recipe :data_fabric, :url => 'http://mikeperham.com'
10
+ # end
11
+ #
12
+ raise ArgumentError, "The Dash recipe for DataFabric is only supported on ActiveRecord 2.2 and greater" if ActiveRecord::VERSION::STRING < '2.2.0'
13
+
14
+ Fiveruns::Dash.register_recipe :data_fabric, :url => 'http://mikeperham.com' do |recipe|
15
+ recipe.absolute :open_connections, 'Open Connections' do
16
+ DataFabric::ConnectionProxy.shard_pools.values.map do |pool|
17
+ (pool.instance_variable_get(:@checked_out) || []).size
18
+ end.sum
19
+ end
20
+ end
@@ -0,0 +1,7 @@
1
+ require 'yaml'
2
+
3
+ module DataFabric
4
+ module Version
5
+ STRING = '1.2.7'
6
+ end
7
+ end
@@ -23,7 +23,7 @@ module DataFabric
23
23
 
24
24
  class << self
25
25
  def connection
26
- @proxy
26
+ @proxy || superclass.connection
27
27
  end
28
28
 
29
29
  def connected?
@@ -178,4 +178,4 @@ module DataFabric
178
178
  @proc.call
179
179
  end
180
180
  end
181
- end
181
+ end
@@ -1,10 +1,5 @@
1
- require 'yaml'
2
-
3
1
  module DataFabric
4
2
  module Version
5
- STRING = begin
6
- data = YAML.load(File.read(File.dirname(__FILE__) << "/../../VERSION.yml"))
7
- "#{data[:major]}.#{data[:minor]}.#{data[:patch]}"
8
- end
3
+ STRING = '1.2.7'
9
4
  end
10
5
  end
@@ -1,4 +1,4 @@
1
- require File.join(File.dirname(__FILE__), 'test_helper')
1
+ require 'test_helper'
2
2
  require 'flexmock/test_unit'
3
3
 
4
4
  class PrefixModel < ActiveRecord::Base
@@ -1,4 +1,4 @@
1
- require File.join(File.dirname(__FILE__), 'test_helper')
1
+ require 'test_helper'
2
2
  require 'flexmock/test_unit'
3
3
  require 'erb'
4
4
 
@@ -1,4 +1,4 @@
1
- require File.join(File.dirname(__FILE__), 'test_helper')
1
+ require 'test_helper'
2
2
 
3
3
  class ShardTest < Test::Unit::TestCase
4
4
 
@@ -1,4 +1,4 @@
1
- require File.join(File.dirname(__FILE__), 'test_helper')
1
+ require 'test_helper'
2
2
  require 'erb'
3
3
 
4
4
  class ThreadTest < Test::Unit::TestCase
metadata CHANGED
@@ -1,7 +1,12 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: data_fabric
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.2.5
4
+ prerelease: false
5
+ segments:
6
+ - 1
7
+ - 2
8
+ - 7
9
+ version: 1.2.7
5
10
  platform: ruby
6
11
  authors:
7
12
  - Mike Perham
@@ -9,10 +14,35 @@ autorequire:
9
14
  bindir: bin
10
15
  cert_chain: []
11
16
 
12
- date: 2009-03-28 00:00:00 -05:00
17
+ date: 2010-08-10 00:00:00 -07:00
13
18
  default_executable:
14
- dependencies: []
15
-
19
+ dependencies:
20
+ - !ruby/object:Gem::Dependency
21
+ name: jeweler
22
+ prerelease: false
23
+ requirement: &id001 !ruby/object:Gem::Requirement
24
+ none: false
25
+ requirements:
26
+ - - ">="
27
+ - !ruby/object:Gem::Version
28
+ segments:
29
+ - 0
30
+ version: "0"
31
+ type: :development
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
16
46
  description:
17
47
  email: mperham@gmail.com
18
48
  executables: []
@@ -22,62 +52,34 @@ extensions: []
22
52
  extra_rdoc_files:
23
53
  - README.rdoc
24
54
  files:
55
+ - CHANGELOG
25
56
  - README.rdoc
26
- - TESTING.rdoc
27
57
  - Rakefile
28
- - VERSION.yml
29
- - init.rb
30
- - CHANGELOG
31
- - lib/data_fabric
32
- - lib/data_fabric/ar20.rb
33
- - lib/data_fabric/ar22.rb
34
- - lib/data_fabric/dash.rb
35
- - lib/data_fabric/version.rb
36
- - lib/data_fabric.rb
37
- - test/connection_test.rb
38
- - test/database.yml
39
- - test/database.yml.mysql
40
- - test/database_test.rb
41
- - test/shard_test.rb
42
- - test/test_helper.rb
43
- - test/thread_test.rb
44
- - rails/init.rb
45
- - example/app
46
- - example/app/controllers
58
+ - TESTING.rdoc
59
+ - example/Rakefile
47
60
  - example/app/controllers/accounts_controller.rb
48
61
  - example/app/controllers/application.rb
49
62
  - example/app/controllers/figments_controller.rb
50
- - example/app/helpers
51
63
  - example/app/helpers/accounts_helper.rb
52
64
  - example/app/helpers/application_helper.rb
53
65
  - example/app/helpers/figments_helper.rb
54
- - example/app/models
55
66
  - example/app/models/account.rb
56
67
  - example/app/models/figment.rb
57
- - example/app/views
58
- - example/app/views/accounts
59
68
  - example/app/views/accounts/index.html.erb
60
- - example/app/views/layouts
61
69
  - example/app/views/layouts/application.html.erb
62
- - example/config
63
70
  - example/config/boot.rb
64
71
  - example/config/database.yml
65
72
  - example/config/environment.rb
66
- - example/config/environments
67
73
  - example/config/environments/development.rb
68
74
  - example/config/environments/production.rb
69
75
  - example/config/environments/test.rb
70
- - example/config/initializers
71
76
  - example/config/initializers/inflections.rb
72
77
  - example/config/initializers/mime_types.rb
73
78
  - example/config/initializers/new_rails_defaults.rb
74
79
  - example/config/routes.rb
75
- - example/db
76
- - example/db/migrate
77
80
  - example/db/migrate/20080702154628_create_accounts.rb
78
81
  - example/db/migrate/20080702154820_create_figments.rb
79
82
  - example/db/schema.rb
80
- - example/public
81
83
  - example/public/404.html
82
84
  - example/public/422.html
83
85
  - example/public/500.html
@@ -85,135 +87,141 @@ files:
85
87
  - example/public/dispatch.fcgi
86
88
  - example/public/dispatch.rb
87
89
  - example/public/favicon.ico
88
- - example/public/images
89
90
  - example/public/images/rails.png
90
91
  - example/public/robots.txt
91
- - example/Rakefile
92
- - example/script
93
92
  - example/script/about
94
93
  - example/script/console
95
94
  - example/script/dbconsole
96
95
  - example/script/destroy
97
96
  - example/script/generate
98
- - example/script/performance
99
97
  - example/script/performance/benchmarker
100
98
  - example/script/performance/profiler
101
99
  - example/script/performance/request
102
100
  - example/script/plugin
103
- - example/script/process
104
101
  - example/script/process/inspector
105
102
  - example/script/process/reaper
106
103
  - example/script/process/spawner
107
104
  - example/script/runner
108
105
  - example/script/server
109
- - example/test
110
- - example/test/fixtures
111
106
  - example/test/fixtures/accounts.yml
112
- - example/test/functional
113
107
  - example/test/functional/accounts_controller_test.rb
114
- - example/test/integration
115
108
  - example/test/integration/account_figments_test.rb
116
109
  - example/test/test_helper.rb
117
- - example22/app
118
- - example22/app/controllers
119
- - example22/app/controllers/accounts_controller.rb
120
- - example22/app/controllers/application.rb
121
- - example22/app/controllers/figments_controller.rb
122
- - example22/app/helpers
123
- - example22/app/helpers/application_helper.rb
124
- - example22/app/models
125
- - example22/app/models/account.rb
126
- - example22/app/models/figment.rb
127
- - example22/app/views
128
- - example22/app/views/accounts
129
- - example22/app/views/accounts/index.html.erb
130
- - example22/app/views/layouts
131
- - example22/app/views/layouts/application.html.erb
132
- - example22/config
133
- - example22/config/boot.rb
134
- - example22/config/database.yml
135
- - example22/config/environment.rb
136
- - example22/config/environments
137
- - example22/config/environments/development.rb
138
- - example22/config/environments/production.rb
139
- - example22/config/environments/test.rb
140
- - example22/config/initializers
141
- - example22/config/initializers/inflections.rb
142
- - example22/config/initializers/mime_types.rb
143
- - example22/config/initializers/new_rails_defaults.rb
144
- - example22/config/locales
145
- - example22/config/locales/en.yml
146
- - example22/config/routes.rb
147
- - example22/db
148
- - example22/db/migrate
149
- - example22/db/migrate/20080702154628_create_accounts.rb
150
- - example22/db/migrate/20080702154820_create_figments.rb
151
- - example22/public
152
- - example22/public/404.html
153
- - example22/public/422.html
154
- - example22/public/500.html
155
- - example22/public/dispatch.cgi
156
- - example22/public/dispatch.fcgi
157
- - example22/public/dispatch.rb
158
- - example22/public/favicon.ico
159
- - example22/public/images
160
- - example22/public/images/rails.png
161
- - example22/public/index.html
162
- - example22/public/robots.txt
163
- - example22/Rakefile
164
- - example22/script
165
- - example22/script/about
166
- - example22/script/console
167
- - example22/script/dbconsole
168
- - example22/script/destroy
169
- - example22/script/generate
170
- - example22/script/performance
171
- - example22/script/performance/benchmarker
172
- - example22/script/performance/profiler
173
- - example22/script/performance/request
174
- - example22/script/plugin
175
- - example22/script/process
176
- - example22/script/process/inspector
177
- - example22/script/process/reaper
178
- - example22/script/process/spawner
179
- - example22/script/runner
180
- - example22/script/server
181
- - example22/test
182
- - example22/test/fixtures
183
- - example22/test/fixtures/accounts.yml
184
- - example22/test/functional
185
- - example22/test/functional/accounts_controller_test.rb
186
- - example22/test/integration
187
- - example22/test/integration/account_figments_test.rb
188
- - example22/test/performance
189
- - example22/test/performance/browsing_test.rb
190
- - example22/test/test_helper.rb
110
+ - example23/Rakefile
111
+ - example23/app/controllers/accounts_controller.rb
112
+ - example23/app/controllers/application_controller.rb
113
+ - example23/app/controllers/figments_controller.rb
114
+ - example23/app/helpers/application_helper.rb
115
+ - example23/app/models/account.rb
116
+ - example23/app/models/figment.rb
117
+ - example23/app/views/accounts/index.html.erb
118
+ - example23/app/views/layouts/application.html.erb
119
+ - example23/config/boot.rb
120
+ - example23/config/database.yml
121
+ - example23/config/environment.rb
122
+ - example23/config/environments/development.rb
123
+ - example23/config/environments/production.rb
124
+ - example23/config/environments/test.rb
125
+ - example23/config/initializers/inflections.rb
126
+ - example23/config/initializers/mime_types.rb
127
+ - example23/config/initializers/new_rails_defaults.rb
128
+ - example23/config/locales/en.yml
129
+ - example23/config/routes.rb
130
+ - example23/db/development.sqlite3
131
+ - example23/db/migrate/20080702154628_create_accounts.rb
132
+ - 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
+ - example23/public/404.html
142
+ - example23/public/422.html
143
+ - example23/public/500.html
144
+ - example23/public/dispatch.cgi
145
+ - example23/public/dispatch.fcgi
146
+ - example23/public/dispatch.rb
147
+ - example23/public/favicon.ico
148
+ - example23/public/images/rails.png
149
+ - example23/public/index.html
150
+ - example23/public/robots.txt
151
+ - example23/script/about
152
+ - example23/script/console
153
+ - example23/script/dbconsole
154
+ - example23/script/destroy
155
+ - example23/script/generate
156
+ - example23/script/performance/benchmarker
157
+ - example23/script/performance/profiler
158
+ - example23/script/performance/request
159
+ - example23/script/plugin
160
+ - example23/script/process/inspector
161
+ - example23/script/process/reaper
162
+ - example23/script/process/spawner
163
+ - example23/script/runner
164
+ - example23/script/server
165
+ - example23/test/fixtures/accounts.yml
166
+ - example23/test/functional/accounts_controller_test.rb
167
+ - example23/test/integration/account_figments_test.rb
168
+ - example23/test/performance/browsing_test.rb
169
+ - 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
183
+ - test/connection_test.rb
184
+ - test/database.yml
185
+ - test/database.yml.mysql
186
+ - test/database_test.rb
187
+ - test/shard_test.rb
188
+ - test/test_helper.rb
189
+ - test/thread_test.rb
191
190
  has_rdoc: true
192
191
  homepage: http://github.com/mperham/data_fabric
192
+ licenses: []
193
+
193
194
  post_install_message:
194
195
  rdoc_options:
195
- - --inline-source
196
196
  - --charset=UTF-8
197
197
  require_paths:
198
198
  - lib
199
199
  required_ruby_version: !ruby/object:Gem::Requirement
200
+ none: false
200
201
  requirements:
201
202
  - - ">="
202
203
  - !ruby/object:Gem::Version
204
+ segments:
205
+ - 0
203
206
  version: "0"
204
- version:
205
207
  required_rubygems_version: !ruby/object:Gem::Requirement
208
+ none: false
206
209
  requirements:
207
210
  - - ">="
208
211
  - !ruby/object:Gem::Version
212
+ segments:
213
+ - 0
209
214
  version: "0"
210
- version:
211
215
  requirements: []
212
216
 
213
- rubyforge_project: fiveruns
214
- rubygems_version: 1.3.1
217
+ rubyforge_project:
218
+ rubygems_version: 1.3.7
215
219
  signing_key:
216
- specification_version: 2
220
+ specification_version: 3
217
221
  summary: Sharding and replication support for ActiveRecord 2.x
218
- test_files: []
219
-
222
+ test_files:
223
+ - test/connection_test.rb
224
+ - test/database_test.rb
225
+ - test/shard_test.rb
226
+ - test/test_helper.rb
227
+ - test/thread_test.rb
@@ -1,4 +0,0 @@
1
- ---
2
- :minor: 2
3
- :patch: 5
4
- :major: 1
@@ -1,38 +0,0 @@
1
- ENV["RAILS_ENV"] = "test"
2
- require File.expand_path(File.dirname(__FILE__) + "/../config/environment")
3
- require 'test_help'
4
-
5
- class Test::Unit::TestCase
6
- # Transactional fixtures accelerate your tests by wrapping each test method
7
- # in a transaction that's rolled back on completion. This ensures that the
8
- # test database remains unchanged so your fixtures don't have to be reloaded
9
- # between every test method. Fewer database queries means faster tests.
10
- #
11
- # Read Mike Clark's excellent walkthrough at
12
- # http://clarkware.com/cgi/blosxom/2005/10/24#Rails10FastTesting
13
- #
14
- # Every Active Record database supports transactions except MyISAM tables
15
- # in MySQL. Turn off transactional fixtures in this case; however, if you
16
- # don't care one way or the other, switching from MyISAM to InnoDB tables
17
- # is recommended.
18
- #
19
- # The only drawback to using transactional fixtures is when you actually
20
- # need to test transactions. Since your test is bracketed by a transaction,
21
- # any transactions started in your code will be automatically rolled back.
22
- self.use_transactional_fixtures = true
23
-
24
- # Instantiated fixtures are slow, but give you @david where otherwise you
25
- # would need people(:david). If you don't want to migrate your existing
26
- # test cases which use the @david style and don't mind the speed hit (each
27
- # instantiated fixtures translates to a database query per test method),
28
- # then set this back to true.
29
- self.use_instantiated_fixtures = false
30
-
31
- # Setup all fixtures in test/fixtures/*.(yml|csv) for all tests in alphabetical order.
32
- #
33
- # Note: You'll currently still have to declare fixtures explicitly in integration tests
34
- # -- they do not yet inherit this setting
35
- fixtures :all
36
-
37
- # Add more helper methods to be used by all tests here...
38
- end