reorm 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.gitignore +14 -0
- data/.rspec +2 -0
- data/Gemfile +4 -0
- data/LICENSE.txt +22 -0
- data/README.md +219 -0
- data/Rakefile +2 -0
- data/config/database.yml +11 -0
- data/lib/reorm/configuration.rb +12 -0
- data/lib/reorm/cursor.rb +162 -0
- data/lib/reorm/exceptions.rb +13 -0
- data/lib/reorm/field_path.rb +53 -0
- data/lib/reorm/model.rb +132 -0
- data/lib/reorm/modules/database_modules.rb +67 -0
- data/lib/reorm/modules/event_modules.rb +82 -0
- data/lib/reorm/modules/validation_modules.rb +29 -0
- data/lib/reorm/modules.rb +7 -0
- data/lib/reorm/property_errors.rb +53 -0
- data/lib/reorm/validators/exclusion_validator.rb +18 -0
- data/lib/reorm/validators/inclusion_validator.rb +18 -0
- data/lib/reorm/validators/maximum_length_validator.rb +19 -0
- data/lib/reorm/validators/minimum_length_validator.rb +19 -0
- data/lib/reorm/validators/presence_validator.rb +17 -0
- data/lib/reorm/validators/validator.rb +13 -0
- data/lib/reorm/validators.rb +10 -0
- data/lib/reorm/version.rb +6 -0
- data/lib/reorm.rb +47 -0
- data/reorm.gemspec +30 -0
- data/spec/catwalk/modules/timestamped_spec.rb +17 -0
- data/spec/reorm/cursor_spec.rb +214 -0
- data/spec/reorm/field_path_spec.rb +65 -0
- data/spec/reorm/model_spec.rb +268 -0
- data/spec/reorm/modules/event_source_spec.rb +49 -0
- data/spec/reorm/modules/table_backed_spec.rb +46 -0
- data/spec/reorm/modules/timestamped_spec.rb +28 -0
- data/spec/reorm/modules/validation_modules_spec.rb +157 -0
- data/spec/reorm/property_errors_spec.rb +120 -0
- data/spec/reorm/validators/exclusion_validator_spec.rb +34 -0
- data/spec/reorm/validators/inclusion_validator_spec.rb +36 -0
- data/spec/reorm/validators/maximum_length_validator_spec.rb +37 -0
- data/spec/reorm/validators/minimum_length_validator_spec.rb +39 -0
- data/spec/reorm/validators/presence_validator_spec.rb +44 -0
- data/spec/reorm/validators/validator_spec.rb +23 -0
- data/spec/spec_helper.rb +118 -0
- metadata +216 -0
@@ -0,0 +1,120 @@
|
|
1
|
+
require "spec_helper"
|
2
|
+
|
3
|
+
describe Reorm::PropertyErrors do
|
4
|
+
subject {
|
5
|
+
Reorm::PropertyErrors.new
|
6
|
+
}
|
7
|
+
|
8
|
+
describe "#clear?()" do
|
9
|
+
it "returns true for an empty instance" do
|
10
|
+
expect(subject.clear?).to eq(true)
|
11
|
+
end
|
12
|
+
|
13
|
+
it "returns false for a non-empty instance" do
|
14
|
+
subject.add(:blah, "Some message.")
|
15
|
+
expect(subject.clear?).to eq(false)
|
16
|
+
end
|
17
|
+
end
|
18
|
+
|
19
|
+
describe "#reset()" do
|
20
|
+
before do
|
21
|
+
subject.add(:field1, "Message 1.")
|
22
|
+
subject.add(:field2, "Message 2.")
|
23
|
+
subject.add(:field3, "Message 3.")
|
24
|
+
end
|
25
|
+
|
26
|
+
it "removes any existing errors" do
|
27
|
+
subject.reset
|
28
|
+
expect(subject.clear?).to eq(true)
|
29
|
+
end
|
30
|
+
end
|
31
|
+
|
32
|
+
describe "#include?()" do
|
33
|
+
before do
|
34
|
+
subject.add(:field1, "An error message.")
|
35
|
+
end
|
36
|
+
|
37
|
+
it "returns false if there are no errors for the specified property" do
|
38
|
+
expect(subject.include?(:blah)).to eq(false)
|
39
|
+
end
|
40
|
+
|
41
|
+
it "returns true if there are errors for the specified property" do
|
42
|
+
expect(subject.include?(:field1)).to eq(true)
|
43
|
+
end
|
44
|
+
end
|
45
|
+
|
46
|
+
describe "#add()" do
|
47
|
+
it "adds an error message for a given property" do
|
48
|
+
subject.add(:field1, "The error message for field 1.")
|
49
|
+
expect(subject.include?(:field1)).to eq(true)
|
50
|
+
expect(subject.messages(:field1)).to eq(["The error message for field 1."])
|
51
|
+
end
|
52
|
+
|
53
|
+
it "does not add an error if the message is blank" do
|
54
|
+
subject.add(:field1, nil)
|
55
|
+
expect(subject.clear?).to eq(true)
|
56
|
+
subject.add(:field1, "")
|
57
|
+
expect(subject.clear?).to eq(true)
|
58
|
+
end
|
59
|
+
end
|
60
|
+
|
61
|
+
describe "#prperties()" do
|
62
|
+
it "returns an empty array if called when there are no errors" do
|
63
|
+
expect(subject.properties).to eq([])
|
64
|
+
end
|
65
|
+
|
66
|
+
it "returns an array with properties and no duplicates if there are errors" do
|
67
|
+
subject.add(:field1, "First error.")
|
68
|
+
subject.add(:field2, "Second error.")
|
69
|
+
subject.add(:field1, "Third error.")
|
70
|
+
expect(subject.properties).to eq([:field1, :field2])
|
71
|
+
end
|
72
|
+
end
|
73
|
+
|
74
|
+
describe "#messages()" do
|
75
|
+
it "returns an empty array where there are no messages for the specified property" do
|
76
|
+
expect(subject.messages(:blah)).to eq([])
|
77
|
+
end
|
78
|
+
|
79
|
+
it "returns an array of messages where there are message for the specified property" do
|
80
|
+
subject.add(:field1, "First error.")
|
81
|
+
subject.add(:field2, "Second error.")
|
82
|
+
subject.add(:field1, "Third error.")
|
83
|
+
expect(subject.messages(:field1)).to eq(["First error.", "Third error."])
|
84
|
+
end
|
85
|
+
end
|
86
|
+
|
87
|
+
describe "#each()" do
|
88
|
+
it "yields a property name and message array to the specified block" do
|
89
|
+
subject.add(:first, "A message.")
|
90
|
+
subject.each do |property, messages|
|
91
|
+
expect(property).to eq(:first)
|
92
|
+
expect(messages).to eq(["A message."])
|
93
|
+
end
|
94
|
+
end
|
95
|
+
|
96
|
+
it "yields once for each property with errors" do
|
97
|
+
subject.add(:field1, "An error.")
|
98
|
+
subject.add(:field1, "An error.")
|
99
|
+
subject.add(:field2, "An error.")
|
100
|
+
total = 0
|
101
|
+
subject.each {|property, messages| total += 1}
|
102
|
+
expect(total).to eq(2)
|
103
|
+
end
|
104
|
+
end
|
105
|
+
|
106
|
+
describe "#to_s" do
|
107
|
+
it "returns an empty string when there are no errors" do
|
108
|
+
expect(subject.to_s).to eq("")
|
109
|
+
end
|
110
|
+
|
111
|
+
it "returns a string containing one error per line when there are errors" do
|
112
|
+
subject.add(:field1, "has an error.")
|
113
|
+
subject.add(:field1, "has another error.")
|
114
|
+
subject.add(:field2, "also has an error.")
|
115
|
+
expect(subject.to_s).to eq("field1 has an error.\n"\
|
116
|
+
"field1 has another error.\n"\
|
117
|
+
"field2 also has an error.")
|
118
|
+
end
|
119
|
+
end
|
120
|
+
end
|
@@ -0,0 +1,34 @@
|
|
1
|
+
require "spec_helper"
|
2
|
+
|
3
|
+
describe Reorm::ExclusionValidator do
|
4
|
+
subject {
|
5
|
+
Reorm::ExclusionValidator.new([1, 3, 5], :one, :two, :three)
|
6
|
+
}
|
7
|
+
let(:object) {
|
8
|
+
obj = OpenStruct.new(errors: Reorm::PropertyErrors.new)
|
9
|
+
obj.define_singleton_method(:include?) {|key| obj.to_h.include?(key)}
|
10
|
+
obj
|
11
|
+
}
|
12
|
+
let(:path) {
|
13
|
+
"one -> two -> three".to_sym
|
14
|
+
}
|
15
|
+
|
16
|
+
it "sets no errors if the object passed to it possesses doesn't have a field value matching one of the excluded values" do
|
17
|
+
object.one = {two: {three: 2}}
|
18
|
+
subject.validate(object)
|
19
|
+
expect(object.errors.clear?).to eq(true)
|
20
|
+
end
|
21
|
+
|
22
|
+
it "sets no errors if the object passed in does not possess the field value" do
|
23
|
+
subject.validate(object)
|
24
|
+
expect(object.errors.clear?).to eq(true)
|
25
|
+
end
|
26
|
+
|
27
|
+
it "sets an error if the object passed in has a field value that does match one of the excluded values" do
|
28
|
+
object.one = {two: {three: 5}}
|
29
|
+
subject.validate(object)
|
30
|
+
expect(object.errors.clear?).to eq(false)
|
31
|
+
expect(object.errors.properties).to include(path)
|
32
|
+
expect(object.errors.messages(path)).to include("is set to an unpermitted value.")
|
33
|
+
end
|
34
|
+
end
|
@@ -0,0 +1,36 @@
|
|
1
|
+
require "spec_helper"
|
2
|
+
|
3
|
+
describe Reorm::InclusionValidator do
|
4
|
+
subject {
|
5
|
+
Reorm::InclusionValidator.new([1, 3, 5], :one, :two, :three)
|
6
|
+
}
|
7
|
+
let(:object) {
|
8
|
+
obj = OpenStruct.new(errors: Reorm::PropertyErrors.new)
|
9
|
+
obj.define_singleton_method(:include?) {|key| obj.to_h.include?(key)}
|
10
|
+
obj
|
11
|
+
}
|
12
|
+
let(:path) {
|
13
|
+
"one -> two -> three".to_sym
|
14
|
+
}
|
15
|
+
|
16
|
+
it "sets no errors if the object passed to it does have a field value matching one of the included values" do
|
17
|
+
object.one = {two: {three: 3}}
|
18
|
+
subject.validate(object)
|
19
|
+
expect(object.errors.clear?).to eq(true)
|
20
|
+
end
|
21
|
+
|
22
|
+
it "sets an error if the object passed in does not possess the field value" do
|
23
|
+
subject.validate(object)
|
24
|
+
expect(object.errors.clear?).to eq(false)
|
25
|
+
expect(object.errors.properties).to include(path)
|
26
|
+
expect(object.errors.messages(path)).to include("is not set to one of its permitted values.")
|
27
|
+
end
|
28
|
+
|
29
|
+
it "sets an error if the object passed in does not have a field value that matches one of the included values" do
|
30
|
+
object.one = {two: {three: 2}}
|
31
|
+
subject.validate(object)
|
32
|
+
expect(object.errors.clear?).to eq(false)
|
33
|
+
expect(object.errors.properties).to include(path)
|
34
|
+
expect(object.errors.messages(path)).to include("is not set to one of its permitted values.")
|
35
|
+
end
|
36
|
+
end
|
@@ -0,0 +1,37 @@
|
|
1
|
+
require "spec_helper"
|
2
|
+
|
3
|
+
describe Reorm::MaximumLengthValidator do
|
4
|
+
subject {
|
5
|
+
Reorm::MaximumLengthValidator.new(5, :one, :two, :three)
|
6
|
+
}
|
7
|
+
let(:object) {
|
8
|
+
obj = OpenStruct.new(errors: Reorm::PropertyErrors.new)
|
9
|
+
obj.define_singleton_method(:include?) {|key| obj.to_h.include?(key)}
|
10
|
+
obj
|
11
|
+
}
|
12
|
+
let(:path) {
|
13
|
+
"one -> two -> three".to_sym
|
14
|
+
}
|
15
|
+
|
16
|
+
it "does not set an error if the objects field value is short than or equal to the permitted length" do
|
17
|
+
object.one = {two: {three: "123"}}
|
18
|
+
subject.validate(object)
|
19
|
+
expect(object.errors.clear?).to eq(true)
|
20
|
+
object.one = {two: {three: "12345"}}
|
21
|
+
subject.validate(object)
|
22
|
+
expect(object.errors.clear?).to eq(true)
|
23
|
+
end
|
24
|
+
|
25
|
+
it "does not set an error if the object does not possess a value for the field" do
|
26
|
+
subject.validate(object)
|
27
|
+
expect(object.errors.clear?).to eq(true)
|
28
|
+
end
|
29
|
+
|
30
|
+
it "sets an error if the objects field value is longer than that permitted length" do
|
31
|
+
object.one = {two: {three: "123456"}}
|
32
|
+
subject.validate(object)
|
33
|
+
expect(object.errors.clear?).to eq(false)
|
34
|
+
expect(object.errors.properties).to include(path)
|
35
|
+
expect(object.errors.messages(path)).to include("is too long (maximum length is 5 characters).")
|
36
|
+
end
|
37
|
+
end
|
@@ -0,0 +1,39 @@
|
|
1
|
+
require "spec_helper"
|
2
|
+
|
3
|
+
describe Reorm::MinimumLengthValidator do
|
4
|
+
subject {
|
5
|
+
Reorm::MinimumLengthValidator.new(5, :one, :two, :three)
|
6
|
+
}
|
7
|
+
let(:object) {
|
8
|
+
obj = OpenStruct.new(errors: Reorm::PropertyErrors.new)
|
9
|
+
obj.define_singleton_method(:include?) {|key| obj.to_h.include?(key)}
|
10
|
+
obj
|
11
|
+
}
|
12
|
+
let(:path) {
|
13
|
+
"one -> two -> three".to_sym
|
14
|
+
}
|
15
|
+
|
16
|
+
it "does not set an error if the objects field value is greater than or equal to the permitted length" do
|
17
|
+
object.one = {two: {three: "1234567"}}
|
18
|
+
subject.validate(object)
|
19
|
+
expect(object.errors.clear?).to eq(true)
|
20
|
+
object.one = {two: {three: "12345"}}
|
21
|
+
subject.validate(object)
|
22
|
+
expect(object.errors.clear?).to eq(true)
|
23
|
+
end
|
24
|
+
|
25
|
+
it "does not set an error if the object does not possess a value for the field" do
|
26
|
+
subject.validate(object)
|
27
|
+
expect(object.errors.clear?).to eq(false)
|
28
|
+
expect(object.errors.properties).to include(path)
|
29
|
+
expect(object.errors.messages(path)).to include("is too short (minimum length is 5 characters).")
|
30
|
+
end
|
31
|
+
|
32
|
+
it "sets an error if the objects field value is longer than that permitted length" do
|
33
|
+
object.one = {two: {three: "123"}}
|
34
|
+
subject.validate(object)
|
35
|
+
expect(object.errors.clear?).to eq(false)
|
36
|
+
expect(object.errors.properties).to include(path)
|
37
|
+
expect(object.errors.messages(path)).to include("is too short (minimum length is 5 characters).")
|
38
|
+
end
|
39
|
+
end
|
@@ -0,0 +1,44 @@
|
|
1
|
+
require "spec_helper"
|
2
|
+
|
3
|
+
describe Reorm::PresenceValidator do
|
4
|
+
subject {
|
5
|
+
Reorm::PresenceValidator.new(:one, :two, :three)
|
6
|
+
}
|
7
|
+
let(:object) {
|
8
|
+
obj = OpenStruct.new(errors: Reorm::PropertyErrors.new)
|
9
|
+
obj.define_singleton_method(:include?) {|key| obj.to_h.include?(key)}
|
10
|
+
obj
|
11
|
+
}
|
12
|
+
let(:path) {
|
13
|
+
"one -> two -> three".to_sym
|
14
|
+
}
|
15
|
+
|
16
|
+
it "sets no errors if the object passed to it possesses the required field value" do
|
17
|
+
object.one = {two: {three: 3}}
|
18
|
+
subject.validate(object)
|
19
|
+
expect(object.errors.clear?).to eq(true)
|
20
|
+
end
|
21
|
+
|
22
|
+
it "sets an error if the object passed in does not possess the required field" do
|
23
|
+
subject.validate(object)
|
24
|
+
expect(object.errors.clear?).to eq(false)
|
25
|
+
expect(object.errors.properties).to include(path)
|
26
|
+
expect(object.errors.messages(path)).to include("cannot be blank.")
|
27
|
+
end
|
28
|
+
|
29
|
+
it "sets an error if the object passed has a blank string field value" do
|
30
|
+
object.one = {two: {three: ""}}
|
31
|
+
subject.validate(object)
|
32
|
+
expect(object.errors.clear?).to eq(false)
|
33
|
+
expect(object.errors.properties).to include(path)
|
34
|
+
expect(object.errors.messages(path)).to include("cannot be blank.")
|
35
|
+
end
|
36
|
+
|
37
|
+
it "sets an error if the object passed has a blank string field value" do
|
38
|
+
object.one = {two: {three: nil}}
|
39
|
+
subject.validate(object)
|
40
|
+
expect(object.errors.clear?).to eq(false)
|
41
|
+
expect(object.errors.properties).to include(path)
|
42
|
+
expect(object.errors.messages(path)).to include("cannot be blank.")
|
43
|
+
end
|
44
|
+
end
|
@@ -0,0 +1,23 @@
|
|
1
|
+
require "spec_helper"
|
2
|
+
|
3
|
+
describe Reorm::Validator do
|
4
|
+
subject {
|
5
|
+
Reorm::Validator.new("This is the message text.", :one, :two, :three)
|
6
|
+
}
|
7
|
+
|
8
|
+
describe "#field()" do
|
9
|
+
it "returns a FieldPath object" do
|
10
|
+
expect(subject.field.class).to eq(Reorm::FieldPath)
|
11
|
+
end
|
12
|
+
|
13
|
+
it "refers to the field specified when the object was created" do
|
14
|
+
expect(subject.field.to_s).to eq("one -> two -> three")
|
15
|
+
end
|
16
|
+
end
|
17
|
+
|
18
|
+
describe "#message()" do
|
19
|
+
it "returns the message set for the validator" do
|
20
|
+
expect(subject.message).to eq("This is the message text.")
|
21
|
+
end
|
22
|
+
end
|
23
|
+
end
|
data/spec/spec_helper.rb
ADDED
@@ -0,0 +1,118 @@
|
|
1
|
+
# This file was generated by the `rspec --init` command. Conventionally, all
|
2
|
+
# specs live under a `spec` directory, which RSpec adds to the `$LOAD_PATH`.
|
3
|
+
# The generated `.rspec` file contains `--require spec_helper` which will cause
|
4
|
+
# this file to always be loaded, without a need to explicitly require it in any
|
5
|
+
# files.
|
6
|
+
#
|
7
|
+
# Given that it is always loaded, you are encouraged to keep this file as
|
8
|
+
# light-weight as possible. Requiring heavyweight dependencies from this file
|
9
|
+
# will add to the boot time of your test suite on EVERY test run, even for an
|
10
|
+
# individual file that may not need all of that loaded. Instead, consider making
|
11
|
+
# a separate helper file that requires the additional dependencies and performs
|
12
|
+
# the additional setup, and require it from the spec files that actually need
|
13
|
+
# it.
|
14
|
+
#
|
15
|
+
# The `.rspec` file also contains a few flags that are not defaults but that
|
16
|
+
# users commonly want.
|
17
|
+
#
|
18
|
+
# See http://rubydoc.info/gems/rspec-core/RSpec/Core/Configuration
|
19
|
+
|
20
|
+
# Necessary to pick up the correct environment.
|
21
|
+
ENV["RACK_ENV"] = "test"
|
22
|
+
|
23
|
+
require "reorm"
|
24
|
+
|
25
|
+
def reset_database
|
26
|
+
Reorm.connection do |connection|
|
27
|
+
databases = r.db_list.run(connection)
|
28
|
+
r.db_drop('reorm_test').run(connection) if databases.include?('reorm_test')
|
29
|
+
r.db_create('reorm_test').run(connection)
|
30
|
+
end
|
31
|
+
end
|
32
|
+
|
33
|
+
RSpec.configure do |config|
|
34
|
+
# rspec-expectations config goes here. You can use an alternate
|
35
|
+
# assertion/expectation library such as wrong or the stdlib/minitest
|
36
|
+
# assertions if you prefer.
|
37
|
+
config.expect_with :rspec do |expectations|
|
38
|
+
# This option will default to `true` in RSpec 4. It makes the `description`
|
39
|
+
# and `failure_message` of custom matchers include text for helper methods
|
40
|
+
# defined using `chain`, e.g.:
|
41
|
+
# be_bigger_than(2).and_smaller_than(4).description
|
42
|
+
# # => "be bigger than 2 and smaller than 4"
|
43
|
+
# ...rather than:
|
44
|
+
# # => "be bigger than 2"
|
45
|
+
expectations.include_chain_clauses_in_custom_matcher_descriptions = true
|
46
|
+
end
|
47
|
+
|
48
|
+
# rspec-mocks config goes here. You can use an alternate test double
|
49
|
+
# library (such as bogus or mocha) by changing the `mock_with` option here.
|
50
|
+
config.mock_with :rspec do |mocks|
|
51
|
+
# Prevents you from mocking or stubbing a method that does not exist on
|
52
|
+
# a real object. This is generally recommended, and will default to
|
53
|
+
# `true` in RSpec 4.
|
54
|
+
mocks.verify_partial_doubles = true
|
55
|
+
end
|
56
|
+
|
57
|
+
# This cleans out the test database between runs.
|
58
|
+
config.before(:all) do
|
59
|
+
reset_database
|
60
|
+
end
|
61
|
+
config.before(:each) do
|
62
|
+
reset_database
|
63
|
+
end
|
64
|
+
|
65
|
+
# The settings below are suggested to provide a good initial experience
|
66
|
+
# with RSpec, but feel free to customize to your heart's content.
|
67
|
+
=begin
|
68
|
+
# These two settings work together to allow you to limit a spec run
|
69
|
+
# to individual examples or groups you care about by tagging them with
|
70
|
+
# `:focus` metadata. When nothing is tagged with `:focus`, all examples
|
71
|
+
# get run.
|
72
|
+
config.filter_run :focus
|
73
|
+
config.run_all_when_everything_filtered = true
|
74
|
+
|
75
|
+
# Allows RSpec to persist some state between runs in order to support
|
76
|
+
# the `--only-failures` and `--next-failure` CLI options. We recommend
|
77
|
+
# you configure your source control system to ignore this file.
|
78
|
+
config.example_status_persistence_file_path = "spec/examples.txt"
|
79
|
+
|
80
|
+
# Limits the available syntax to the non-monkey patched syntax that is
|
81
|
+
# recommended. For more details, see:
|
82
|
+
# - http://myronmars.to/n/dev-blog/2012/06/rspecs-new-expectation-syntax
|
83
|
+
# - http://www.teaisaweso.me/blog/2013/05/27/rspecs-new-message-expectation-syntax/
|
84
|
+
# - http://myronmars.to/n/dev-blog/2014/05/notable-changes-in-rspec-3#new__config_option_to_disable_rspeccore_monkey_patching
|
85
|
+
config.disable_monkey_patching!
|
86
|
+
|
87
|
+
# This setting enables warnings. It's recommended, but in some cases may
|
88
|
+
# be too noisy due to issues in dependencies.
|
89
|
+
config.warnings = true
|
90
|
+
|
91
|
+
# Many RSpec users commonly either run the entire suite or an individual
|
92
|
+
# file, and it's useful to allow more verbose output when running an
|
93
|
+
# individual spec file.
|
94
|
+
if config.files_to_run.one?
|
95
|
+
# Use the documentation formatter for detailed output,
|
96
|
+
# unless a formatter has already been configured
|
97
|
+
# (e.g. via a command-line flag).
|
98
|
+
config.default_formatter = 'doc'
|
99
|
+
end
|
100
|
+
|
101
|
+
# Print the 10 slowest examples and example groups at the
|
102
|
+
# end of the spec run, to help surface which specs are running
|
103
|
+
# particularly slow.
|
104
|
+
config.profile_examples = 10
|
105
|
+
|
106
|
+
# Run specs in random order to surface order dependencies. If you find an
|
107
|
+
# order dependency and want to debug it, you can fix the order by providing
|
108
|
+
# the seed, which is printed after each run.
|
109
|
+
# --seed 1234
|
110
|
+
config.order = :random
|
111
|
+
|
112
|
+
# Seed global randomization in this process using the `--seed` CLI option.
|
113
|
+
# Setting this allows you to use `--seed` to deterministically reproduce
|
114
|
+
# test failures related to randomization by passing the same `--seed` value
|
115
|
+
# as the one that triggered the failure.
|
116
|
+
Kernel.srand config.seed
|
117
|
+
=end
|
118
|
+
end
|
metadata
ADDED
@@ -0,0 +1,216 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: reorm
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.1.0
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Peter Wood
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
date: 2015-08-07 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: bundler
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - "~>"
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '1.7'
|
20
|
+
type: :development
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - "~>"
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: '1.7'
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: rake
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - "~>"
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '10.0'
|
34
|
+
type: :development
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - "~>"
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '10.0'
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: rspec
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - "~>"
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: '3.3'
|
48
|
+
type: :development
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - "~>"
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '3.3'
|
55
|
+
- !ruby/object:Gem::Dependency
|
56
|
+
name: activesupport
|
57
|
+
requirement: !ruby/object:Gem::Requirement
|
58
|
+
requirements:
|
59
|
+
- - "~>"
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: '4.2'
|
62
|
+
type: :runtime
|
63
|
+
prerelease: false
|
64
|
+
version_requirements: !ruby/object:Gem::Requirement
|
65
|
+
requirements:
|
66
|
+
- - "~>"
|
67
|
+
- !ruby/object:Gem::Version
|
68
|
+
version: '4.2'
|
69
|
+
- !ruby/object:Gem::Dependency
|
70
|
+
name: configurative
|
71
|
+
requirement: !ruby/object:Gem::Requirement
|
72
|
+
requirements:
|
73
|
+
- - "~>"
|
74
|
+
- !ruby/object:Gem::Version
|
75
|
+
version: '0.1'
|
76
|
+
type: :runtime
|
77
|
+
prerelease: false
|
78
|
+
version_requirements: !ruby/object:Gem::Requirement
|
79
|
+
requirements:
|
80
|
+
- - "~>"
|
81
|
+
- !ruby/object:Gem::Version
|
82
|
+
version: '0.1'
|
83
|
+
- !ruby/object:Gem::Dependency
|
84
|
+
name: connection_pool
|
85
|
+
requirement: !ruby/object:Gem::Requirement
|
86
|
+
requirements:
|
87
|
+
- - "~>"
|
88
|
+
- !ruby/object:Gem::Version
|
89
|
+
version: '2.2'
|
90
|
+
type: :runtime
|
91
|
+
prerelease: false
|
92
|
+
version_requirements: !ruby/object:Gem::Requirement
|
93
|
+
requirements:
|
94
|
+
- - "~>"
|
95
|
+
- !ruby/object:Gem::Version
|
96
|
+
version: '2.2'
|
97
|
+
- !ruby/object:Gem::Dependency
|
98
|
+
name: logjam
|
99
|
+
requirement: !ruby/object:Gem::Requirement
|
100
|
+
requirements:
|
101
|
+
- - "~>"
|
102
|
+
- !ruby/object:Gem::Version
|
103
|
+
version: '1.2'
|
104
|
+
type: :runtime
|
105
|
+
prerelease: false
|
106
|
+
version_requirements: !ruby/object:Gem::Requirement
|
107
|
+
requirements:
|
108
|
+
- - "~>"
|
109
|
+
- !ruby/object:Gem::Version
|
110
|
+
version: '1.2'
|
111
|
+
- !ruby/object:Gem::Dependency
|
112
|
+
name: rethinkdb
|
113
|
+
requirement: !ruby/object:Gem::Requirement
|
114
|
+
requirements:
|
115
|
+
- - "~>"
|
116
|
+
- !ruby/object:Gem::Version
|
117
|
+
version: '2.0'
|
118
|
+
type: :runtime
|
119
|
+
prerelease: false
|
120
|
+
version_requirements: !ruby/object:Gem::Requirement
|
121
|
+
requirements:
|
122
|
+
- - "~>"
|
123
|
+
- !ruby/object:Gem::Version
|
124
|
+
version: '2.0'
|
125
|
+
description: A library the wraps RQL and provides a basic model class for the RethinkDB
|
126
|
+
system.
|
127
|
+
email:
|
128
|
+
- peter.wood@longboat.com
|
129
|
+
executables: []
|
130
|
+
extensions: []
|
131
|
+
extra_rdoc_files: []
|
132
|
+
files:
|
133
|
+
- ".gitignore"
|
134
|
+
- ".rspec"
|
135
|
+
- Gemfile
|
136
|
+
- LICENSE.txt
|
137
|
+
- README.md
|
138
|
+
- Rakefile
|
139
|
+
- config/database.yml
|
140
|
+
- lib/reorm.rb
|
141
|
+
- lib/reorm/configuration.rb
|
142
|
+
- lib/reorm/cursor.rb
|
143
|
+
- lib/reorm/exceptions.rb
|
144
|
+
- lib/reorm/field_path.rb
|
145
|
+
- lib/reorm/model.rb
|
146
|
+
- lib/reorm/modules.rb
|
147
|
+
- lib/reorm/modules/database_modules.rb
|
148
|
+
- lib/reorm/modules/event_modules.rb
|
149
|
+
- lib/reorm/modules/validation_modules.rb
|
150
|
+
- lib/reorm/property_errors.rb
|
151
|
+
- lib/reorm/validators.rb
|
152
|
+
- lib/reorm/validators/exclusion_validator.rb
|
153
|
+
- lib/reorm/validators/inclusion_validator.rb
|
154
|
+
- lib/reorm/validators/maximum_length_validator.rb
|
155
|
+
- lib/reorm/validators/minimum_length_validator.rb
|
156
|
+
- lib/reorm/validators/presence_validator.rb
|
157
|
+
- lib/reorm/validators/validator.rb
|
158
|
+
- lib/reorm/version.rb
|
159
|
+
- reorm.gemspec
|
160
|
+
- spec/catwalk/modules/timestamped_spec.rb
|
161
|
+
- spec/reorm/cursor_spec.rb
|
162
|
+
- spec/reorm/field_path_spec.rb
|
163
|
+
- spec/reorm/model_spec.rb
|
164
|
+
- spec/reorm/modules/event_source_spec.rb
|
165
|
+
- spec/reorm/modules/table_backed_spec.rb
|
166
|
+
- spec/reorm/modules/timestamped_spec.rb
|
167
|
+
- spec/reorm/modules/validation_modules_spec.rb
|
168
|
+
- spec/reorm/property_errors_spec.rb
|
169
|
+
- spec/reorm/validators/exclusion_validator_spec.rb
|
170
|
+
- spec/reorm/validators/inclusion_validator_spec.rb
|
171
|
+
- spec/reorm/validators/maximum_length_validator_spec.rb
|
172
|
+
- spec/reorm/validators/minimum_length_validator_spec.rb
|
173
|
+
- spec/reorm/validators/presence_validator_spec.rb
|
174
|
+
- spec/reorm/validators/validator_spec.rb
|
175
|
+
- spec/spec_helper.rb
|
176
|
+
homepage: https://github.com/free-beer/reorm
|
177
|
+
licenses:
|
178
|
+
- MIT
|
179
|
+
metadata: {}
|
180
|
+
post_install_message:
|
181
|
+
rdoc_options: []
|
182
|
+
require_paths:
|
183
|
+
- lib
|
184
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
185
|
+
requirements:
|
186
|
+
- - ">="
|
187
|
+
- !ruby/object:Gem::Version
|
188
|
+
version: '0'
|
189
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
190
|
+
requirements:
|
191
|
+
- - ">="
|
192
|
+
- !ruby/object:Gem::Version
|
193
|
+
version: '0'
|
194
|
+
requirements: []
|
195
|
+
rubyforge_project:
|
196
|
+
rubygems_version: 2.4.5
|
197
|
+
signing_key:
|
198
|
+
specification_version: 4
|
199
|
+
summary: A library for use with the RethinkDB application.
|
200
|
+
test_files:
|
201
|
+
- spec/catwalk/modules/timestamped_spec.rb
|
202
|
+
- spec/reorm/cursor_spec.rb
|
203
|
+
- spec/reorm/field_path_spec.rb
|
204
|
+
- spec/reorm/model_spec.rb
|
205
|
+
- spec/reorm/modules/event_source_spec.rb
|
206
|
+
- spec/reorm/modules/table_backed_spec.rb
|
207
|
+
- spec/reorm/modules/timestamped_spec.rb
|
208
|
+
- spec/reorm/modules/validation_modules_spec.rb
|
209
|
+
- spec/reorm/property_errors_spec.rb
|
210
|
+
- spec/reorm/validators/exclusion_validator_spec.rb
|
211
|
+
- spec/reorm/validators/inclusion_validator_spec.rb
|
212
|
+
- spec/reorm/validators/maximum_length_validator_spec.rb
|
213
|
+
- spec/reorm/validators/minimum_length_validator_spec.rb
|
214
|
+
- spec/reorm/validators/presence_validator_spec.rb
|
215
|
+
- spec/reorm/validators/validator_spec.rb
|
216
|
+
- spec/spec_helper.rb
|