bigrecord 0.0.5
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/MIT-LICENSE +20 -0
- data/README.rdoc +44 -0
- data/Rakefile +17 -0
- data/VERSION +1 -0
- data/doc/bigrecord_specs.rdoc +36 -0
- data/doc/getting_started.rdoc +157 -0
- data/examples/bigrecord.yml +25 -0
- data/generators/bigrecord/bigrecord_generator.rb +17 -0
- data/generators/bigrecord/templates/bigrecord.rake +47 -0
- data/generators/bigrecord_migration/bigrecord_migration_generator.rb +13 -0
- data/generators/bigrecord_migration/templates/migration.rb +9 -0
- data/generators/bigrecord_model/bigrecord_model_generator.rb +28 -0
- data/generators/bigrecord_model/templates/migration.rb +13 -0
- data/generators/bigrecord_model/templates/model.rb +7 -0
- data/generators/bigrecord_model/templates/model_spec.rb +12 -0
- data/init.rb +9 -0
- data/install.rb +22 -0
- data/lib/big_record/abstract_base.rb +1088 -0
- data/lib/big_record/action_view_extensions.rb +266 -0
- data/lib/big_record/ar_associations/association_collection.rb +194 -0
- data/lib/big_record/ar_associations/association_proxy.rb +158 -0
- data/lib/big_record/ar_associations/belongs_to_association.rb +57 -0
- data/lib/big_record/ar_associations/belongs_to_many_association.rb +57 -0
- data/lib/big_record/ar_associations/has_and_belongs_to_many_association.rb +164 -0
- data/lib/big_record/ar_associations/has_many_association.rb +191 -0
- data/lib/big_record/ar_associations/has_one_association.rb +80 -0
- data/lib/big_record/ar_associations.rb +1608 -0
- data/lib/big_record/ar_reflection.rb +223 -0
- data/lib/big_record/attribute_methods.rb +75 -0
- data/lib/big_record/base.rb +618 -0
- data/lib/big_record/br_associations/association_collection.rb +194 -0
- data/lib/big_record/br_associations/association_proxy.rb +153 -0
- data/lib/big_record/br_associations/belongs_to_association.rb +52 -0
- data/lib/big_record/br_associations/belongs_to_many_association.rb +293 -0
- data/lib/big_record/br_associations/cached_item_proxy.rb +194 -0
- data/lib/big_record/br_associations/cached_item_proxy_factory.rb +62 -0
- data/lib/big_record/br_associations/has_and_belongs_to_many_association.rb +168 -0
- data/lib/big_record/br_associations/has_one_association.rb +80 -0
- data/lib/big_record/br_associations.rb +978 -0
- data/lib/big_record/br_reflection.rb +151 -0
- data/lib/big_record/callbacks.rb +367 -0
- data/lib/big_record/connection_adapters/abstract/connection_specification.rb +279 -0
- data/lib/big_record/connection_adapters/abstract/database_statements.rb +175 -0
- data/lib/big_record/connection_adapters/abstract/quoting.rb +58 -0
- data/lib/big_record/connection_adapters/abstract_adapter.rb +190 -0
- data/lib/big_record/connection_adapters/column.rb +491 -0
- data/lib/big_record/connection_adapters/hbase_adapter.rb +432 -0
- data/lib/big_record/connection_adapters/view.rb +27 -0
- data/lib/big_record/connection_adapters.rb +10 -0
- data/lib/big_record/deletion.rb +73 -0
- data/lib/big_record/dynamic_schema.rb +92 -0
- data/lib/big_record/embedded.rb +71 -0
- data/lib/big_record/embedded_associations/association_proxy.rb +148 -0
- data/lib/big_record/family_span_columns.rb +89 -0
- data/lib/big_record/fixtures.rb +1025 -0
- data/lib/big_record/migration.rb +380 -0
- data/lib/big_record/routing_ext.rb +65 -0
- data/lib/big_record/timestamp.rb +51 -0
- data/lib/big_record/validations.rb +830 -0
- data/lib/big_record.rb +125 -0
- data/lib/bigrecord.rb +1 -0
- data/rails/init.rb +9 -0
- data/spec/connections/bigrecord.yml +13 -0
- data/spec/connections/cassandra/connection.rb +2 -0
- data/spec/connections/hbase/connection.rb +2 -0
- data/spec/debug.log +281 -0
- data/spec/integration/br_associations_spec.rb +80 -0
- data/spec/lib/animal.rb +12 -0
- data/spec/lib/book.rb +10 -0
- data/spec/lib/broken_migrations/duplicate_name/20090706182535_add_animals_table.rb +14 -0
- data/spec/lib/broken_migrations/duplicate_name/20090706193019_add_animals_table.rb +9 -0
- data/spec/lib/broken_migrations/duplicate_version/20090706190623_add_books_table.rb +9 -0
- data/spec/lib/broken_migrations/duplicate_version/20090706190623_add_companies_table.rb +9 -0
- data/spec/lib/company.rb +14 -0
- data/spec/lib/embedded/web_link.rb +12 -0
- data/spec/lib/employee.rb +33 -0
- data/spec/lib/migrations/20090706182535_add_animals_table.rb +13 -0
- data/spec/lib/migrations/20090706190623_add_books_table.rb +15 -0
- data/spec/lib/migrations/20090706193019_add_companies_table.rb +14 -0
- data/spec/lib/migrations/20090706194512_add_employees_table.rb +13 -0
- data/spec/lib/migrations/20090706195741_add_zoos_table.rb +13 -0
- data/spec/lib/novel.rb +5 -0
- data/spec/lib/zoo.rb +17 -0
- data/spec/spec.opts +4 -0
- data/spec/spec_helper.rb +55 -0
- data/spec/unit/abstract_base_spec.rb +287 -0
- data/spec/unit/adapters/abstract_adapter_spec.rb +56 -0
- data/spec/unit/adapters/adapter_shared_spec.rb +51 -0
- data/spec/unit/adapters/hbase_adapter_spec.rb +15 -0
- data/spec/unit/ar_associations_spec.rb +8 -0
- data/spec/unit/base_spec.rb +6 -0
- data/spec/unit/br_associations_spec.rb +58 -0
- data/spec/unit/embedded_spec.rb +43 -0
- data/spec/unit/find_spec.rb +34 -0
- data/spec/unit/hash_helper_spec.rb +44 -0
- data/spec/unit/migration_spec.rb +144 -0
- data/spec/unit/model_spec.rb +315 -0
- data/spec/unit/validations_spec.rb +182 -0
- data/tasks/bigrecord_tasks.rake +47 -0
- data/tasks/data_store.rb +46 -0
- data/tasks/gem.rb +22 -0
- data/tasks/rdoc.rb +8 -0
- data/tasks/spec.rb +34 -0
- metadata +189 -0
|
@@ -0,0 +1,182 @@
|
|
|
1
|
+
require File.expand_path(File.join(File.dirname(__FILE__), '..', 'spec_helper'))
|
|
2
|
+
|
|
3
|
+
module EmployeeSpecHelper
|
|
4
|
+
def valid_employee_attributes
|
|
5
|
+
{ :first_name => "John",
|
|
6
|
+
:last_name => "Smith",
|
|
7
|
+
:middle_name => "Jacob",
|
|
8
|
+
:email => "johnsmith@email.com",
|
|
9
|
+
:title => "Developer",
|
|
10
|
+
:password => "abcdefg",
|
|
11
|
+
:gender => "m",
|
|
12
|
+
:contract => "1",
|
|
13
|
+
:age => 25
|
|
14
|
+
}
|
|
15
|
+
end
|
|
16
|
+
|
|
17
|
+
def ensure_error_added(model, attribute, message = nil)
|
|
18
|
+
model.errors.on(attribute).should_not be_nil
|
|
19
|
+
model.errors.on(attribute).should include(message) unless message.blank?
|
|
20
|
+
end
|
|
21
|
+
end
|
|
22
|
+
|
|
23
|
+
describe BigRecord::Validations do
|
|
24
|
+
include EmployeeSpecHelper
|
|
25
|
+
|
|
26
|
+
before(:all) do
|
|
27
|
+
@error_messages = BigRecord::Errors.default_error_messages.freeze
|
|
28
|
+
end
|
|
29
|
+
|
|
30
|
+
before(:each) do
|
|
31
|
+
@employee = Employee.new
|
|
32
|
+
end
|
|
33
|
+
|
|
34
|
+
describe "#validates_presence_of" do
|
|
35
|
+
|
|
36
|
+
it "should add an error to the record if it's missing required attributes" do
|
|
37
|
+
@employee.attributes = valid_employee_attributes.except(:first_name, :last_name)
|
|
38
|
+
|
|
39
|
+
@employee.valid?.should be_false
|
|
40
|
+
|
|
41
|
+
ensure_error_added(@employee, :first_name, @error_messages[:blank])
|
|
42
|
+
ensure_error_added(@employee, :last_name, @error_messages[:blank])
|
|
43
|
+
|
|
44
|
+
@employee.first_name = valid_employee_attributes[:first_name]
|
|
45
|
+
@employee.valid?.should be_false # still missing :last_name
|
|
46
|
+
|
|
47
|
+
ensure_error_added(@employee, :last_name, @error_messages[:blank])
|
|
48
|
+
|
|
49
|
+
@employee.last_name = valid_employee_attributes[:last_name]
|
|
50
|
+
@employee.valid?.should be_true
|
|
51
|
+
end
|
|
52
|
+
|
|
53
|
+
end
|
|
54
|
+
|
|
55
|
+
describe "#validates_uniqueness_of" do
|
|
56
|
+
|
|
57
|
+
it "should add an error to the record if an attribute is not unique" do
|
|
58
|
+
pending "this needs to be implemented"
|
|
59
|
+
end
|
|
60
|
+
|
|
61
|
+
end
|
|
62
|
+
|
|
63
|
+
describe "#validates_length_of" do
|
|
64
|
+
it "should add an error to the record if an attribute is not of appropriate length" do
|
|
65
|
+
# Employee is expecting the first_name attribute to be [2, 50]
|
|
66
|
+
@employee.attributes = valid_employee_attributes.except(:first_name)
|
|
67
|
+
@employee.first_name = "A"
|
|
68
|
+
|
|
69
|
+
@employee.valid?.should be_false
|
|
70
|
+
ensure_error_added(@employee, :first_name, (@error_messages[:too_short] % 2))
|
|
71
|
+
|
|
72
|
+
@employee.first_name = "TgsCFInjEcJScTIVVICiyiKhYIJtdOezdqdLHqAPHTJCQTqyaWG" # 51 characters
|
|
73
|
+
@employee.valid?.should be_false
|
|
74
|
+
ensure_error_added(@employee, :first_name, (@error_messages[:too_long] % 50))
|
|
75
|
+
|
|
76
|
+
@employee.first_name = "John"
|
|
77
|
+
@employee.valid?.should be_true
|
|
78
|
+
end
|
|
79
|
+
end
|
|
80
|
+
|
|
81
|
+
describe "#validates_format_of" do
|
|
82
|
+
it "should add an error to the record if an attribute is not a valid format" do
|
|
83
|
+
@employee.attributes = valid_employee_attributes.except(:first_name)
|
|
84
|
+
@employee.first_name = "$0m3!funky*n4m3"
|
|
85
|
+
|
|
86
|
+
@employee.valid?.should be_false
|
|
87
|
+
ensure_error_added(@employee, :first_name, @error_messages[:invalid])
|
|
88
|
+
|
|
89
|
+
@employee.first_name = "Valid"
|
|
90
|
+
@employee.valid?.should be_true
|
|
91
|
+
end
|
|
92
|
+
|
|
93
|
+
it "should not add an error is :allow_nil => true for a validation" do
|
|
94
|
+
@employee.attributes = valid_employee_attributes.except(:middle_name)
|
|
95
|
+
@employee.valid?.should be_true
|
|
96
|
+
end
|
|
97
|
+
end
|
|
98
|
+
|
|
99
|
+
describe "#validates_inclusion_of" do
|
|
100
|
+
|
|
101
|
+
it "should add an error to the record if an attribute is not included in a list" do
|
|
102
|
+
@employee.attributes = valid_employee_attributes.except(:gender)
|
|
103
|
+
@employee.gender = "alien"
|
|
104
|
+
|
|
105
|
+
@employee.valid?.should be_false
|
|
106
|
+
ensure_error_added(@employee, :gender, @error_messages[:inclusion])
|
|
107
|
+
|
|
108
|
+
@employee.gender = "m"
|
|
109
|
+
@employee.valid?.should be_true
|
|
110
|
+
end
|
|
111
|
+
|
|
112
|
+
end
|
|
113
|
+
|
|
114
|
+
describe "#validates_exclusion_of" do
|
|
115
|
+
|
|
116
|
+
it "should add an error to the record if an attribute is included in a list" do
|
|
117
|
+
@employee.attributes = valid_employee_attributes.except(:first_name)
|
|
118
|
+
@employee.first_name = "admin"
|
|
119
|
+
|
|
120
|
+
@employee.valid?.should be_false
|
|
121
|
+
ensure_error_added(@employee, :first_name, @error_messages[:exclusion])
|
|
122
|
+
|
|
123
|
+
@employee.first_name = valid_employee_attributes[:first_name]
|
|
124
|
+
@employee.valid?.should be_true
|
|
125
|
+
end
|
|
126
|
+
|
|
127
|
+
it "should not add an error if :allow_nil => true for a validation" do
|
|
128
|
+
@employee.attributes = valid_employee_attributes.except(:middle_name)
|
|
129
|
+
@employee.valid?.should be_true
|
|
130
|
+
end
|
|
131
|
+
|
|
132
|
+
end
|
|
133
|
+
|
|
134
|
+
describe "#validates_acceptance_of" do
|
|
135
|
+
|
|
136
|
+
it "should add an error to the record if an acceptance agreed upon" do
|
|
137
|
+
@employee.attributes = valid_employee_attributes.except(:contract)
|
|
138
|
+
@employee.contract = "0"
|
|
139
|
+
|
|
140
|
+
@employee.valid?.should be_false
|
|
141
|
+
ensure_error_added(@employee, :contract, @error_messages[:accepted])
|
|
142
|
+
|
|
143
|
+
@employee.contract = "1"
|
|
144
|
+
@employee.valid?.should be_true
|
|
145
|
+
end
|
|
146
|
+
|
|
147
|
+
end
|
|
148
|
+
|
|
149
|
+
describe "#validates_confirmation_of" do
|
|
150
|
+
|
|
151
|
+
it "should not trigger a validation unless the virtual attribute #attr_confirmation is added" do
|
|
152
|
+
@employee.attributes = valid_employee_attributes
|
|
153
|
+
@employee.valid?.should be_true
|
|
154
|
+
|
|
155
|
+
@employee.password_confirmation = ""
|
|
156
|
+
@employee.valid?.should be_false
|
|
157
|
+
|
|
158
|
+
ensure_error_added(@employee, :password, @error_messages[:confirmation])
|
|
159
|
+
end
|
|
160
|
+
|
|
161
|
+
it "should add an error to the record if a confirmation was mismatched" do
|
|
162
|
+
@employee.attributes = valid_employee_attributes
|
|
163
|
+
@employee.password_confirmation = "mismatched"
|
|
164
|
+
|
|
165
|
+
@employee.valid?.should be_false
|
|
166
|
+
ensure_error_added(@employee, :password, @error_messages[:confirmation])
|
|
167
|
+
|
|
168
|
+
@employee.password_confirmation = valid_employee_attributes[:password]
|
|
169
|
+
@employee.valid?.should be_true
|
|
170
|
+
end
|
|
171
|
+
|
|
172
|
+
end
|
|
173
|
+
|
|
174
|
+
describe "#validates_numericality_of" do
|
|
175
|
+
|
|
176
|
+
it "should add an error to the record if an attribute listed within it is not a number" do
|
|
177
|
+
pending "This needs to be implemented"
|
|
178
|
+
end
|
|
179
|
+
|
|
180
|
+
end
|
|
181
|
+
|
|
182
|
+
end
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
namespace :bigrecord do
|
|
2
|
+
|
|
3
|
+
desc "Migrate the Bigrecord database through scripts in db/bigrecord_migrate. Target specific version with VERSION=x. Turn off output with VERBOSE=false."
|
|
4
|
+
task :migrate => :environment do
|
|
5
|
+
BigRecord::Migrator.migrate("db/bigrecord_migrate/", ENV["VERSION"] ? ENV["VERSION"].to_i : nil)
|
|
6
|
+
end
|
|
7
|
+
|
|
8
|
+
namespace :migrate do
|
|
9
|
+
desc 'Rollbacks the database one migration and re migrate up. If you want to rollback more than one step, define STEP=x. Target specific version with VERSION=x.'
|
|
10
|
+
task :redo => :environment do
|
|
11
|
+
if ENV["VERSION"]
|
|
12
|
+
Rake::Task["bigrecord:migrate:down"].invoke
|
|
13
|
+
Rake::Task["bigrecord:migrate:up"].invoke
|
|
14
|
+
else
|
|
15
|
+
Rake::Task["bigrecord:rollback"].invoke
|
|
16
|
+
Rake::Task["bigrecord:migrate"].invoke
|
|
17
|
+
end
|
|
18
|
+
end
|
|
19
|
+
|
|
20
|
+
desc 'Runs the "up" for a given migration VERSION.'
|
|
21
|
+
task :up => :environment do
|
|
22
|
+
version = ENV["VERSION"] ? ENV["VERSION"].to_i : nil
|
|
23
|
+
raise "VERSION is required" unless version
|
|
24
|
+
BigRecord::Migrator.run(:up, "db/bigrecord_migrate/", version)
|
|
25
|
+
end
|
|
26
|
+
|
|
27
|
+
desc 'Runs the "down" for a given migration VERSION.'
|
|
28
|
+
task :down => :environment do
|
|
29
|
+
version = ENV["VERSION"] ? ENV["VERSION"].to_i : nil
|
|
30
|
+
raise "VERSION is required" unless version
|
|
31
|
+
BigRecord::Migrator.run(:up, "db/bigrecord_migrate/", version)
|
|
32
|
+
end
|
|
33
|
+
end
|
|
34
|
+
|
|
35
|
+
desc 'Rolls the schema back to the previous version. Specify the number of steps with STEP=n'
|
|
36
|
+
task :rollback => :environment do
|
|
37
|
+
step = ENV['STEP'] ? ENV['STEP'].to_i : 1
|
|
38
|
+
BigRecord::Migrator.rollback('db/bigrecord_migrate/', step)
|
|
39
|
+
end
|
|
40
|
+
|
|
41
|
+
desc 'Pushes the schema to the next version. Specify the number of steps with STEP=n'
|
|
42
|
+
task :forward => :environment do
|
|
43
|
+
step = ENV['STEP'] ? ENV['STEP'].to_i : 1
|
|
44
|
+
BigRecord::Migrator.forward('db/bigrecord_migrate/', step)
|
|
45
|
+
end
|
|
46
|
+
|
|
47
|
+
end
|
data/tasks/data_store.rb
ADDED
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
namespace :data_store do
|
|
2
|
+
require 'lib/big_record'
|
|
3
|
+
BigRecord::Base.configurations = YAML::load(File.open(File.join(ROOT, "spec", "connections", "bigrecord.yml")))
|
|
4
|
+
BigRecord::Base.logger = Logger.new(File.expand_path(File.join(ROOT, "migrate.log")))
|
|
5
|
+
|
|
6
|
+
@migrations_path = File.expand_path(File.join(ROOT, "spec", "lib", "migrations"))
|
|
7
|
+
|
|
8
|
+
desc 'Migrate the test schema for the data store specified by ENV=<data_store>'
|
|
9
|
+
task :migrate do
|
|
10
|
+
environment = ENV['ENV']
|
|
11
|
+
raise ArgumentError, "Usage: rake data_store:migrate ENV=<#{DATA_STORES.join("|")}>" unless environment
|
|
12
|
+
|
|
13
|
+
BigRecord::Base.establish_connection environment
|
|
14
|
+
|
|
15
|
+
BigRecord::Migrator.migrate(@migrations_path, ENV["VERSION"] ? ENV["VERSION"].to_i : nil)
|
|
16
|
+
end
|
|
17
|
+
|
|
18
|
+
namespace :migrate do
|
|
19
|
+
desc 'Runs the "up" for a given migration VERSION.'
|
|
20
|
+
task :up do
|
|
21
|
+
environment = ENV['ENV']
|
|
22
|
+
raise ArgumentError, "Usage: rake data_store:migrate:up ENV=<#{DATA_STORES.join("|")}>" unless environment
|
|
23
|
+
|
|
24
|
+
BigRecord::Base.establish_connection environment
|
|
25
|
+
|
|
26
|
+
version = ENV["VERSION"] ? ENV["VERSION"].to_i : nil
|
|
27
|
+
raise "VERSION is required" unless version
|
|
28
|
+
|
|
29
|
+
BigRecord::Migrator.run(:up, @migrations_path, version)
|
|
30
|
+
end
|
|
31
|
+
|
|
32
|
+
desc 'Runs the "down" for a given migration VERSION.'
|
|
33
|
+
task :down do
|
|
34
|
+
environment = ENV['ENV']
|
|
35
|
+
raise ArgumentError, "Usage: rake data_store:migrate:down ENV=<#{DATA_STORES.join("|")}>" unless environment
|
|
36
|
+
|
|
37
|
+
BigRecord::Base.establish_connection environment
|
|
38
|
+
|
|
39
|
+
version = ENV["VERSION"] ? ENV["VERSION"].to_i : nil
|
|
40
|
+
raise "VERSION is required" unless version
|
|
41
|
+
|
|
42
|
+
BigRecord::Migrator.run(:down, @migrations_path, version)
|
|
43
|
+
end
|
|
44
|
+
end
|
|
45
|
+
|
|
46
|
+
end
|
data/tasks/gem.rb
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
begin
|
|
2
|
+
require 'jeweler'
|
|
3
|
+
|
|
4
|
+
Jeweler::Tasks.new do |gemspec|
|
|
5
|
+
gemspec.name = "bigrecord"
|
|
6
|
+
gemspec.authors = ["openplaces.org"]
|
|
7
|
+
gemspec.email = "bigrecord@openplaces.org"
|
|
8
|
+
gemspec.homepage = "http://www.bigrecord.org"
|
|
9
|
+
gemspec.summary = "Object mapper for supporting column-oriented data stores (supports #{DATA_STORES.join(" ")}) in Ruby on Rails."
|
|
10
|
+
gemspec.description = "BigRecord is built from ActiveRecord, and intended to seamlessly integrate into your Ruby on Rails applications."
|
|
11
|
+
gemspec.files = FileList["{doc,examples,generators,lib,rails,spec,tasks}/**/*","init.rb","install.rb","Rakefile","VERSION"].to_a
|
|
12
|
+
gemspec.extra_rdoc_files = FileList["doc/**/*","MIT-LICENSE","README.rdoc"].to_a
|
|
13
|
+
|
|
14
|
+
gemspec.add_development_dependency "rspec"
|
|
15
|
+
gemspec.add_dependency "uuidtools", ">= 2.0.0"
|
|
16
|
+
gemspec.add_dependency "bigrecord-driver"
|
|
17
|
+
end
|
|
18
|
+
Jeweler::GemcutterTasks.new
|
|
19
|
+
rescue LoadError
|
|
20
|
+
puts "Jeweler not available. Install it with: sudo gem install technicalpickles-jeweler -s http://gems.github.com"
|
|
21
|
+
end
|
|
22
|
+
|
data/tasks/rdoc.rb
ADDED
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
desc 'Generate documentation for BigRecord.'
|
|
2
|
+
Rake::RDocTask.new(:rdoc) do |rdoc|
|
|
3
|
+
rdoc.rdoc_dir = 'rdoc'
|
|
4
|
+
rdoc.title = 'BigRecord'
|
|
5
|
+
rdoc.options << '--line-numbers' << '--inline-source'
|
|
6
|
+
rdoc.rdoc_files.include('../README.rdoc')
|
|
7
|
+
rdoc.rdoc_files.include('lib/**/*.rb')
|
|
8
|
+
end
|
data/tasks/spec.rb
ADDED
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
desc "Run #{DATA_STORES.join(" and ")} specs"
|
|
2
|
+
task :spec => DATA_STORES.map{|store| "spec:#{store}" }
|
|
3
|
+
|
|
4
|
+
namespace :spec do
|
|
5
|
+
unit_specs = ROOT + 'spec/unit/**/*_spec.rb'
|
|
6
|
+
integration_specs = ROOT + 'spec/integration/**/*_spec.rb'
|
|
7
|
+
all_specs = ROOT + 'spec/**/*_spec.rb'
|
|
8
|
+
|
|
9
|
+
def run_spec(name, adapter, files, rcov)
|
|
10
|
+
Spec::Rake::SpecTask.new(name) do |t|
|
|
11
|
+
t.spec_opts << File.open("spec/spec.opts").readlines.map{|x| x.chomp}
|
|
12
|
+
t.spec_files = Pathname.glob(files.to_s).map { |f| f.to_s }
|
|
13
|
+
connection_path = "spec/connections/#{adapter}"
|
|
14
|
+
t.libs << "spec" << connection_path
|
|
15
|
+
end
|
|
16
|
+
end
|
|
17
|
+
|
|
18
|
+
DATA_STORES.each do |adapter|
|
|
19
|
+
task adapter.to_sym => "spec:#{adapter}:all"
|
|
20
|
+
|
|
21
|
+
namespace adapter.to_sym do
|
|
22
|
+
|
|
23
|
+
desc "Run all specifications"
|
|
24
|
+
run_spec('all', adapter, all_specs, false)
|
|
25
|
+
|
|
26
|
+
desc "Run unit specifications"
|
|
27
|
+
run_spec('unit', adapter, unit_specs, false)
|
|
28
|
+
|
|
29
|
+
desc "Run integration specifications"
|
|
30
|
+
run_spec('integration', adapter, integration_specs, false)
|
|
31
|
+
|
|
32
|
+
end
|
|
33
|
+
end
|
|
34
|
+
end
|
metadata
ADDED
|
@@ -0,0 +1,189 @@
|
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
|
2
|
+
name: bigrecord
|
|
3
|
+
version: !ruby/object:Gem::Version
|
|
4
|
+
version: 0.0.5
|
|
5
|
+
platform: ruby
|
|
6
|
+
authors:
|
|
7
|
+
- openplaces.org
|
|
8
|
+
autorequire:
|
|
9
|
+
bindir: bin
|
|
10
|
+
cert_chain: []
|
|
11
|
+
|
|
12
|
+
date: 2009-10-12 00:00:00 -04:00
|
|
13
|
+
default_executable:
|
|
14
|
+
dependencies:
|
|
15
|
+
- !ruby/object:Gem::Dependency
|
|
16
|
+
name: rspec
|
|
17
|
+
type: :development
|
|
18
|
+
version_requirement:
|
|
19
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
20
|
+
requirements:
|
|
21
|
+
- - ">="
|
|
22
|
+
- !ruby/object:Gem::Version
|
|
23
|
+
version: "0"
|
|
24
|
+
version:
|
|
25
|
+
- !ruby/object:Gem::Dependency
|
|
26
|
+
name: uuidtools
|
|
27
|
+
type: :runtime
|
|
28
|
+
version_requirement:
|
|
29
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
30
|
+
requirements:
|
|
31
|
+
- - ">="
|
|
32
|
+
- !ruby/object:Gem::Version
|
|
33
|
+
version: 2.0.0
|
|
34
|
+
version:
|
|
35
|
+
- !ruby/object:Gem::Dependency
|
|
36
|
+
name: bigrecord-driver
|
|
37
|
+
type: :runtime
|
|
38
|
+
version_requirement:
|
|
39
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
40
|
+
requirements:
|
|
41
|
+
- - ">="
|
|
42
|
+
- !ruby/object:Gem::Version
|
|
43
|
+
version: "0"
|
|
44
|
+
version:
|
|
45
|
+
description: BigRecord is built from ActiveRecord, and intended to seamlessly integrate into your Ruby on Rails applications.
|
|
46
|
+
email: bigrecord@openplaces.org
|
|
47
|
+
executables: []
|
|
48
|
+
|
|
49
|
+
extensions: []
|
|
50
|
+
|
|
51
|
+
extra_rdoc_files:
|
|
52
|
+
- MIT-LICENSE
|
|
53
|
+
- README.rdoc
|
|
54
|
+
- doc/bigrecord_specs.rdoc
|
|
55
|
+
- doc/getting_started.rdoc
|
|
56
|
+
files:
|
|
57
|
+
- Rakefile
|
|
58
|
+
- VERSION
|
|
59
|
+
- doc/bigrecord_specs.rdoc
|
|
60
|
+
- doc/getting_started.rdoc
|
|
61
|
+
- examples/bigrecord.yml
|
|
62
|
+
- generators/bigrecord/bigrecord_generator.rb
|
|
63
|
+
- generators/bigrecord/templates/bigrecord.rake
|
|
64
|
+
- generators/bigrecord_migration/bigrecord_migration_generator.rb
|
|
65
|
+
- generators/bigrecord_migration/templates/migration.rb
|
|
66
|
+
- generators/bigrecord_model/bigrecord_model_generator.rb
|
|
67
|
+
- generators/bigrecord_model/templates/migration.rb
|
|
68
|
+
- generators/bigrecord_model/templates/model.rb
|
|
69
|
+
- generators/bigrecord_model/templates/model_spec.rb
|
|
70
|
+
- init.rb
|
|
71
|
+
- install.rb
|
|
72
|
+
- lib/big_record.rb
|
|
73
|
+
- lib/big_record/abstract_base.rb
|
|
74
|
+
- lib/big_record/action_view_extensions.rb
|
|
75
|
+
- lib/big_record/ar_associations.rb
|
|
76
|
+
- lib/big_record/ar_associations/association_collection.rb
|
|
77
|
+
- lib/big_record/ar_associations/association_proxy.rb
|
|
78
|
+
- lib/big_record/ar_associations/belongs_to_association.rb
|
|
79
|
+
- lib/big_record/ar_associations/belongs_to_many_association.rb
|
|
80
|
+
- lib/big_record/ar_associations/has_and_belongs_to_many_association.rb
|
|
81
|
+
- lib/big_record/ar_associations/has_many_association.rb
|
|
82
|
+
- lib/big_record/ar_associations/has_one_association.rb
|
|
83
|
+
- lib/big_record/ar_reflection.rb
|
|
84
|
+
- lib/big_record/attribute_methods.rb
|
|
85
|
+
- lib/big_record/base.rb
|
|
86
|
+
- lib/big_record/br_associations.rb
|
|
87
|
+
- lib/big_record/br_associations/association_collection.rb
|
|
88
|
+
- lib/big_record/br_associations/association_proxy.rb
|
|
89
|
+
- lib/big_record/br_associations/belongs_to_association.rb
|
|
90
|
+
- lib/big_record/br_associations/belongs_to_many_association.rb
|
|
91
|
+
- lib/big_record/br_associations/cached_item_proxy.rb
|
|
92
|
+
- lib/big_record/br_associations/cached_item_proxy_factory.rb
|
|
93
|
+
- lib/big_record/br_associations/has_and_belongs_to_many_association.rb
|
|
94
|
+
- lib/big_record/br_associations/has_one_association.rb
|
|
95
|
+
- lib/big_record/br_reflection.rb
|
|
96
|
+
- lib/big_record/callbacks.rb
|
|
97
|
+
- lib/big_record/connection_adapters.rb
|
|
98
|
+
- lib/big_record/connection_adapters/abstract/connection_specification.rb
|
|
99
|
+
- lib/big_record/connection_adapters/abstract/database_statements.rb
|
|
100
|
+
- lib/big_record/connection_adapters/abstract/quoting.rb
|
|
101
|
+
- lib/big_record/connection_adapters/abstract_adapter.rb
|
|
102
|
+
- lib/big_record/connection_adapters/column.rb
|
|
103
|
+
- lib/big_record/connection_adapters/hbase_adapter.rb
|
|
104
|
+
- lib/big_record/connection_adapters/view.rb
|
|
105
|
+
- lib/big_record/deletion.rb
|
|
106
|
+
- lib/big_record/dynamic_schema.rb
|
|
107
|
+
- lib/big_record/embedded.rb
|
|
108
|
+
- lib/big_record/embedded_associations/association_proxy.rb
|
|
109
|
+
- lib/big_record/family_span_columns.rb
|
|
110
|
+
- lib/big_record/fixtures.rb
|
|
111
|
+
- lib/big_record/migration.rb
|
|
112
|
+
- lib/big_record/routing_ext.rb
|
|
113
|
+
- lib/big_record/timestamp.rb
|
|
114
|
+
- lib/big_record/validations.rb
|
|
115
|
+
- lib/bigrecord.rb
|
|
116
|
+
- rails/init.rb
|
|
117
|
+
- spec/connections/bigrecord.yml
|
|
118
|
+
- spec/connections/cassandra/connection.rb
|
|
119
|
+
- spec/connections/hbase/connection.rb
|
|
120
|
+
- spec/debug.log
|
|
121
|
+
- spec/integration/br_associations_spec.rb
|
|
122
|
+
- spec/lib/animal.rb
|
|
123
|
+
- spec/lib/book.rb
|
|
124
|
+
- spec/lib/broken_migrations/duplicate_name/20090706182535_add_animals_table.rb
|
|
125
|
+
- spec/lib/broken_migrations/duplicate_name/20090706193019_add_animals_table.rb
|
|
126
|
+
- spec/lib/broken_migrations/duplicate_version/20090706190623_add_books_table.rb
|
|
127
|
+
- spec/lib/broken_migrations/duplicate_version/20090706190623_add_companies_table.rb
|
|
128
|
+
- spec/lib/company.rb
|
|
129
|
+
- spec/lib/embedded/web_link.rb
|
|
130
|
+
- spec/lib/employee.rb
|
|
131
|
+
- spec/lib/migrations/20090706182535_add_animals_table.rb
|
|
132
|
+
- spec/lib/migrations/20090706190623_add_books_table.rb
|
|
133
|
+
- spec/lib/migrations/20090706193019_add_companies_table.rb
|
|
134
|
+
- spec/lib/migrations/20090706194512_add_employees_table.rb
|
|
135
|
+
- spec/lib/migrations/20090706195741_add_zoos_table.rb
|
|
136
|
+
- spec/lib/novel.rb
|
|
137
|
+
- spec/lib/zoo.rb
|
|
138
|
+
- spec/spec.opts
|
|
139
|
+
- spec/spec_helper.rb
|
|
140
|
+
- spec/unit/abstract_base_spec.rb
|
|
141
|
+
- spec/unit/adapters/abstract_adapter_spec.rb
|
|
142
|
+
- spec/unit/adapters/adapter_shared_spec.rb
|
|
143
|
+
- spec/unit/adapters/hbase_adapter_spec.rb
|
|
144
|
+
- spec/unit/ar_associations_spec.rb
|
|
145
|
+
- spec/unit/base_spec.rb
|
|
146
|
+
- spec/unit/br_associations_spec.rb
|
|
147
|
+
- spec/unit/embedded_spec.rb
|
|
148
|
+
- spec/unit/find_spec.rb
|
|
149
|
+
- spec/unit/hash_helper_spec.rb
|
|
150
|
+
- spec/unit/migration_spec.rb
|
|
151
|
+
- spec/unit/model_spec.rb
|
|
152
|
+
- spec/unit/validations_spec.rb
|
|
153
|
+
- tasks/bigrecord_tasks.rake
|
|
154
|
+
- tasks/data_store.rb
|
|
155
|
+
- tasks/gem.rb
|
|
156
|
+
- tasks/rdoc.rb
|
|
157
|
+
- tasks/spec.rb
|
|
158
|
+
- MIT-LICENSE
|
|
159
|
+
- README.rdoc
|
|
160
|
+
has_rdoc: true
|
|
161
|
+
homepage: http://www.bigrecord.org
|
|
162
|
+
licenses: []
|
|
163
|
+
|
|
164
|
+
post_install_message:
|
|
165
|
+
rdoc_options:
|
|
166
|
+
- --charset=UTF-8
|
|
167
|
+
require_paths:
|
|
168
|
+
- lib
|
|
169
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
|
170
|
+
requirements:
|
|
171
|
+
- - ">="
|
|
172
|
+
- !ruby/object:Gem::Version
|
|
173
|
+
version: "0"
|
|
174
|
+
version:
|
|
175
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
|
176
|
+
requirements:
|
|
177
|
+
- - ">="
|
|
178
|
+
- !ruby/object:Gem::Version
|
|
179
|
+
version: "0"
|
|
180
|
+
version:
|
|
181
|
+
requirements: []
|
|
182
|
+
|
|
183
|
+
rubyforge_project:
|
|
184
|
+
rubygems_version: 1.3.5
|
|
185
|
+
signing_key:
|
|
186
|
+
specification_version: 3
|
|
187
|
+
summary: Object mapper for supporting column-oriented data stores (supports hbase cassandra) in Ruby on Rails.
|
|
188
|
+
test_files: []
|
|
189
|
+
|