vorpal 1.0.2 → 1.3.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (62) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +73 -26
  3. data/lib/vorpal/aggregate_mapper.rb +13 -2
  4. data/lib/vorpal/aggregate_traversal.rb +9 -8
  5. data/lib/vorpal/config/association_config.rb +84 -0
  6. data/lib/vorpal/config/belongs_to_config.rb +35 -0
  7. data/lib/vorpal/config/class_config.rb +71 -0
  8. data/lib/vorpal/config/configs.rb +54 -0
  9. data/lib/vorpal/config/foreign_key_info.rb +23 -0
  10. data/lib/vorpal/config/has_many_config.rb +38 -0
  11. data/lib/vorpal/config/has_one_config.rb +35 -0
  12. data/lib/vorpal/config/main_config.rb +68 -0
  13. data/lib/vorpal/db_loader.rb +25 -22
  14. data/lib/vorpal/driver/postgresql.rb +42 -6
  15. data/lib/vorpal/dsl/config_builder.rb +26 -73
  16. data/lib/vorpal/dsl/configuration.rb +139 -42
  17. data/lib/vorpal/dsl/defaults_generator.rb +1 -1
  18. data/lib/vorpal/engine.rb +27 -13
  19. data/lib/vorpal/exceptions.rb +4 -0
  20. data/lib/vorpal/identity_map.rb +7 -2
  21. data/lib/vorpal/loaded_objects.rb +57 -14
  22. data/lib/vorpal/util/array_hash.rb +22 -8
  23. data/lib/vorpal/util/hash_initialization.rb +1 -1
  24. data/lib/vorpal/version.rb +1 -1
  25. data/vorpal.gemspec +4 -5
  26. metadata +18 -78
  27. data/.editorconfig +0 -13
  28. data/.envrc +0 -4
  29. data/.gitignore +0 -16
  30. data/.rspec +0 -1
  31. data/.ruby-version +0 -1
  32. data/.travis.yml +0 -18
  33. data/.yardopts +0 -1
  34. data/Appraisals +0 -18
  35. data/Gemfile +0 -4
  36. data/Rakefile +0 -39
  37. data/bin/appraisal +0 -29
  38. data/bin/rake +0 -29
  39. data/bin/rspec +0 -29
  40. data/docker-compose.yml +0 -19
  41. data/gemfiles/rails_5_1.gemfile +0 -11
  42. data/gemfiles/rails_5_1.gemfile.lock +0 -101
  43. data/gemfiles/rails_5_2.gemfile +0 -11
  44. data/gemfiles/rails_5_2.gemfile.lock +0 -101
  45. data/gemfiles/rails_6_0.gemfile +0 -9
  46. data/gemfiles/rails_6_0.gemfile.lock +0 -101
  47. data/lib/vorpal/configs.rb +0 -296
  48. data/spec/acceptance/vorpal/aggregate_mapper_spec.rb +0 -910
  49. data/spec/helpers/codecov_helper.rb +0 -7
  50. data/spec/helpers/db_helpers.rb +0 -69
  51. data/spec/helpers/profile_helpers.rb +0 -26
  52. data/spec/integration/vorpal/driver/postgresql_spec.rb +0 -42
  53. data/spec/integration_spec_helper.rb +0 -29
  54. data/spec/performance/vorpal/performance_spec.rb +0 -305
  55. data/spec/unit/vorpal/configs_spec.rb +0 -117
  56. data/spec/unit/vorpal/db_loader_spec.rb +0 -103
  57. data/spec/unit/vorpal/dsl/config_builder_spec.rb +0 -18
  58. data/spec/unit/vorpal/dsl/defaults_generator_spec.rb +0 -75
  59. data/spec/unit/vorpal/identity_map_spec.rb +0 -62
  60. data/spec/unit/vorpal/loaded_objects_spec.rb +0 -22
  61. data/spec/unit/vorpal/util/string_utils_spec.rb +0 -25
  62. data/spec/unit_spec_helper.rb +0 -1
@@ -2,7 +2,7 @@ module Vorpal
2
2
  module Util
3
3
  # @private
4
4
  module HashInitialization
5
- def initialize(attrs)
5
+ def initialize(attrs={})
6
6
  attrs.each do |k,v|
7
7
  instance_variable_set("@#{k}", v)
8
8
  end
@@ -1,3 +1,3 @@
1
1
  module Vorpal
2
- VERSION = "1.0.2"
2
+ VERSION = "1.3.0"
3
3
  end
data/vorpal.gemspec CHANGED
@@ -13,18 +13,17 @@ Gem::Specification.new do |spec|
13
13
  spec.homepage = "https://github.com/nulogy/vorpal"
14
14
  spec.license = "MIT"
15
15
 
16
- spec.files = `git ls-files -z`.split("\x0")
17
- spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
18
- spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
16
+ spec.files = Dir["CHANGELOG.md", "LICENSE.txt", "README.md", "vorpal.gemspec", "lib/**/*"]
17
+ spec.bindir = "exe"
18
+ spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
19
19
  spec.require_paths = ["lib"]
20
20
 
21
21
  spec.add_runtime_dependency "simple_serializer", "~> 1.0"
22
22
  spec.add_runtime_dependency "equalizer"
23
23
  spec.add_runtime_dependency "activesupport"
24
24
 
25
- spec.add_development_dependency "rake", "~> 10"
25
+ spec.add_development_dependency "rake", "~> 13"
26
26
  spec.add_development_dependency "rspec", "~> 3.0"
27
- spec.add_development_dependency "virtus", "~> 1.0"
28
27
  spec.add_development_dependency "appraisal", "~> 2.2"
29
28
 
30
29
  spec.required_ruby_version = ">= 2.5.7"
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: vorpal
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.2
4
+ version: 1.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sean Kirby
8
- autorequire:
9
- bindir: bin
8
+ autorequire:
9
+ bindir: exe
10
10
  cert_chain: []
11
- date: 2020-01-24 00:00:00.000000000 Z
11
+ date: 2021-07-07 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: simple_serializer
@@ -58,14 +58,14 @@ dependencies:
58
58
  requirements:
59
59
  - - "~>"
60
60
  - !ruby/object:Gem::Version
61
- version: '10'
61
+ version: '13'
62
62
  type: :development
63
63
  prerelease: false
64
64
  version_requirements: !ruby/object:Gem::Requirement
65
65
  requirements:
66
66
  - - "~>"
67
67
  - !ruby/object:Gem::Version
68
- version: '10'
68
+ version: '13'
69
69
  - !ruby/object:Gem::Dependency
70
70
  name: rspec
71
71
  requirement: !ruby/object:Gem::Requirement
@@ -80,20 +80,6 @@ dependencies:
80
80
  - - "~>"
81
81
  - !ruby/object:Gem::Version
82
82
  version: '3.0'
83
- - !ruby/object:Gem::Dependency
84
- name: virtus
85
- requirement: !ruby/object:Gem::Requirement
86
- requirements:
87
- - - "~>"
88
- - !ruby/object:Gem::Version
89
- version: '1.0'
90
- type: :development
91
- prerelease: false
92
- version_requirements: !ruby/object:Gem::Requirement
93
- requirements:
94
- - - "~>"
95
- - !ruby/object:Gem::Version
96
- version: '1.0'
97
83
  - !ruby/object:Gem::Dependency
98
84
  name: appraisal
99
85
  requirement: !ruby/object:Gem::Requirement
@@ -168,41 +154,25 @@ description: An ORM framelet that fits on top of ActiveRecord to give you 'Data
168
154
  semantics.
169
155
  email:
170
156
  - seank@nulogy.com
171
- executables:
172
- - appraisal
173
- - rake
174
- - rspec
157
+ executables: []
175
158
  extensions: []
176
159
  extra_rdoc_files: []
177
160
  files:
178
- - ".editorconfig"
179
- - ".envrc"
180
- - ".gitignore"
181
- - ".rspec"
182
- - ".ruby-version"
183
- - ".travis.yml"
184
- - ".yardopts"
185
- - Appraisals
186
161
  - CHANGELOG.md
187
- - Gemfile
188
162
  - LICENSE.txt
189
163
  - README.md
190
- - Rakefile
191
- - bin/appraisal
192
- - bin/rake
193
- - bin/rspec
194
- - docker-compose.yml
195
- - gemfiles/rails_5_1.gemfile
196
- - gemfiles/rails_5_1.gemfile.lock
197
- - gemfiles/rails_5_2.gemfile
198
- - gemfiles/rails_5_2.gemfile.lock
199
- - gemfiles/rails_6_0.gemfile
200
- - gemfiles/rails_6_0.gemfile.lock
201
164
  - lib/vorpal.rb
202
165
  - lib/vorpal/aggregate_mapper.rb
203
166
  - lib/vorpal/aggregate_traversal.rb
204
167
  - lib/vorpal/aggregate_utils.rb
205
- - lib/vorpal/configs.rb
168
+ - lib/vorpal/config/association_config.rb
169
+ - lib/vorpal/config/belongs_to_config.rb
170
+ - lib/vorpal/config/class_config.rb
171
+ - lib/vorpal/config/configs.rb
172
+ - lib/vorpal/config/foreign_key_info.rb
173
+ - lib/vorpal/config/has_many_config.rb
174
+ - lib/vorpal/config/has_one_config.rb
175
+ - lib/vorpal/config/main_config.rb
206
176
  - lib/vorpal/db_loader.rb
207
177
  - lib/vorpal/driver/postgresql.rb
208
178
  - lib/vorpal/dsl/config_builder.rb
@@ -216,27 +186,12 @@ files:
216
186
  - lib/vorpal/util/hash_initialization.rb
217
187
  - lib/vorpal/util/string_utils.rb
218
188
  - lib/vorpal/version.rb
219
- - spec/acceptance/vorpal/aggregate_mapper_spec.rb
220
- - spec/helpers/codecov_helper.rb
221
- - spec/helpers/db_helpers.rb
222
- - spec/helpers/profile_helpers.rb
223
- - spec/integration/vorpal/driver/postgresql_spec.rb
224
- - spec/integration_spec_helper.rb
225
- - spec/performance/vorpal/performance_spec.rb
226
- - spec/unit/vorpal/configs_spec.rb
227
- - spec/unit/vorpal/db_loader_spec.rb
228
- - spec/unit/vorpal/dsl/config_builder_spec.rb
229
- - spec/unit/vorpal/dsl/defaults_generator_spec.rb
230
- - spec/unit/vorpal/identity_map_spec.rb
231
- - spec/unit/vorpal/loaded_objects_spec.rb
232
- - spec/unit/vorpal/util/string_utils_spec.rb
233
- - spec/unit_spec_helper.rb
234
189
  - vorpal.gemspec
235
190
  homepage: https://github.com/nulogy/vorpal
236
191
  licenses:
237
192
  - MIT
238
193
  metadata: {}
239
- post_install_message:
194
+ post_install_message:
240
195
  rdoc_options: []
241
196
  require_paths:
242
197
  - lib
@@ -252,22 +207,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
252
207
  version: '0'
253
208
  requirements: []
254
209
  rubygems_version: 3.1.2
255
- signing_key:
210
+ signing_key:
256
211
  specification_version: 4
257
212
  summary: Separate your domain model from your persistence mechanism.
258
- test_files:
259
- - spec/acceptance/vorpal/aggregate_mapper_spec.rb
260
- - spec/helpers/codecov_helper.rb
261
- - spec/helpers/db_helpers.rb
262
- - spec/helpers/profile_helpers.rb
263
- - spec/integration/vorpal/driver/postgresql_spec.rb
264
- - spec/integration_spec_helper.rb
265
- - spec/performance/vorpal/performance_spec.rb
266
- - spec/unit/vorpal/configs_spec.rb
267
- - spec/unit/vorpal/db_loader_spec.rb
268
- - spec/unit/vorpal/dsl/config_builder_spec.rb
269
- - spec/unit/vorpal/dsl/defaults_generator_spec.rb
270
- - spec/unit/vorpal/identity_map_spec.rb
271
- - spec/unit/vorpal/loaded_objects_spec.rb
272
- - spec/unit/vorpal/util/string_utils_spec.rb
273
- - spec/unit_spec_helper.rb
213
+ test_files: []
data/.editorconfig DELETED
@@ -1,13 +0,0 @@
1
- root = true
2
-
3
- [*]
4
-
5
- indent_style = space
6
- indent_size = 2
7
- end_of_line = lf
8
- charset = utf-8
9
- trim_trailing_whitespace = true
10
- insert_final_newline = true
11
-
12
- [*.md]
13
- trim_trailing_whitespace = false
data/.envrc DELETED
@@ -1,4 +0,0 @@
1
- #@IgnoreInspection BashAddShebang
2
- # Configuration for direnv (see https://github.com/direnv/direnv)
3
-
4
- PATH_add bin
data/.gitignore DELETED
@@ -1,16 +0,0 @@
1
- /.bundle/
2
- /.idea/
3
- /.yardoc
4
- /Gemfile.lock
5
- /_yardoc/
6
- /coverage/
7
- /doc/
8
- /pkg/
9
- /spec/reports/
10
- /tmp/
11
- *.bundle
12
- *.so
13
- *.o
14
- *.a
15
- mkmf.log
16
- /projectFilesBackup
data/.rspec DELETED
@@ -1 +0,0 @@
1
- --colour
data/.ruby-version DELETED
@@ -1 +0,0 @@
1
- 2.7.0
data/.travis.yml DELETED
@@ -1,18 +0,0 @@
1
- language: ruby
2
- services:
3
- - postgresql
4
- matrix:
5
- include:
6
- - rvm: 2.5.7
7
- gemfile: gemfiles/rails_5_1.gemfile
8
- - rvm: 2.6
9
- gemfile: gemfiles/rails_5_1.gemfile
10
- - rvm: 2.6
11
- gemfile: gemfiles/rails_5_2.gemfile
12
- - rvm: 2.7
13
- gemfile: gemfiles/rails_6_0.gemfile
14
- cache:
15
- - bundler
16
- script: "bundle exec rake"
17
- env:
18
- - CODECOV_TOKEN="fab4ddb8-ba2c-47cb-a407-941209ad54a4"
data/.yardopts DELETED
@@ -1 +0,0 @@
1
- --no-private -m markdown lib/**/*.*
data/Appraisals DELETED
@@ -1,18 +0,0 @@
1
- appraise "rails-6-0" do
2
- ruby ">= 2.7.0"
3
- gem "activerecord", "~> 6.0.0"
4
- end
5
-
6
- appraise "rails-5-2" do
7
- ruby ">= 2.5.7"
8
- gem "activerecord", "~> 5.2.0"
9
- gem "pg", "~> 0.18.0"
10
- gem "activerecord-import", "= 0.13.0"
11
- end
12
-
13
- appraise "rails-5-1" do
14
- ruby ">= 2.5.7"
15
- gem "activerecord", "~> 5.1.0"
16
- gem "pg", "~> 0.18.0"
17
- gem "activerecord-import", "= 0.13.0"
18
- end
data/Gemfile DELETED
@@ -1,4 +0,0 @@
1
- source 'https://rubygems.org'
2
-
3
- # Specify your gem's dependencies in vorpal.gemspec
4
- gemspec
data/Rakefile DELETED
@@ -1,39 +0,0 @@
1
- #!/usr/bin/env rake
2
- begin
3
- require "bundler/gem_tasks"
4
- rescue LoadError
5
- puts 'You must `gem install bundler` and `bundle install` to run rake tasks associated with creating new versions of the gem.'
6
- end
7
-
8
- begin
9
- require 'rspec/core/rake_task'
10
-
11
- namespace :spec do
12
- RSpec::Core::RakeTask.new(:acceptance) do |t|
13
- t.pattern = "spec/acceptance/**/*_spec.rb"
14
- end
15
-
16
- RSpec::Core::RakeTask.new(:integration) do |t|
17
- t.pattern = "spec/integration/**/*_spec.rb"
18
- end
19
-
20
- RSpec::Core::RakeTask.new(:performance) do |t|
21
- t.pattern = "spec/performance/**/*_spec.rb"
22
- end
23
-
24
- RSpec::Core::RakeTask.new(:unit) do |t|
25
- t.pattern = "spec/unit/**/*_spec.rb"
26
- end
27
-
28
- desc "Run all non-performance related specs"
29
- task non_perf: [:unit, :integration, :acceptance]
30
-
31
- desc "Run all specs"
32
- task all: [:acceptance, :integration, :unit, :performance]
33
- end
34
-
35
- task default: :'spec:all'
36
- rescue LoadError
37
- # Allow the Rakefile to be used in environments where the RSpec gem is unavailable
38
- # (e.g. Production)
39
- end
data/bin/appraisal DELETED
@@ -1,29 +0,0 @@
1
- #!/usr/bin/env ruby
2
- # frozen_string_literal: true
3
-
4
- #
5
- # This file was generated by Bundler.
6
- #
7
- # The application 'appraisal' is installed as part of a gem, and
8
- # this file is here to facilitate running it.
9
- #
10
-
11
- require "pathname"
12
- ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../../Gemfile",
13
- Pathname.new(__FILE__).realpath)
14
-
15
- bundle_binstub = File.expand_path("../bundle", __FILE__)
16
-
17
- if File.file?(bundle_binstub)
18
- if File.read(bundle_binstub, 300) =~ /This file was generated by Bundler/
19
- load(bundle_binstub)
20
- else
21
- abort("Your `bin/bundle` was not generated by Bundler, so this binstub cannot run.
22
- Replace `bin/bundle` by running `bundle binstubs bundler --force`, then run this command again.")
23
- end
24
- end
25
-
26
- require "rubygems"
27
- require "bundler/setup"
28
-
29
- load Gem.bin_path("appraisal", "appraisal")
data/bin/rake DELETED
@@ -1,29 +0,0 @@
1
- #!/usr/bin/env ruby
2
- # frozen_string_literal: true
3
-
4
- #
5
- # This file was generated by Bundler.
6
- #
7
- # The application 'rake' is installed as part of a gem, and
8
- # this file is here to facilitate running it.
9
- #
10
-
11
- require "pathname"
12
- ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../../Gemfile",
13
- Pathname.new(__FILE__).realpath)
14
-
15
- bundle_binstub = File.expand_path("../bundle", __FILE__)
16
-
17
- if File.file?(bundle_binstub)
18
- if File.read(bundle_binstub, 300) =~ /This file was generated by Bundler/
19
- load(bundle_binstub)
20
- else
21
- abort("Your `bin/bundle` was not generated by Bundler, so this binstub cannot run.
22
- Replace `bin/bundle` by running `bundle binstubs bundler --force`, then run this command again.")
23
- end
24
- end
25
-
26
- require "rubygems"
27
- require "bundler/setup"
28
-
29
- load Gem.bin_path("rake", "rake")
data/bin/rspec DELETED
@@ -1,29 +0,0 @@
1
- #!/usr/bin/env ruby
2
- # frozen_string_literal: true
3
-
4
- #
5
- # This file was generated by Bundler.
6
- #
7
- # The application 'rspec' is installed as part of a gem, and
8
- # this file is here to facilitate running it.
9
- #
10
-
11
- require "pathname"
12
- ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../../Gemfile",
13
- Pathname.new(__FILE__).realpath)
14
-
15
- bundle_binstub = File.expand_path("../bundle", __FILE__)
16
-
17
- if File.file?(bundle_binstub)
18
- if File.read(bundle_binstub, 300) =~ /This file was generated by Bundler/
19
- load(bundle_binstub)
20
- else
21
- abort("Your `bin/bundle` was not generated by Bundler, so this binstub cannot run.
22
- Replace `bin/bundle` by running `bundle binstubs bundler --force`, then run this command again.")
23
- end
24
- end
25
-
26
- require "rubygems"
27
- require "bundler/setup"
28
-
29
- load Gem.bin_path("rspec-core", "rspec")
data/docker-compose.yml DELETED
@@ -1,19 +0,0 @@
1
- version: "3.6"
2
-
3
- services:
4
- vorpal_postgres:
5
- hostname: vorpal_postgres
6
- command: -p 55433
7
- image: postgres:11.4
8
- ports:
9
- - "55433:55433"
10
- volumes:
11
- - vorpal_postgres_volume:/var/lib/postgresql/data
12
- environment:
13
- POSTGRES_USER: vorpal
14
- POSTGRES_PASSWORD: pass
15
- POSTGRES_DB: vorpal_development
16
- restart: unless-stopped
17
-
18
- volumes:
19
- vorpal_postgres_volume: