ar-octopus 0.0.1

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/spec/spec.opts ADDED
@@ -0,0 +1,2 @@
1
+ --color
2
+ --format=specdoc
@@ -0,0 +1,27 @@
1
+ MIGRATIONS_ROOT = File.expand_path(File.join(File.dirname(__FILE__), 'migrations'))
2
+ require 'spec'
3
+ require 'spec/autorun'
4
+ require "database_connection"
5
+ require 'octopus'
6
+
7
+ Spec::Runner.configure do |config|
8
+ config.mock_with :rspec
9
+
10
+ config.before(:each) do
11
+ Octopus.stub!(:directory).and_return(File.dirname(__FILE__))
12
+ require "database_models"
13
+ clean_all_shards()
14
+ end
15
+
16
+ config.after(:each) do
17
+ clean_all_shards()
18
+ end
19
+ end
20
+
21
+ def clean_all_shards()
22
+ ActiveRecord::Base.using(:master).connection.shards.keys.each do |shard_symbol|
23
+ ['schema_migrations', 'users', 'clients', 'cats', 'items'].each do |tables|
24
+ ActiveRecord::Base.using(shard_symbol).connection.execute("DELETE FROM #{tables};")
25
+ end
26
+ end
27
+ end
metadata ADDED
@@ -0,0 +1,123 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: ar-octopus
3
+ version: !ruby/object:Gem::Version
4
+ prerelease: false
5
+ segments:
6
+ - 0
7
+ - 0
8
+ - 1
9
+ version: 0.0.1
10
+ platform: ruby
11
+ authors:
12
+ - Thiago Pradi
13
+ - Mike Perham
14
+ - Amit Agarwal
15
+ autorequire:
16
+ bindir: bin
17
+ cert_chain: []
18
+
19
+ date: 2010-06-11 00:00:00 -03:00
20
+ default_executable:
21
+ dependencies:
22
+ - !ruby/object:Gem::Dependency
23
+ name: rspec
24
+ prerelease: false
25
+ requirement: &id001 !ruby/object:Gem::Requirement
26
+ requirements:
27
+ - - ">="
28
+ - !ruby/object:Gem::Version
29
+ segments:
30
+ - 1
31
+ - 2
32
+ - 9
33
+ version: 1.2.9
34
+ type: :development
35
+ version_requirements: *id001
36
+ description: This gem allows you to use sharded databases with ActiveRecord. this also provides a interface for replication and for running migrations with multiples shards.
37
+ email: tchandy@gmail.com
38
+ executables: []
39
+
40
+ extensions: []
41
+
42
+ extra_rdoc_files:
43
+ - README.mkdn
44
+ files:
45
+ - README.mkdn
46
+ - Rakefile
47
+ - VERSION
48
+ - doc/api.textile
49
+ - doc/features.textile
50
+ - doc/libraries.textile
51
+ - doc/shards.yml
52
+ - lib/octopus.rb
53
+ - lib/octopus/controller.rb
54
+ - lib/octopus/migration.rb
55
+ - lib/octopus/model.rb
56
+ - lib/octopus/proxy.rb
57
+ - spec/config/shards.yml
58
+ - spec/database_connection.rb
59
+ - spec/database_models.rb
60
+ - spec/migrations/1_create_users_on_master.rb
61
+ - spec/migrations/2_create_users_on_canada.rb
62
+ - spec/migrations/3_create_users_on_both_shards.rb
63
+ - spec/migrations/4_create_users_on_shards_of_a_group.rb
64
+ - spec/migrations/5_create_users_on_multiples_groups.rb
65
+ - spec/migrations/6_raise_exception_with_invalid_shard_name.rb
66
+ - spec/migrations/7_raise_exception_with_invalid_multiple_shard_names.rb
67
+ - spec/migrations/8_raise_exception_with_invalid_group_name.rb
68
+ - spec/migrations/9_raise_exception_with_multiple_invalid_group_names.rb
69
+ - spec/octopus/controller_spec.rb
70
+ - spec/octopus/migration_spec.rb
71
+ - spec/octopus/model_spec.rb
72
+ - spec/octopus/octopus_spec.rb
73
+ - spec/octopus/proxy_spec.rb
74
+ - spec/spec.opts
75
+ - spec/spec_helper.rb
76
+ has_rdoc: true
77
+ homepage: http://github.com/tchandy/octopus
78
+ licenses: []
79
+
80
+ post_install_message:
81
+ rdoc_options:
82
+ - --charset=UTF-8
83
+ require_paths:
84
+ - lib
85
+ required_ruby_version: !ruby/object:Gem::Requirement
86
+ requirements:
87
+ - - ">="
88
+ - !ruby/object:Gem::Version
89
+ segments:
90
+ - 0
91
+ version: "0"
92
+ required_rubygems_version: !ruby/object:Gem::Requirement
93
+ requirements:
94
+ - - ">="
95
+ - !ruby/object:Gem::Version
96
+ segments:
97
+ - 0
98
+ version: "0"
99
+ requirements: []
100
+
101
+ rubyforge_project:
102
+ rubygems_version: 1.3.6
103
+ signing_key:
104
+ specification_version: 3
105
+ summary: Easy Database Sharding for ActiveRecord
106
+ test_files:
107
+ - spec/database_connection.rb
108
+ - spec/database_models.rb
109
+ - spec/migrations/1_create_users_on_master.rb
110
+ - spec/migrations/2_create_users_on_canada.rb
111
+ - spec/migrations/3_create_users_on_both_shards.rb
112
+ - spec/migrations/4_create_users_on_shards_of_a_group.rb
113
+ - spec/migrations/5_create_users_on_multiples_groups.rb
114
+ - spec/migrations/6_raise_exception_with_invalid_shard_name.rb
115
+ - spec/migrations/7_raise_exception_with_invalid_multiple_shard_names.rb
116
+ - spec/migrations/8_raise_exception_with_invalid_group_name.rb
117
+ - spec/migrations/9_raise_exception_with_multiple_invalid_group_names.rb
118
+ - spec/octopus/controller_spec.rb
119
+ - spec/octopus/migration_spec.rb
120
+ - spec/octopus/model_spec.rb
121
+ - spec/octopus/octopus_spec.rb
122
+ - spec/octopus/proxy_spec.rb
123
+ - spec/spec_helper.rb