vorpal 1.0.1 → 1.2.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (49) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +72 -56
  3. data/lib/vorpal/aggregate_mapper.rb +11 -0
  4. data/lib/vorpal/config/class_config.rb +71 -0
  5. data/lib/vorpal/configs.rb +9 -66
  6. data/lib/vorpal/driver/postgresql.rb +39 -3
  7. data/lib/vorpal/dsl/config_builder.rb +12 -50
  8. data/lib/vorpal/dsl/configuration.rb +131 -42
  9. data/lib/vorpal/dsl/defaults_generator.rb +14 -4
  10. data/lib/vorpal/engine.rb +18 -5
  11. data/lib/vorpal/identity_map.rb +15 -14
  12. data/lib/vorpal/version.rb +1 -1
  13. data/vorpal.gemspec +9 -9
  14. metadata +36 -88
  15. data/.editorconfig +0 -13
  16. data/.envrc +0 -4
  17. data/.gitignore +0 -16
  18. data/.rspec +0 -1
  19. data/.yardopts +0 -1
  20. data/Appraisals +0 -34
  21. data/Gemfile +0 -4
  22. data/Rakefile +0 -10
  23. data/bin/appraisal +0 -29
  24. data/bin/rake +0 -29
  25. data/bin/rspec +0 -29
  26. data/gemfiles/rails_4_1.gemfile +0 -11
  27. data/gemfiles/rails_4_1.gemfile.lock +0 -92
  28. data/gemfiles/rails_4_2.gemfile +0 -11
  29. data/gemfiles/rails_4_2.gemfile.lock +0 -90
  30. data/gemfiles/rails_5_0.gemfile +0 -11
  31. data/gemfiles/rails_5_0.gemfile.lock +0 -88
  32. data/gemfiles/rails_5_1.gemfile +0 -11
  33. data/gemfiles/rails_5_1.gemfile.lock +0 -88
  34. data/gemfiles/rails_5_2.gemfile +0 -11
  35. data/gemfiles/rails_5_2.gemfile.lock +0 -88
  36. data/spec/helpers/db_helpers.rb +0 -66
  37. data/spec/helpers/profile_helpers.rb +0 -26
  38. data/spec/integration_spec_helper.rb +0 -36
  39. data/spec/unit_spec_helper.rb +0 -0
  40. data/spec/vorpal/acceptance/aggregate_mapper_spec.rb +0 -911
  41. data/spec/vorpal/integration/driver/postgresql_spec.rb +0 -42
  42. data/spec/vorpal/performance/performance_spec.rb +0 -235
  43. data/spec/vorpal/unit/configs_spec.rb +0 -117
  44. data/spec/vorpal/unit/db_loader_spec.rb +0 -103
  45. data/spec/vorpal/unit/dsl/config_builder_spec.rb +0 -18
  46. data/spec/vorpal/unit/dsl/defaults_generator_spec.rb +0 -75
  47. data/spec/vorpal/unit/identity_map_spec.rb +0 -62
  48. data/spec/vorpal/unit/loaded_objects_spec.rb +0 -22
  49. data/spec/vorpal/unit/util/string_utils_spec.rb +0 -25
@@ -1,11 +0,0 @@
1
- # This file was generated by Appraisal
2
-
3
- source "https://rubygems.org"
4
-
5
- ruby ">= 2.1.6"
6
-
7
- gem "activerecord", "~> 4.2.0"
8
- gem "pg", "~> 0.17.0"
9
- gem "activerecord-import", "~> 0.10.0"
10
-
11
- gemspec path: "../"
@@ -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
@@ -1,11 +0,0 @@
1
- # This file was generated by Appraisal
2
-
3
- source "https://rubygems.org"
4
-
5
- ruby ">= 2.2.2"
6
-
7
- gem "activerecord", "~> 5.0.0"
8
- gem "pg", "~> 0.18.0"
9
- gem "activerecord-import", "= 0.13.0"
10
-
11
- gemspec path: "../"
@@ -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
@@ -1,11 +0,0 @@
1
- # This file was generated by Appraisal
2
-
3
- source "https://rubygems.org"
4
-
5
- ruby ">= 2.2.2"
6
-
7
- gem "activerecord", "~> 5.1.0"
8
- gem "pg", "~> 0.18.0"
9
- gem "activerecord-import", "= 0.13.0"
10
-
11
- gemspec path: "../"
@@ -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
@@ -1,11 +0,0 @@
1
- # This file was generated by Appraisal
2
-
3
- source "https://rubygems.org"
4
-
5
- ruby ">= 2.2.2"
6
-
7
- gem "activerecord", "~> 5.2.0"
8
- gem "pg", "~> 0.18.0"
9
- gem "activerecord-import", "= 0.13.0"
10
-
11
- gemspec path: "../"
@@ -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
@@ -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