dry-system 0.7.3 → 0.8.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +17 -0
- data/lib/dry/system.rb +24 -0
- data/lib/dry/system/booter.rb +75 -43
- data/lib/dry/system/booter/component_registry.rb +37 -0
- data/lib/dry/system/component.rb +9 -4
- data/lib/dry/system/components.rb +6 -0
- data/lib/dry/system/components/bootable.rb +307 -0
- data/lib/dry/system/components/config.rb +33 -0
- data/lib/dry/system/constants.rb +2 -0
- data/lib/dry/system/container.rb +69 -22
- data/lib/dry/system/errors.rb +2 -2
- data/lib/dry/system/lifecycle.rb +40 -7
- data/lib/dry/system/provider.rb +46 -0
- data/lib/dry/system/provider_registry.rb +25 -0
- data/lib/dry/system/settings.rb +59 -0
- data/lib/dry/system/settings/file_loader.rb +28 -0
- data/lib/dry/system/settings/file_parser.rb +49 -0
- data/lib/dry/system/system_components/settings.rb +9 -0
- data/lib/dry/system/version.rb +1 -1
- metadata +27 -144
- data/.gitignore +0 -39
- data/.rspec +0 -3
- data/.travis.yml +0 -22
- data/.yardopts +0 -5
- data/CONTRIBUTING.md +0 -29
- data/Gemfile +0 -9
- data/Rakefile +0 -12
- data/dry-system.gemspec +0 -31
- data/examples/custom_configuration_auto_register/Gemfile +0 -5
- data/examples/custom_configuration_auto_register/lib/entities/user.rb +0 -7
- data/examples/custom_configuration_auto_register/lib/user_repo.rb +0 -5
- data/examples/custom_configuration_auto_register/run.rb +0 -8
- data/examples/custom_configuration_auto_register/system/boot/persistence.rb +0 -13
- data/examples/custom_configuration_auto_register/system/container.rb +0 -16
- data/examples/custom_configuration_auto_register/system/import.rb +0 -3
- data/examples/standalone/Gemfile +0 -5
- data/examples/standalone/lib/user_repo.rb +0 -5
- data/examples/standalone/run.rb +0 -8
- data/examples/standalone/system/boot/persistence.rb +0 -13
- data/examples/standalone/system/container.rb +0 -9
- data/examples/standalone/system/import.rb +0 -3
- data/spec/fixtures/components/bar.rb +0 -5
- data/spec/fixtures/components/bar/baz.rb +0 -4
- data/spec/fixtures/components/foo.rb +0 -2
- data/spec/fixtures/components/no_register.rb +0 -4
- data/spec/fixtures/import_test/config/application.yml +0 -2
- data/spec/fixtures/import_test/lib/test/bar.rb +0 -4
- data/spec/fixtures/import_test/lib/test/foo.rb +0 -5
- data/spec/fixtures/import_test/system/boot/bar.rb +0 -11
- data/spec/fixtures/lazytest/config/application.yml +0 -2
- data/spec/fixtures/lazytest/lib/test/dep.rb +0 -4
- data/spec/fixtures/lazytest/lib/test/foo.rb +0 -5
- data/spec/fixtures/lazytest/lib/test/models.rb +0 -4
- data/spec/fixtures/lazytest/lib/test/models/book.rb +0 -6
- data/spec/fixtures/lazytest/lib/test/models/user.rb +0 -6
- data/spec/fixtures/lazytest/system/boot/bar.rb +0 -15
- data/spec/fixtures/magic_comments/comments.rb +0 -17
- data/spec/fixtures/manual_registration/container/foo.rb +0 -6
- data/spec/fixtures/manual_registration/lib/test/foo.rb +0 -9
- data/spec/fixtures/multiple_namespaced_components/multiple/level/baz.rb +0 -7
- data/spec/fixtures/multiple_namespaced_components/multiple/level/foz.rb +0 -6
- data/spec/fixtures/namespaced_components/namespaced/bar.rb +0 -5
- data/spec/fixtures/namespaced_components/namespaced/foo.rb +0 -4
- data/spec/fixtures/other/config/boot/bar.rb +0 -11
- data/spec/fixtures/other/config/boot/hell.rb +0 -3
- data/spec/fixtures/other/lib/test/dep.rb +0 -4
- data/spec/fixtures/other/lib/test/foo.rb +0 -5
- data/spec/fixtures/other/lib/test/models.rb +0 -4
- data/spec/fixtures/other/lib/test/models/book.rb +0 -6
- data/spec/fixtures/other/lib/test/models/user.rb +0 -6
- data/spec/fixtures/stubbing/lib/test/car.rb +0 -7
- data/spec/fixtures/stubbing/system/boot/db.rb +0 -8
- data/spec/fixtures/test/config/application.yml +0 -2
- data/spec/fixtures/test/config/subapp.yml +0 -2
- data/spec/fixtures/test/lib/test/dep.rb +0 -4
- data/spec/fixtures/test/lib/test/foo.rb +0 -5
- data/spec/fixtures/test/lib/test/models.rb +0 -4
- data/spec/fixtures/test/lib/test/models/book.rb +0 -6
- data/spec/fixtures/test/lib/test/models/user.rb +0 -6
- data/spec/fixtures/test/lib/test/singleton_dep.rb +0 -7
- data/spec/fixtures/test/log/.gitkeep +0 -0
- data/spec/fixtures/test/system/boot/bar.rb +0 -11
- data/spec/fixtures/test/system/boot/client.rb +0 -7
- data/spec/fixtures/test/system/boot/db.rb +0 -1
- data/spec/fixtures/test/system/boot/hell.rb +0 -3
- data/spec/fixtures/test/system/boot/logger.rb +0 -5
- data/spec/fixtures/umbrella/system/boot/db.rb +0 -10
- data/spec/integration/boot_spec.rb +0 -18
- data/spec/integration/container/lazy_loading/manual_registration_spec.rb +0 -18
- data/spec/integration/import_spec.rb +0 -81
- data/spec/spec_helper.rb +0 -48
- data/spec/unit/auto_registrar/configuration_spec.rb +0 -26
- data/spec/unit/component_spec.rb +0 -121
- data/spec/unit/container/auto_register_spec.rb +0 -113
- data/spec/unit/container/config_spec.rb +0 -38
- data/spec/unit/container/finalize_spec.rb +0 -97
- data/spec/unit/container/import_spec.rb +0 -53
- data/spec/unit/container/injector_spec.rb +0 -29
- data/spec/unit/container_spec.rb +0 -244
- data/spec/unit/loader_spec.rb +0 -64
- data/spec/unit/magic_comments_parser_spec.rb +0 -41
data/dry-system.gemspec
DELETED
@@ -1,31 +0,0 @@
|
|
1
|
-
# coding: utf-8
|
2
|
-
require File.expand_path('../lib/dry/system/version', __FILE__)
|
3
|
-
|
4
|
-
Gem::Specification.new do |spec|
|
5
|
-
spec.name = 'dry-system'
|
6
|
-
spec.version = Dry::System::VERSION
|
7
|
-
spec.authors = ['Piotr Solnica']
|
8
|
-
spec.email = ['piotr.solnica@gmail.com']
|
9
|
-
spec.summary = 'Organize your code into reusable components'
|
10
|
-
spec.homepage = 'http://dry-rb.org/gems/dry-system'
|
11
|
-
spec.license = 'MIT'
|
12
|
-
|
13
|
-
spec.files = `git ls-files -z`.split("\x0")
|
14
|
-
spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
|
15
|
-
spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
|
16
|
-
spec.require_paths = ['lib']
|
17
|
-
|
18
|
-
spec.required_ruby_version = '>= 2.1.0'
|
19
|
-
|
20
|
-
spec.add_runtime_dependency 'inflecto', '>= 0.0.2'
|
21
|
-
spec.add_runtime_dependency 'concurrent-ruby', '~> 1.0'
|
22
|
-
spec.add_runtime_dependency 'dry-core', '>= 0.3.1'
|
23
|
-
spec.add_runtime_dependency 'dry-equalizer', '~> 0.2'
|
24
|
-
spec.add_runtime_dependency 'dry-container', '~> 0.6'
|
25
|
-
spec.add_runtime_dependency 'dry-auto_inject', '>= 0.4.0'
|
26
|
-
spec.add_runtime_dependency 'dry-configurable', '~> 0.7', '>= 0.7.0'
|
27
|
-
|
28
|
-
spec.add_development_dependency 'bundler'
|
29
|
-
spec.add_development_dependency 'rake'
|
30
|
-
spec.add_development_dependency 'rspec'
|
31
|
-
end
|
@@ -1,16 +0,0 @@
|
|
1
|
-
require 'dry/system/container'
|
2
|
-
|
3
|
-
class App < Dry::System::Container
|
4
|
-
load_paths!('lib', 'system')
|
5
|
-
|
6
|
-
auto_register!('lib') do |config|
|
7
|
-
config.instance do |component|
|
8
|
-
# some custom initialization logic
|
9
|
-
component.instance
|
10
|
-
end
|
11
|
-
|
12
|
-
config.exclude do |component|
|
13
|
-
component.path =~ /entities/
|
14
|
-
end
|
15
|
-
end
|
16
|
-
end
|
data/examples/standalone/Gemfile
DELETED
data/examples/standalone/run.rb
DELETED
@@ -1,17 +0,0 @@
|
|
1
|
-
#!/usr/bin/env ruby
|
2
|
-
|
3
|
-
# This is a file with a mix of valid and invalid magic comments
|
4
|
-
|
5
|
-
# valid_comment: hello
|
6
|
-
# true_comment: true
|
7
|
-
# false_comment: false
|
8
|
-
# comment_123: alpha-numeric and underscores allowed
|
9
|
-
# 123_will_not_match: will not match
|
10
|
-
# not-using-underscores: value for comment using dashes
|
11
|
-
|
12
|
-
# not_at_start_of_line: will not match
|
13
|
-
|
14
|
-
module Test
|
15
|
-
end
|
16
|
-
|
17
|
-
# after_code: will not match
|