vorpal 1.0.1 → 1.2.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +72 -56
- data/lib/vorpal/aggregate_mapper.rb +11 -0
- data/lib/vorpal/config/class_config.rb +71 -0
- data/lib/vorpal/configs.rb +9 -66
- data/lib/vorpal/driver/postgresql.rb +39 -3
- data/lib/vorpal/dsl/config_builder.rb +12 -50
- data/lib/vorpal/dsl/configuration.rb +131 -42
- data/lib/vorpal/dsl/defaults_generator.rb +14 -4
- data/lib/vorpal/engine.rb +18 -5
- data/lib/vorpal/identity_map.rb +15 -14
- data/lib/vorpal/version.rb +1 -1
- data/vorpal.gemspec +9 -9
- metadata +36 -88
- data/.editorconfig +0 -13
- data/.envrc +0 -4
- data/.gitignore +0 -16
- data/.rspec +0 -1
- data/.yardopts +0 -1
- data/Appraisals +0 -34
- data/Gemfile +0 -4
- data/Rakefile +0 -10
- data/bin/appraisal +0 -29
- data/bin/rake +0 -29
- data/bin/rspec +0 -29
- data/gemfiles/rails_4_1.gemfile +0 -11
- data/gemfiles/rails_4_1.gemfile.lock +0 -92
- data/gemfiles/rails_4_2.gemfile +0 -11
- data/gemfiles/rails_4_2.gemfile.lock +0 -90
- data/gemfiles/rails_5_0.gemfile +0 -11
- data/gemfiles/rails_5_0.gemfile.lock +0 -88
- data/gemfiles/rails_5_1.gemfile +0 -11
- data/gemfiles/rails_5_1.gemfile.lock +0 -88
- data/gemfiles/rails_5_2.gemfile +0 -11
- data/gemfiles/rails_5_2.gemfile.lock +0 -88
- data/spec/helpers/db_helpers.rb +0 -66
- data/spec/helpers/profile_helpers.rb +0 -26
- data/spec/integration_spec_helper.rb +0 -36
- data/spec/unit_spec_helper.rb +0 -0
- data/spec/vorpal/acceptance/aggregate_mapper_spec.rb +0 -911
- data/spec/vorpal/integration/driver/postgresql_spec.rb +0 -42
- data/spec/vorpal/performance/performance_spec.rb +0 -235
- data/spec/vorpal/unit/configs_spec.rb +0 -117
- data/spec/vorpal/unit/db_loader_spec.rb +0 -103
- data/spec/vorpal/unit/dsl/config_builder_spec.rb +0 -18
- data/spec/vorpal/unit/dsl/defaults_generator_spec.rb +0 -75
- data/spec/vorpal/unit/identity_map_spec.rb +0 -62
- data/spec/vorpal/unit/loaded_objects_spec.rb +0 -22
- data/spec/vorpal/unit/util/string_utils_spec.rb +0 -25
data/gemfiles/rails_4_2.gemfile
DELETED
@@ -1,90 +0,0 @@
|
|
1
|
-
PATH
|
2
|
-
remote: ..
|
3
|
-
specs:
|
4
|
-
vorpal (1.0.0)
|
5
|
-
activesupport
|
6
|
-
equalizer
|
7
|
-
simple_serializer (~> 1.0)
|
8
|
-
|
9
|
-
GEM
|
10
|
-
remote: https://rubygems.org/
|
11
|
-
specs:
|
12
|
-
activemodel (4.2.10)
|
13
|
-
activesupport (= 4.2.10)
|
14
|
-
builder (~> 3.1)
|
15
|
-
activerecord (4.2.10)
|
16
|
-
activemodel (= 4.2.10)
|
17
|
-
activesupport (= 4.2.10)
|
18
|
-
arel (~> 6.0)
|
19
|
-
activerecord-import (0.10.0)
|
20
|
-
activerecord (>= 3.0)
|
21
|
-
activesupport (4.2.10)
|
22
|
-
i18n (~> 0.7)
|
23
|
-
minitest (~> 5.1)
|
24
|
-
thread_safe (~> 0.3, >= 0.3.4)
|
25
|
-
tzinfo (~> 1.1)
|
26
|
-
appraisal (2.2.0)
|
27
|
-
bundler
|
28
|
-
rake
|
29
|
-
thor (>= 0.14.0)
|
30
|
-
arel (6.0.4)
|
31
|
-
axiom-types (0.1.1)
|
32
|
-
descendants_tracker (~> 0.0.4)
|
33
|
-
ice_nine (~> 0.11.0)
|
34
|
-
thread_safe (~> 0.3, >= 0.3.1)
|
35
|
-
builder (3.2.3)
|
36
|
-
coercible (1.0.0)
|
37
|
-
descendants_tracker (~> 0.0.1)
|
38
|
-
concurrent-ruby (1.0.5)
|
39
|
-
descendants_tracker (0.0.4)
|
40
|
-
thread_safe (~> 0.3, >= 0.3.1)
|
41
|
-
diff-lcs (1.3)
|
42
|
-
equalizer (0.0.11)
|
43
|
-
i18n (0.9.5)
|
44
|
-
concurrent-ruby (~> 1.0)
|
45
|
-
ice_nine (0.11.2)
|
46
|
-
minitest (5.11.3)
|
47
|
-
pg (0.17.1)
|
48
|
-
rake (10.5.0)
|
49
|
-
rspec (3.8.0)
|
50
|
-
rspec-core (~> 3.8.0)
|
51
|
-
rspec-expectations (~> 3.8.0)
|
52
|
-
rspec-mocks (~> 3.8.0)
|
53
|
-
rspec-core (3.8.0)
|
54
|
-
rspec-support (~> 3.8.0)
|
55
|
-
rspec-expectations (3.8.1)
|
56
|
-
diff-lcs (>= 1.2.0, < 2.0)
|
57
|
-
rspec-support (~> 3.8.0)
|
58
|
-
rspec-mocks (3.8.0)
|
59
|
-
diff-lcs (>= 1.2.0, < 2.0)
|
60
|
-
rspec-support (~> 3.8.0)
|
61
|
-
rspec-support (3.8.0)
|
62
|
-
simple_serializer (1.0.2)
|
63
|
-
thor (0.20.0)
|
64
|
-
thread_safe (0.3.6)
|
65
|
-
tzinfo (1.2.5)
|
66
|
-
thread_safe (~> 0.1)
|
67
|
-
virtus (1.0.5)
|
68
|
-
axiom-types (~> 0.1)
|
69
|
-
coercible (~> 1.0)
|
70
|
-
descendants_tracker (~> 0.0, >= 0.0.3)
|
71
|
-
equalizer (~> 0.0, >= 0.0.9)
|
72
|
-
|
73
|
-
PLATFORMS
|
74
|
-
ruby
|
75
|
-
|
76
|
-
DEPENDENCIES
|
77
|
-
activerecord (~> 4.2.0)
|
78
|
-
activerecord-import (~> 0.10.0)
|
79
|
-
appraisal (~> 2.2)
|
80
|
-
pg (~> 0.17.0)
|
81
|
-
rake (~> 10.0)
|
82
|
-
rspec (~> 3.0)
|
83
|
-
virtus (~> 1.0)
|
84
|
-
vorpal!
|
85
|
-
|
86
|
-
RUBY VERSION
|
87
|
-
ruby 2.3.3p222
|
88
|
-
|
89
|
-
BUNDLED WITH
|
90
|
-
1.16.2
|
data/gemfiles/rails_5_0.gemfile
DELETED
@@ -1,88 +0,0 @@
|
|
1
|
-
PATH
|
2
|
-
remote: ..
|
3
|
-
specs:
|
4
|
-
vorpal (1.0.0)
|
5
|
-
activesupport
|
6
|
-
equalizer
|
7
|
-
simple_serializer (~> 1.0)
|
8
|
-
|
9
|
-
GEM
|
10
|
-
remote: https://rubygems.org/
|
11
|
-
specs:
|
12
|
-
activemodel (5.0.7)
|
13
|
-
activesupport (= 5.0.7)
|
14
|
-
activerecord (5.0.7)
|
15
|
-
activemodel (= 5.0.7)
|
16
|
-
activesupport (= 5.0.7)
|
17
|
-
arel (~> 7.0)
|
18
|
-
activerecord-import (0.13.0)
|
19
|
-
activerecord (>= 3.0)
|
20
|
-
activesupport (5.0.7)
|
21
|
-
concurrent-ruby (~> 1.0, >= 1.0.2)
|
22
|
-
i18n (>= 0.7, < 2)
|
23
|
-
minitest (~> 5.1)
|
24
|
-
tzinfo (~> 1.1)
|
25
|
-
appraisal (2.2.0)
|
26
|
-
bundler
|
27
|
-
rake
|
28
|
-
thor (>= 0.14.0)
|
29
|
-
arel (7.1.4)
|
30
|
-
axiom-types (0.1.1)
|
31
|
-
descendants_tracker (~> 0.0.4)
|
32
|
-
ice_nine (~> 0.11.0)
|
33
|
-
thread_safe (~> 0.3, >= 0.3.1)
|
34
|
-
coercible (1.0.0)
|
35
|
-
descendants_tracker (~> 0.0.1)
|
36
|
-
concurrent-ruby (1.0.5)
|
37
|
-
descendants_tracker (0.0.4)
|
38
|
-
thread_safe (~> 0.3, >= 0.3.1)
|
39
|
-
diff-lcs (1.3)
|
40
|
-
equalizer (0.0.11)
|
41
|
-
i18n (1.1.0)
|
42
|
-
concurrent-ruby (~> 1.0)
|
43
|
-
ice_nine (0.11.2)
|
44
|
-
minitest (5.11.3)
|
45
|
-
pg (0.18.4)
|
46
|
-
rake (10.5.0)
|
47
|
-
rspec (3.8.0)
|
48
|
-
rspec-core (~> 3.8.0)
|
49
|
-
rspec-expectations (~> 3.8.0)
|
50
|
-
rspec-mocks (~> 3.8.0)
|
51
|
-
rspec-core (3.8.0)
|
52
|
-
rspec-support (~> 3.8.0)
|
53
|
-
rspec-expectations (3.8.1)
|
54
|
-
diff-lcs (>= 1.2.0, < 2.0)
|
55
|
-
rspec-support (~> 3.8.0)
|
56
|
-
rspec-mocks (3.8.0)
|
57
|
-
diff-lcs (>= 1.2.0, < 2.0)
|
58
|
-
rspec-support (~> 3.8.0)
|
59
|
-
rspec-support (3.8.0)
|
60
|
-
simple_serializer (1.0.2)
|
61
|
-
thor (0.20.0)
|
62
|
-
thread_safe (0.3.6)
|
63
|
-
tzinfo (1.2.5)
|
64
|
-
thread_safe (~> 0.1)
|
65
|
-
virtus (1.0.5)
|
66
|
-
axiom-types (~> 0.1)
|
67
|
-
coercible (~> 1.0)
|
68
|
-
descendants_tracker (~> 0.0, >= 0.0.3)
|
69
|
-
equalizer (~> 0.0, >= 0.0.9)
|
70
|
-
|
71
|
-
PLATFORMS
|
72
|
-
ruby
|
73
|
-
|
74
|
-
DEPENDENCIES
|
75
|
-
activerecord (~> 5.0.0)
|
76
|
-
activerecord-import (= 0.13.0)
|
77
|
-
appraisal (~> 2.2)
|
78
|
-
pg (~> 0.18.0)
|
79
|
-
rake (~> 10.0)
|
80
|
-
rspec (~> 3.0)
|
81
|
-
virtus (~> 1.0)
|
82
|
-
vorpal!
|
83
|
-
|
84
|
-
RUBY VERSION
|
85
|
-
ruby 2.3.3p222
|
86
|
-
|
87
|
-
BUNDLED WITH
|
88
|
-
1.16.2
|
data/gemfiles/rails_5_1.gemfile
DELETED
@@ -1,88 +0,0 @@
|
|
1
|
-
PATH
|
2
|
-
remote: ..
|
3
|
-
specs:
|
4
|
-
vorpal (1.0.0)
|
5
|
-
activesupport
|
6
|
-
equalizer
|
7
|
-
simple_serializer (~> 1.0)
|
8
|
-
|
9
|
-
GEM
|
10
|
-
remote: https://rubygems.org/
|
11
|
-
specs:
|
12
|
-
activemodel (5.1.6)
|
13
|
-
activesupport (= 5.1.6)
|
14
|
-
activerecord (5.1.6)
|
15
|
-
activemodel (= 5.1.6)
|
16
|
-
activesupport (= 5.1.6)
|
17
|
-
arel (~> 8.0)
|
18
|
-
activerecord-import (0.13.0)
|
19
|
-
activerecord (>= 3.0)
|
20
|
-
activesupport (5.1.6)
|
21
|
-
concurrent-ruby (~> 1.0, >= 1.0.2)
|
22
|
-
i18n (>= 0.7, < 2)
|
23
|
-
minitest (~> 5.1)
|
24
|
-
tzinfo (~> 1.1)
|
25
|
-
appraisal (2.2.0)
|
26
|
-
bundler
|
27
|
-
rake
|
28
|
-
thor (>= 0.14.0)
|
29
|
-
arel (8.0.0)
|
30
|
-
axiom-types (0.1.1)
|
31
|
-
descendants_tracker (~> 0.0.4)
|
32
|
-
ice_nine (~> 0.11.0)
|
33
|
-
thread_safe (~> 0.3, >= 0.3.1)
|
34
|
-
coercible (1.0.0)
|
35
|
-
descendants_tracker (~> 0.0.1)
|
36
|
-
concurrent-ruby (1.0.5)
|
37
|
-
descendants_tracker (0.0.4)
|
38
|
-
thread_safe (~> 0.3, >= 0.3.1)
|
39
|
-
diff-lcs (1.3)
|
40
|
-
equalizer (0.0.11)
|
41
|
-
i18n (1.1.0)
|
42
|
-
concurrent-ruby (~> 1.0)
|
43
|
-
ice_nine (0.11.2)
|
44
|
-
minitest (5.11.3)
|
45
|
-
pg (0.18.4)
|
46
|
-
rake (10.5.0)
|
47
|
-
rspec (3.8.0)
|
48
|
-
rspec-core (~> 3.8.0)
|
49
|
-
rspec-expectations (~> 3.8.0)
|
50
|
-
rspec-mocks (~> 3.8.0)
|
51
|
-
rspec-core (3.8.0)
|
52
|
-
rspec-support (~> 3.8.0)
|
53
|
-
rspec-expectations (3.8.1)
|
54
|
-
diff-lcs (>= 1.2.0, < 2.0)
|
55
|
-
rspec-support (~> 3.8.0)
|
56
|
-
rspec-mocks (3.8.0)
|
57
|
-
diff-lcs (>= 1.2.0, < 2.0)
|
58
|
-
rspec-support (~> 3.8.0)
|
59
|
-
rspec-support (3.8.0)
|
60
|
-
simple_serializer (1.0.2)
|
61
|
-
thor (0.20.0)
|
62
|
-
thread_safe (0.3.6)
|
63
|
-
tzinfo (1.2.5)
|
64
|
-
thread_safe (~> 0.1)
|
65
|
-
virtus (1.0.5)
|
66
|
-
axiom-types (~> 0.1)
|
67
|
-
coercible (~> 1.0)
|
68
|
-
descendants_tracker (~> 0.0, >= 0.0.3)
|
69
|
-
equalizer (~> 0.0, >= 0.0.9)
|
70
|
-
|
71
|
-
PLATFORMS
|
72
|
-
ruby
|
73
|
-
|
74
|
-
DEPENDENCIES
|
75
|
-
activerecord (~> 5.1.0)
|
76
|
-
activerecord-import (= 0.13.0)
|
77
|
-
appraisal (~> 2.2)
|
78
|
-
pg (~> 0.18.0)
|
79
|
-
rake (~> 10.0)
|
80
|
-
rspec (~> 3.0)
|
81
|
-
virtus (~> 1.0)
|
82
|
-
vorpal!
|
83
|
-
|
84
|
-
RUBY VERSION
|
85
|
-
ruby 2.3.3p222
|
86
|
-
|
87
|
-
BUNDLED WITH
|
88
|
-
1.16.2
|
data/gemfiles/rails_5_2.gemfile
DELETED
@@ -1,88 +0,0 @@
|
|
1
|
-
PATH
|
2
|
-
remote: ..
|
3
|
-
specs:
|
4
|
-
vorpal (1.0.0)
|
5
|
-
activesupport
|
6
|
-
equalizer
|
7
|
-
simple_serializer (~> 1.0)
|
8
|
-
|
9
|
-
GEM
|
10
|
-
remote: https://rubygems.org/
|
11
|
-
specs:
|
12
|
-
activemodel (5.2.1)
|
13
|
-
activesupport (= 5.2.1)
|
14
|
-
activerecord (5.2.1)
|
15
|
-
activemodel (= 5.2.1)
|
16
|
-
activesupport (= 5.2.1)
|
17
|
-
arel (>= 9.0)
|
18
|
-
activerecord-import (0.13.0)
|
19
|
-
activerecord (>= 3.0)
|
20
|
-
activesupport (5.2.1)
|
21
|
-
concurrent-ruby (~> 1.0, >= 1.0.2)
|
22
|
-
i18n (>= 0.7, < 2)
|
23
|
-
minitest (~> 5.1)
|
24
|
-
tzinfo (~> 1.1)
|
25
|
-
appraisal (2.2.0)
|
26
|
-
bundler
|
27
|
-
rake
|
28
|
-
thor (>= 0.14.0)
|
29
|
-
arel (9.0.0)
|
30
|
-
axiom-types (0.1.1)
|
31
|
-
descendants_tracker (~> 0.0.4)
|
32
|
-
ice_nine (~> 0.11.0)
|
33
|
-
thread_safe (~> 0.3, >= 0.3.1)
|
34
|
-
coercible (1.0.0)
|
35
|
-
descendants_tracker (~> 0.0.1)
|
36
|
-
concurrent-ruby (1.0.5)
|
37
|
-
descendants_tracker (0.0.4)
|
38
|
-
thread_safe (~> 0.3, >= 0.3.1)
|
39
|
-
diff-lcs (1.3)
|
40
|
-
equalizer (0.0.11)
|
41
|
-
i18n (1.1.0)
|
42
|
-
concurrent-ruby (~> 1.0)
|
43
|
-
ice_nine (0.11.2)
|
44
|
-
minitest (5.11.3)
|
45
|
-
pg (0.18.4)
|
46
|
-
rake (10.5.0)
|
47
|
-
rspec (3.8.0)
|
48
|
-
rspec-core (~> 3.8.0)
|
49
|
-
rspec-expectations (~> 3.8.0)
|
50
|
-
rspec-mocks (~> 3.8.0)
|
51
|
-
rspec-core (3.8.0)
|
52
|
-
rspec-support (~> 3.8.0)
|
53
|
-
rspec-expectations (3.8.1)
|
54
|
-
diff-lcs (>= 1.2.0, < 2.0)
|
55
|
-
rspec-support (~> 3.8.0)
|
56
|
-
rspec-mocks (3.8.0)
|
57
|
-
diff-lcs (>= 1.2.0, < 2.0)
|
58
|
-
rspec-support (~> 3.8.0)
|
59
|
-
rspec-support (3.8.0)
|
60
|
-
simple_serializer (1.0.2)
|
61
|
-
thor (0.20.0)
|
62
|
-
thread_safe (0.3.6)
|
63
|
-
tzinfo (1.2.5)
|
64
|
-
thread_safe (~> 0.1)
|
65
|
-
virtus (1.0.5)
|
66
|
-
axiom-types (~> 0.1)
|
67
|
-
coercible (~> 1.0)
|
68
|
-
descendants_tracker (~> 0.0, >= 0.0.3)
|
69
|
-
equalizer (~> 0.0, >= 0.0.9)
|
70
|
-
|
71
|
-
PLATFORMS
|
72
|
-
ruby
|
73
|
-
|
74
|
-
DEPENDENCIES
|
75
|
-
activerecord (~> 5.2.0)
|
76
|
-
activerecord-import (= 0.13.0)
|
77
|
-
appraisal (~> 2.2)
|
78
|
-
pg (~> 0.18.0)
|
79
|
-
rake (~> 10.0)
|
80
|
-
rspec (~> 3.0)
|
81
|
-
virtus (~> 1.0)
|
82
|
-
vorpal!
|
83
|
-
|
84
|
-
RUBY VERSION
|
85
|
-
ruby 2.3.3p222
|
86
|
-
|
87
|
-
BUNDLED WITH
|
88
|
-
1.16.2
|
data/spec/helpers/db_helpers.rb
DELETED
@@ -1,66 +0,0 @@
|
|
1
|
-
module DbHelpers
|
2
|
-
module_function
|
3
|
-
|
4
|
-
CONNECTION_SETTINGS = {
|
5
|
-
adapter: 'postgresql',
|
6
|
-
host: 'localhost',
|
7
|
-
database: 'vorpal_test',
|
8
|
-
min_messages: 'error',
|
9
|
-
# Change the following to reflect your database settings
|
10
|
-
# username: 'vorpal',
|
11
|
-
# password: 'pass',
|
12
|
-
}
|
13
|
-
|
14
|
-
def ensure_database_exists
|
15
|
-
test_database_name = CONNECTION_SETTINGS.fetch(:database)
|
16
|
-
if !db_exists?(test_database_name)
|
17
|
-
db_connection.create_database(test_database_name)
|
18
|
-
end
|
19
|
-
end
|
20
|
-
|
21
|
-
def db_exists?(db_name)
|
22
|
-
ActiveRecord::Base.establish_connection(CONNECTION_SETTINGS.merge(database: 'template1'))
|
23
|
-
|
24
|
-
return db_connection.exec_query("SELECT 1 from pg_database WHERE datname='#{db_name}';").present?
|
25
|
-
end
|
26
|
-
|
27
|
-
def db_connection
|
28
|
-
ActiveRecord::Base.connection
|
29
|
-
end
|
30
|
-
|
31
|
-
def establish_connection
|
32
|
-
ActiveRecord::Base.establish_connection(CONNECTION_SETTINGS)
|
33
|
-
end
|
34
|
-
|
35
|
-
# when you change a table's columns, set force to true to re-generate the table in the DB
|
36
|
-
def define_table(table_name, columns, force)
|
37
|
-
if table_name_is_free?(table_name) || force
|
38
|
-
db_connection.create_table(table_name, force: true) do |t|
|
39
|
-
columns.each do |name, type|
|
40
|
-
t.send(type, name)
|
41
|
-
end
|
42
|
-
end
|
43
|
-
end
|
44
|
-
end
|
45
|
-
|
46
|
-
def defineAr(table_name)
|
47
|
-
Class.new(ActiveRecord::Base) do
|
48
|
-
self.table_name = table_name
|
49
|
-
end
|
50
|
-
end
|
51
|
-
|
52
|
-
private
|
53
|
-
|
54
|
-
def table_name_is_free?(table_name)
|
55
|
-
if ActiveRecord::VERSION::MAJOR == 4 && ActiveRecord::VERSION::MINOR == 1
|
56
|
-
!db_connection.table_exists?(table_name)
|
57
|
-
elsif (ActiveRecord::VERSION::MAJOR == 4 && ActiveRecord::VERSION::MINOR == 2) ||
|
58
|
-
(ActiveRecord::VERSION::MAJOR == 5 && ActiveRecord::VERSION::MINOR == 0) ||
|
59
|
-
(ActiveRecord::VERSION::MAJOR == 5 && ActiveRecord::VERSION::MINOR == 1) ||
|
60
|
-
(ActiveRecord::VERSION::MAJOR == 5 && ActiveRecord::VERSION::MINOR == 2)
|
61
|
-
!db_connection.data_source_exists?(table_name)
|
62
|
-
else
|
63
|
-
raise "ActiveRecord Version #{ActiveRecord::VERSION::STRING} is not supported!"
|
64
|
-
end
|
65
|
-
end
|
66
|
-
end
|