Permalink
Browse files

Merge branch 'master' of github.com:mperham/data_fabric

  • Loading branch information...
2 parents 4587f92 + d864f13 commit 58849db8753d464d62cdca529da44c14e98bfbad @mperham mperham committed Nov 21, 2010
Showing with 196 additions and 74 deletions.
  1. +10 −0 CHANGELOG
  2. +1 −0 README.rdoc
  3. +12 −10 Rakefile
  4. +0 −4 VERSION.yml
  5. +163 −10 data_fabric.gemspec
  6. +0 −38 example22/test/test_helper.rb
  7. 0 {example22 → example23}/Rakefile
  8. 0 {example22 → example23}/app/controllers/accounts_controller.rb
  9. 0 example22/app/controllers/application.rb → example23/app/controllers/application_controller.rb
  10. 0 {example22 → example23}/app/controllers/figments_controller.rb
  11. 0 {example22 → example23}/app/helpers/application_helper.rb
  12. 0 {example22 → example23}/app/models/account.rb
  13. 0 {example22 → example23}/app/models/figment.rb
  14. 0 {example22 → example23}/app/views/accounts/index.html.erb
  15. 0 {example22 → example23}/app/views/layouts/application.html.erb
  16. 0 {example22 → example23}/config/boot.rb
  17. 0 {example22 → example23}/config/database.yml
  18. +2 −2 {example22 → example23}/config/environment.rb
  19. 0 {example22 → example23}/config/environments/development.rb
  20. 0 {example22 → example23}/config/environments/production.rb
  21. 0 {example22 → example23}/config/environments/test.rb
  22. 0 {example22 → example23}/config/initializers/inflections.rb
  23. 0 {example22 → example23}/config/initializers/mime_types.rb
  24. 0 {example22 → example23}/config/initializers/new_rails_defaults.rb
  25. 0 {example22 → example23}/config/locales/en.yml
  26. 0 {example22 → example23}/config/routes.rb
  27. 0 {example22 → example23}/db/migrate/20080702154628_create_accounts.rb
  28. 0 {example22 → example23}/db/migrate/20080702154820_create_figments.rb
  29. 0 {example22 → example23}/public/404.html
  30. 0 {example22 → example23}/public/422.html
  31. 0 {example22 → example23}/public/500.html
  32. 0 {example22 → example23}/public/dispatch.cgi
  33. 0 {example22 → example23}/public/dispatch.fcgi
  34. 0 {example22 → example23}/public/dispatch.rb
  35. 0 {example22 → example23}/public/favicon.ico
  36. BIN {example22 → example23}/public/images/rails.png
  37. 0 {example22 → example23}/public/index.html
  38. 0 {example22 → example23}/public/robots.txt
  39. 0 {example22 → example23}/script/about
  40. 0 {example22 → example23}/script/console
  41. 0 {example22 → example23}/script/dbconsole
  42. 0 {example22 → example23}/script/destroy
  43. 0 {example22 → example23}/script/generate
  44. 0 {example22 → example23}/script/performance/benchmarker
  45. 0 {example22 → example23}/script/performance/profiler
  46. 0 {example22 → example23}/script/performance/request
  47. 0 {example22 → example23}/script/plugin
  48. 0 {example22 → example23}/script/process/inspector
  49. 0 {example22 → example23}/script/process/reaper
  50. 0 {example22 → example23}/script/process/spawner
  51. 0 {example22 → example23}/script/runner
  52. 0 {example22 → example23}/script/server
  53. 0 {example22 → example23}/test/fixtures/accounts.yml
  54. 0 {example22 → example23}/test/functional/accounts_controller_test.rb
  55. 0 {example22 → example23}/test/integration/account_figments_test.rb
  56. 0 {example22 → example23}/test/performance/browsing_test.rb
  57. +3 −0 example23/test/test_helper.rb
  58. +1 −6 lib/data_fabric/version.rb
  59. +1 −1 test/connection_test.rb
  60. +1 −1 test/database_test.rb
  61. +1 −1 test/shard_test.rb
  62. +1 −1 test/thread_test.rb
View
@@ -1,5 +1,15 @@
DataFabric changelog
+v1.2.7 - 2010-08-10
+
+- NO FUNCTIONAL CHANGES.
+- Fix test suite under Ruby 1.9.2.
+- Update example22 application to example23 and Rails 2.3.
+
+v1.2.6 - Never released
+
+- STI fixes.
+
v1.2.5 - 2009-03-28
- data_fabric should now work as a gem or plugin.
View
@@ -88,6 +88,7 @@ FiveRuns:: for paying me to develop this code and allowing its release
Mike Perham <mperham@gmail.com>
http://mikeperham.com
+http://twitter.com/mperham
== LICENSE:
View
@@ -1,25 +1,28 @@
require 'rubygems'
begin
+ require './lib/data_fabric/version'
require 'jeweler'
-
Jeweler::Tasks.new do |p|
+ p.version = DataFabric::Version::STRING
p.authors = ["Mike Perham"]
p.email = 'mperham@gmail.com'
- p.rubyforge_project = 'fiveruns'
p.summary = 'Sharding and replication support for ActiveRecord 2.x'
p.homepage = "http://github.com/mperham/data_fabric"
p.name = "data_fabric"
- p.files = FileList['*.rdoc', 'Rakefile', 'VERSION.yml', 'init.rb', 'CHANGELOG', "{lib,test,rails,example,example22}/**/*", ]
+ p.files = FileList['*.rdoc', 'Rakefile', 'init.rb', 'CHANGELOG', "{lib,test,rails,example,example23}/**/*", ]
+ p.add_development_dependency 'jeweler'
+ p.add_development_dependency 'flexmock'
end
-rescue LoadError
- puts "Jeweler, or one of its dependencies, is not available. Install it with: sudo gem install technicalpickles-jeweler -s http://gems.github.com"
+rescue LoadError => le
+ puts "Jeweler, or one of its dependencies, is not available. Install it with: gem install jeweler: #{le.message}"
end
require 'rake/testtask'
Rake::TestTask.new do |t|
t.verbose = true
+ t.libs << 'test' << 'rails'
t.test_files = FileList['test/*_test.rb']
end
@@ -28,13 +31,12 @@ task :gemspec => [:clean]
task :clean do
FileUtils.rm_f Dir['*.gem']
FileUtils.rm_f Dir['test/*.db']
- FileUtils.rm_rf 'pkg'
FileUtils.rm_rf 'coverage'
end
desc "Install gem locally"
task :installer do
- sh "sudo gem install data_fabric-*.gem"
+ sh "gem install data_fabric-*.gem"
end
task :gem do
@@ -43,8 +45,8 @@ end
desc "Push gem to RubyForge"
task :publish => [:clean, :gemspec, :gem, :installer] do
- require 'lib/data_fabric/version'
- sh "rubyforge add_release fiveruns data_fabric #{DataFabric::Version::STRING} data_fabric-#{DataFabric::Version::STRING}.gem"
+ require './lib/data_fabric/version'
+ sh "gem push data_fabric-#{DataFabric::Version::STRING}.gem"
end
@@ -144,5 +146,5 @@ begin
t.rcov_opts = ['--text-report', '--exclude', "test,Library,#{ENV['GEM_HOME']}", '--sort', 'coverage']
end
rescue LoadError => e
- puts 'Test coverage support requires \'gem install rcov --source=http://gemcutter.org/\''
+ puts 'Test coverage support requires \'gem install rcov\''
end
View
@@ -1,4 +0,0 @@
----
-:minor: 2
-:patch: 7
-:major: 1
View
@@ -1,30 +1,183 @@
+# Generated by jeweler
+# DO NOT EDIT THIS FILE DIRECTLY
+# Instead, edit Jeweler::Tasks in Rakefile, and run the gemspec command
# -*- encoding: utf-8 -*-
Gem::Specification.new do |s|
s.name = %q{data_fabric}
- s.version = "1.2.5"
+ s.version = "1.2.7"
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
s.authors = ["Mike Perham"]
- s.date = %q{2009-03-28}
+ s.date = %q{2010-08-10}
s.email = %q{mperham@gmail.com}
- s.extra_rdoc_files = ["README.rdoc"]
- s.files = ["README.rdoc", "TESTING.rdoc", "Rakefile", "VERSION.yml", "init.rb", "CHANGELOG", "lib/data_fabric", "lib/data_fabric/ar20.rb", "lib/data_fabric/ar22.rb", "lib/data_fabric/dash.rb", "lib/data_fabric/version.rb", "lib/data_fabric.rb", "test/connection_test.rb", "test/database.yml", "test/database.yml.mysql", "test/database_test.rb", "test/shard_test.rb", "test/test_helper.rb", "test/thread_test.rb", "rails/init.rb", "example/app", "example/app/controllers", "example/app/controllers/accounts_controller.rb", "example/app/controllers/application.rb", "example/app/controllers/figments_controller.rb", "example/app/helpers", "example/app/helpers/accounts_helper.rb", "example/app/helpers/application_helper.rb", "example/app/helpers/figments_helper.rb", "example/app/models", "example/app/models/account.rb", "example/app/models/figment.rb", "example/app/views", "example/app/views/accounts", "example/app/views/accounts/index.html.erb", "example/app/views/layouts", "example/app/views/layouts/application.html.erb", "example/config", "example/config/boot.rb", "example/config/database.yml", "example/config/environment.rb", "example/config/environments", "example/config/environments/development.rb", "example/config/environments/production.rb", "example/config/environments/test.rb", "example/config/initializers", "example/config/initializers/inflections.rb", "example/config/initializers/mime_types.rb", "example/config/initializers/new_rails_defaults.rb", "example/config/routes.rb", "example/db", "example/db/migrate", "example/db/migrate/20080702154628_create_accounts.rb", "example/db/migrate/20080702154820_create_figments.rb", "example/db/schema.rb", "example/public", "example/public/404.html", "example/public/422.html", "example/public/500.html", "example/public/dispatch.cgi", "example/public/dispatch.fcgi", "example/public/dispatch.rb", "example/public/favicon.ico", "example/public/images", "example/public/images/rails.png", "example/public/robots.txt", "example/Rakefile", "example/script", "example/script/about", "example/script/console", "example/script/dbconsole", "example/script/destroy", "example/script/generate", "example/script/performance", "example/script/performance/benchmarker", "example/script/performance/profiler", "example/script/performance/request", "example/script/plugin", "example/script/process", "example/script/process/inspector", "example/script/process/reaper", "example/script/process/spawner", "example/script/runner", "example/script/server", "example/test", "example/test/fixtures", "example/test/fixtures/accounts.yml", "example/test/functional", "example/test/functional/accounts_controller_test.rb", "example/test/integration", "example/test/integration/account_figments_test.rb", "example/test/test_helper.rb", "example22/app", "example22/app/controllers", "example22/app/controllers/accounts_controller.rb", "example22/app/controllers/application.rb", "example22/app/controllers/figments_controller.rb", "example22/app/helpers", "example22/app/helpers/application_helper.rb", "example22/app/models", "example22/app/models/account.rb", "example22/app/models/figment.rb", "example22/app/views", "example22/app/views/accounts", "example22/app/views/accounts/index.html.erb", "example22/app/views/layouts", "example22/app/views/layouts/application.html.erb", "example22/config", "example22/config/boot.rb", "example22/config/database.yml", "example22/config/environment.rb", "example22/config/environments", "example22/config/environments/development.rb", "example22/config/environments/production.rb", "example22/config/environments/test.rb", "example22/config/initializers", "example22/config/initializers/inflections.rb", "example22/config/initializers/mime_types.rb", "example22/config/initializers/new_rails_defaults.rb", "example22/config/locales", "example22/config/locales/en.yml", "example22/config/routes.rb", "example22/db", "example22/db/migrate", "example22/db/migrate/20080702154628_create_accounts.rb", "example22/db/migrate/20080702154820_create_figments.rb", "example22/public", "example22/public/404.html", "example22/public/422.html", "example22/public/500.html", "example22/public/dispatch.cgi", "example22/public/dispatch.fcgi", "example22/public/dispatch.rb", "example22/public/favicon.ico", "example22/public/images", "example22/public/images/rails.png", "example22/public/index.html", "example22/public/robots.txt", "example22/Rakefile", "example22/script", "example22/script/about", "example22/script/console", "example22/script/dbconsole", "example22/script/destroy", "example22/script/generate", "example22/script/performance", "example22/script/performance/benchmarker", "example22/script/performance/profiler", "example22/script/performance/request", "example22/script/plugin", "example22/script/process", "example22/script/process/inspector", "example22/script/process/reaper", "example22/script/process/spawner", "example22/script/runner", "example22/script/server", "example22/test", "example22/test/fixtures", "example22/test/fixtures/accounts.yml", "example22/test/functional", "example22/test/functional/accounts_controller_test.rb", "example22/test/integration", "example22/test/integration/account_figments_test.rb", "example22/test/performance", "example22/test/performance/browsing_test.rb", "example22/test/test_helper.rb"]
- s.has_rdoc = true
+ s.extra_rdoc_files = [
+ "README.rdoc"
+ ]
+ s.files = [
+ "CHANGELOG",
+ "README.rdoc",
+ "Rakefile",
+ "TESTING.rdoc",
+ "example/Rakefile",
+ "example/app/controllers/accounts_controller.rb",
+ "example/app/controllers/application.rb",
+ "example/app/controllers/figments_controller.rb",
+ "example/app/helpers/accounts_helper.rb",
+ "example/app/helpers/application_helper.rb",
+ "example/app/helpers/figments_helper.rb",
+ "example/app/models/account.rb",
+ "example/app/models/figment.rb",
+ "example/app/views/accounts/index.html.erb",
+ "example/app/views/layouts/application.html.erb",
+ "example/config/boot.rb",
+ "example/config/database.yml",
+ "example/config/environment.rb",
+ "example/config/environments/development.rb",
+ "example/config/environments/production.rb",
+ "example/config/environments/test.rb",
+ "example/config/initializers/inflections.rb",
+ "example/config/initializers/mime_types.rb",
+ "example/config/initializers/new_rails_defaults.rb",
+ "example/config/routes.rb",
+ "example/db/migrate/20080702154628_create_accounts.rb",
+ "example/db/migrate/20080702154820_create_figments.rb",
+ "example/db/schema.rb",
+ "example/public/404.html",
+ "example/public/422.html",
+ "example/public/500.html",
+ "example/public/dispatch.cgi",
+ "example/public/dispatch.fcgi",
+ "example/public/dispatch.rb",
+ "example/public/favicon.ico",
+ "example/public/images/rails.png",
+ "example/public/robots.txt",
+ "example/script/about",
+ "example/script/console",
+ "example/script/dbconsole",
+ "example/script/destroy",
+ "example/script/generate",
+ "example/script/performance/benchmarker",
+ "example/script/performance/profiler",
+ "example/script/performance/request",
+ "example/script/plugin",
+ "example/script/process/inspector",
+ "example/script/process/reaper",
+ "example/script/process/spawner",
+ "example/script/runner",
+ "example/script/server",
+ "example/test/fixtures/accounts.yml",
+ "example/test/functional/accounts_controller_test.rb",
+ "example/test/integration/account_figments_test.rb",
+ "example/test/test_helper.rb",
+ "example23/Rakefile",
+ "example23/app/controllers/accounts_controller.rb",
+ "example23/app/controllers/application_controller.rb",
+ "example23/app/controllers/figments_controller.rb",
+ "example23/app/helpers/application_helper.rb",
+ "example23/app/models/account.rb",
+ "example23/app/models/figment.rb",
+ "example23/app/views/accounts/index.html.erb",
+ "example23/app/views/layouts/application.html.erb",
+ "example23/config/boot.rb",
+ "example23/config/database.yml",
+ "example23/config/environment.rb",
+ "example23/config/environments/development.rb",
+ "example23/config/environments/production.rb",
+ "example23/config/environments/test.rb",
+ "example23/config/initializers/inflections.rb",
+ "example23/config/initializers/mime_types.rb",
+ "example23/config/initializers/new_rails_defaults.rb",
+ "example23/config/locales/en.yml",
+ "example23/config/routes.rb",
+ "example23/db/development.sqlite3",
+ "example23/db/migrate/20080702154628_create_accounts.rb",
+ "example23/db/migrate/20080702154820_create_figments.rb",
+ "example23/db/s0_development.sqlite3",
+ "example23/db/s0_test.sqlite3",
+ "example23/db/s1_development.sqlite3",
+ "example23/db/s1_test.sqlite3",
+ "example23/db/schema.rb",
+ "example23/db/test.sqlite3",
+ "example23/log/development.log",
+ "example23/log/test.log",
+ "example23/public/404.html",
+ "example23/public/422.html",
+ "example23/public/500.html",
+ "example23/public/dispatch.cgi",
+ "example23/public/dispatch.fcgi",
+ "example23/public/dispatch.rb",
+ "example23/public/favicon.ico",
+ "example23/public/images/rails.png",
+ "example23/public/index.html",
+ "example23/public/robots.txt",
+ "example23/script/about",
+ "example23/script/console",
+ "example23/script/dbconsole",
+ "example23/script/destroy",
+ "example23/script/generate",
+ "example23/script/performance/benchmarker",
+ "example23/script/performance/profiler",
+ "example23/script/performance/request",
+ "example23/script/plugin",
+ "example23/script/process/inspector",
+ "example23/script/process/reaper",
+ "example23/script/process/spawner",
+ "example23/script/runner",
+ "example23/script/server",
+ "example23/test/fixtures/accounts.yml",
+ "example23/test/functional/accounts_controller_test.rb",
+ "example23/test/integration/account_figments_test.rb",
+ "example23/test/performance/browsing_test.rb",
+ "example23/test/test_helper.rb",
+ "example23/vendor/plugins/data_fabric/init.rb",
+ "example23/vendor/plugins/data_fabric/lib/data_fabric.rb",
+ "example23/vendor/plugins/data_fabric/lib/data_fabric/ar20.rb",
+ "example23/vendor/plugins/data_fabric/lib/data_fabric/ar22.rb",
+ "example23/vendor/plugins/data_fabric/lib/data_fabric/dash.rb",
+ "example23/vendor/plugins/data_fabric/lib/data_fabric/version.rb",
+ "init.rb",
+ "lib/data_fabric.rb",
+ "lib/data_fabric/ar20.rb",
+ "lib/data_fabric/ar22.rb",
+ "lib/data_fabric/dash.rb",
+ "lib/data_fabric/version.rb",
+ "rails/init.rb",
+ "test/connection_test.rb",
+ "test/database.yml",
+ "test/database.yml.mysql",
+ "test/database_test.rb",
+ "test/shard_test.rb",
+ "test/test_helper.rb",
+ "test/thread_test.rb"
+ ]
s.homepage = %q{http://github.com/mperham/data_fabric}
- s.rdoc_options = ["--inline-source", "--charset=UTF-8"]
+ s.rdoc_options = ["--charset=UTF-8"]
s.require_paths = ["lib"]
- s.rubyforge_project = %q{fiveruns}
- s.rubygems_version = %q{1.3.1}
+ s.rubygems_version = %q{1.3.7}
s.summary = %q{Sharding and replication support for ActiveRecord 2.x}
+ s.test_files = [
+ "test/connection_test.rb",
+ "test/database_test.rb",
+ "test/shard_test.rb",
+ "test/test_helper.rb",
+ "test/thread_test.rb"
+ ]
if s.respond_to? :specification_version then
current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION
- s.specification_version = 2
+ s.specification_version = 3
- if Gem::Version.new(Gem::RubyGemsVersion) >= Gem::Version.new('1.2.0') then
+ if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
+ s.add_development_dependency(%q<jeweler>, [">= 0"])
+ s.add_development_dependency(%q<flexmock>, [">= 0"])
else
+ s.add_dependency(%q<jeweler>, [">= 0"])
+ s.add_dependency(%q<flexmock>, [">= 0"])
end
else
+ s.add_dependency(%q<jeweler>, [">= 0"])
+ s.add_dependency(%q<flexmock>, [">= 0"])
end
end
+
@@ -1,38 +0,0 @@
-ENV["RAILS_ENV"] = "test"
-require File.expand_path(File.dirname(__FILE__) + "/../config/environment")
-require 'test_help'
-
-class Test::Unit::TestCase
- # Transactional fixtures accelerate your tests by wrapping each test method
- # in a transaction that's rolled back on completion. This ensures that the
- # test database remains unchanged so your fixtures don't have to be reloaded
- # between every test method. Fewer database queries means faster tests.
- #
- # Read Mike Clark's excellent walkthrough at
- # http://clarkware.com/cgi/blosxom/2005/10/24#Rails10FastTesting
- #
- # Every Active Record database supports transactions except MyISAM tables
- # in MySQL. Turn off transactional fixtures in this case; however, if you
- # don't care one way or the other, switching from MyISAM to InnoDB tables
- # is recommended.
- #
- # The only drawback to using transactional fixtures is when you actually
- # need to test transactions. Since your test is bracketed by a transaction,
- # any transactions started in your code will be automatically rolled back.
- self.use_transactional_fixtures = true
-
- # Instantiated fixtures are slow, but give you @david where otherwise you
- # would need people(:david). If you don't want to migrate your existing
- # test cases which use the @david style and don't mind the speed hit (each
- # instantiated fixtures translates to a database query per test method),
- # then set this back to true.
- self.use_instantiated_fixtures = false
-
- # Setup all fixtures in test/fixtures/*.(yml|csv) for all tests in alphabetical order.
- #
- # Note: You'll currently still have to declare fixtures explicitly in integration tests
- # -- they do not yet inherit this setting
- fixtures :all
-
- # Add more helper methods to be used by all tests here...
-end
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
@@ -5,7 +5,7 @@
# ENV['RAILS_ENV'] ||= 'production'
# Specifies gem version of Rails to use when vendor/rails is not present
-RAILS_GEM_VERSION = '2.2.2' unless defined? RAILS_GEM_VERSION
+#RAILS_GEM_VERSION = '2.2.2' unless defined? RAILS_GEM_VERSION
# Bootstrap the Rails environment, frameworks, and default configuration
require File.join(File.dirname(__FILE__), 'boot')
@@ -55,7 +55,7 @@
# Make sure the secret is at least 30 characters and all random,
# no regular words or you'll be exposed to dictionary attacks.
config.action_controller.session = {
- :session_key => '_example22_session',
+ :key => '_example22_session',
:secret => 'a726ae17b1f84e51e5ae5f8bc861a92dcffb188a7a1e9cb88c0c513ce9722b0983ee718c79741260669bfbc69b68044129fc11d8792b90fa912d719992cb9574'
}
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
@@ -0,0 +1,3 @@
+ENV["RAILS_ENV"] = "test"
+require File.expand_path(File.dirname(__FILE__) + "/../config/environment")
+require 'test_help'
@@ -1,10 +1,5 @@
-require 'yaml'
-
module DataFabric
module Version
- STRING = begin
- data = YAML.load(File.read(File.dirname(__FILE__) << "/../../VERSION.yml"))
- "#{data[:major]}.#{data[:minor]}.#{data[:patch]}"
- end
+ STRING = '1.2.7'
end
end
View
@@ -1,4 +1,4 @@
-require File.join(File.dirname(__FILE__), 'test_helper')
+require 'test_helper'
require 'flexmock/test_unit'
class PrefixModel < ActiveRecord::Base
View
@@ -1,4 +1,4 @@
-require File.join(File.dirname(__FILE__), 'test_helper')
+require 'test_helper'
require 'flexmock/test_unit'
require 'erb'
View
@@ -1,4 +1,4 @@
-require File.join(File.dirname(__FILE__), 'test_helper')
+require 'test_helper'
class ShardTest < Test::Unit::TestCase
View
@@ -1,4 +1,4 @@
-require File.join(File.dirname(__FILE__), 'test_helper')
+require 'test_helper'
require 'erb'
class ThreadTest < Test::Unit::TestCase

0 comments on commit 58849db

Please sign in to comment.