dry-auto_inject 0.9.0 → 1.0.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: fbf423b57383e30d33060a0d0566ca2c9d9c451289f38132974325e5d7cdc2b8
4
- data.tar.gz: a35a4d23402b9b5a1b47de1c953c0e089e646334c1ffffcaa4c320539d8eeecd
3
+ metadata.gz: d360da0539f06319e2e74cd1d24dc8b5cf946a0390f0257e41e4d8f6dbf91540
4
+ data.tar.gz: 5d095923d9dfd059a58b91af09c7afe7047ed69b7c8f3dee3f6055073da7d0ed
5
5
  SHA512:
6
- metadata.gz: 561d57d6c0aae98c94a6c6121dcd47601178fe37ce3c6077d87f28b85f4da7113112a66efba4c091f50dcbc1983212d2212abacf175845a212064cdbe340a389
7
- data.tar.gz: 942e8def2974a6d131180ab66e1895ff2104ba960372513edea233598bb65ca52c612f359fcd33a43f698593aad288aa9012b75e29072c8d35e0a3af0bde87ae
6
+ metadata.gz: eeacadf98f186011fd02faa49b353a290158cbb815b1b4bf6b9f41154fa0041dc08c4c4cf6e903ef8ca2b8c99467aecc02c2b3f3fcb3cdb4b9683ad90d72808f
7
+ data.tar.gz: d3370290dc82a3dcf1ff95489c0ab91f6813847e55158f1729a664a4644c3fb81643e9e89527f5c9265f090733f6f5ae044b1d3662b020c4b51363cc1caac762
data/CHANGELOG.md CHANGED
@@ -1,5 +1,15 @@
1
1
  <!--- DO NOT EDIT THIS FILE - IT'S AUTOMATICALLY GENERATED VIA DEVTOOLS --->
2
2
 
3
+ ## 1.0.0 2022-11-18
4
+
5
+
6
+ ### Changed
7
+
8
+ - This version is compatible with recently released dry-rb dependencies (@flash-gordon)
9
+ - This version uses zeitwerk for autoloading (@flash-gordon)
10
+
11
+ [Compare v0.9.0...v1.0.0](https://github.com/dry-rb/dry-auto_inject/compare/v0.9.0...v1.0.0)
12
+
3
13
  ## 0.9.0 2022-01-26
4
14
 
5
15
 
data/LICENSE CHANGED
@@ -1,6 +1,6 @@
1
1
  The MIT License (MIT)
2
2
 
3
- Copyright (c) 2015-2021 dry-rb team
3
+ Copyright (c) 2015-2022 dry-rb team
4
4
 
5
5
  Permission is hereby granted, free of charge, to any person obtaining a copy of
6
6
  this software and associated documentation files (the "Software"), to deal in
data/README.md CHANGED
@@ -11,7 +11,7 @@
11
11
  [![CI Status](https://github.com/dry-rb/dry-auto_inject/workflows/ci/badge.svg)][actions]
12
12
  [![Codacy Badge](https://api.codacy.com/project/badge/Grade/d869ec8dc92e46b6a6eafa551f68c3f4)][codacy]
13
13
  [![Codacy Badge](https://api.codacy.com/project/badge/Coverage/d869ec8dc92e46b6a6eafa551f68c3f4)][codacy]
14
- [![Inline docs](http://inch-ci.org/github/dry-rb/dry-auto_inject.svg?branch=master)][inchpages]
14
+ [![Inline docs](http://inch-ci.org/github/dry-rb/dry-auto_inject.svg?branch=main)][inchpages]
15
15
 
16
16
  ## Links
17
17
 
@@ -22,14 +22,15 @@ Gem::Specification.new do |spec|
22
22
  spec.require_paths = ["lib"]
23
23
 
24
24
  spec.metadata["allowed_push_host"] = "https://rubygems.org"
25
- spec.metadata["changelog_uri"] = "https://github.com/dry-rb/dry-auto_inject/blob/master/CHANGELOG.md"
25
+ spec.metadata["changelog_uri"] = "https://github.com/dry-rb/dry-auto_inject/blob/main/CHANGELOG.md"
26
26
  spec.metadata["source_code_uri"] = "https://github.com/dry-rb/dry-auto_inject"
27
27
  spec.metadata["bug_tracker_uri"] = "https://github.com/dry-rb/dry-auto_inject/issues"
28
28
 
29
29
  spec.required_ruby_version = ">= 2.7.0"
30
30
 
31
31
  # to update dependencies edit project.yml
32
- spec.add_runtime_dependency "dry-container", ">= 0.3.4"
32
+ spec.add_runtime_dependency "dry-core", "~> 1.0", "< 2"
33
+ spec.add_runtime_dependency "zeitwerk", "~> 2.6"
33
34
 
34
35
  spec.add_development_dependency "bundler"
35
36
  spec.add_development_dependency "rake"
@@ -1,8 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require "dry/auto_inject/strategies"
4
- require "dry/auto_inject/injector"
5
-
6
3
  module Dry
7
4
  module AutoInject
8
5
  class Builder
@@ -1,8 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require "dry/auto_inject/strategies/constructor"
4
- require "dry/auto_inject/method_parameters"
5
-
6
3
  module Dry
7
4
  module AutoInject
8
5
  class Strategies
@@ -68,8 +65,6 @@ module Dry
68
65
  RUBY
69
66
  end
70
67
  end
71
-
72
- register :args, Args
73
68
  end
74
69
  end
75
70
  end
@@ -1,13 +1,11 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require "dry/auto_inject/dependency_map"
4
-
5
3
  module Dry
6
4
  module AutoInject
7
5
  class Strategies
8
- class Constructor < Module
9
- ClassMethods = Class.new(Module)
10
- InstanceMethods = Class.new(Module)
6
+ class Constructor < ::Module
7
+ ClassMethods = ::Class.new(::Module)
8
+ InstanceMethods = ::Class.new(::Module)
11
9
 
12
10
  attr_reader :container
13
11
  attr_reader :dependency_map
@@ -1,8 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require "dry/auto_inject/strategies/constructor"
4
- require "dry/auto_inject/method_parameters"
5
-
6
3
  module Dry
7
4
  module AutoInject
8
5
  class Strategies
@@ -44,8 +41,6 @@ module Dry
44
41
  RUBY
45
42
  end
46
43
  end
47
-
48
- register :hash, Hash
49
44
  end
50
45
  end
51
46
  end
@@ -1,8 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require "dry/auto_inject/strategies/constructor"
4
- require "dry/auto_inject/method_parameters"
5
-
6
3
  module Dry
7
4
  module AutoInject
8
5
  class Strategies
@@ -99,8 +96,6 @@ module Dry
99
96
  end
100
97
  end
101
98
  end
102
-
103
- register_default :kwargs, Kwargs
104
99
  end
105
100
  end
106
101
  end
@@ -1,21 +1,19 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require "dry-container"
4
-
5
3
  module Dry
6
4
  module AutoInject
7
5
  class Strategies
8
- extend Dry::Container::Mixin
6
+ extend Core::Container::Mixin
9
7
 
10
8
  # @api public
11
9
  def self.register_default(name, strategy)
12
10
  register name, strategy
13
11
  register :default, strategy
14
12
  end
13
+
14
+ register :args, proc { Args }
15
+ register :hash, proc { Strategies::Hash }
16
+ register_default :kwargs, proc { Kwargs }
15
17
  end
16
18
  end
17
19
  end
18
-
19
- require "dry/auto_inject/strategies/args"
20
- require "dry/auto_inject/strategies/hash"
21
- require "dry/auto_inject/strategies/kwargs"
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Dry
4
4
  module AutoInject
5
- VERSION = "0.9.0"
5
+ VERSION = "1.0.0"
6
6
  end
7
7
  end
@@ -1,14 +1,32 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require "dry/auto_inject/builder"
3
+ require "zeitwerk"
4
+ require "dry/core"
4
5
 
5
6
  module Dry
7
+ module AutoInject
8
+ def self.loader
9
+ @loader ||= Zeitwerk::Loader.new.tap do |loader|
10
+ root = File.expand_path("..", __dir__)
11
+ loader.tag = "dry-auto_inject"
12
+ loader.inflector = Zeitwerk::GemInflector.new("#{root}/dry-auto_inject.rb")
13
+ loader.push_dir(root)
14
+ loader.ignore(
15
+ "#{root}/dry-auto_inject.rb",
16
+ "#{root}/dry/auto_inject/version.rb"
17
+ )
18
+ end
19
+ end
20
+
21
+ loader.setup
22
+ end
23
+
6
24
  # Configure an auto-injection module
7
25
  #
8
26
  # @example
9
27
  # module MyApp
10
28
  # # set up your container
11
- # container = Dry::Container.new
29
+ # container = Dry::Core::Container.new
12
30
  #
13
31
  # container.register(:data_store, -> { DataStore.new })
14
32
  # container.register(:user_repository, -> { container[:data_store][:users] })
metadata CHANGED
@@ -1,29 +1,49 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: dry-auto_inject
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.9.0
4
+ version: 1.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Piotr Solnica
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-01-26 00:00:00.000000000 Z
11
+ date: 2022-11-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
- name: dry-container
14
+ name: dry-core
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - ">="
17
+ - - "~>"
18
+ - !ruby/object:Gem::Version
19
+ version: '1.0'
20
+ - - "<"
18
21
  - !ruby/object:Gem::Version
19
- version: 0.3.4
22
+ version: '2'
20
23
  type: :runtime
21
24
  prerelease: false
22
25
  version_requirements: !ruby/object:Gem::Requirement
23
26
  requirements:
24
- - - ">="
27
+ - - "~>"
28
+ - !ruby/object:Gem::Version
29
+ version: '1.0'
30
+ - - "<"
31
+ - !ruby/object:Gem::Version
32
+ version: '2'
33
+ - !ruby/object:Gem::Dependency
34
+ name: zeitwerk
35
+ requirement: !ruby/object:Gem::Requirement
36
+ requirements:
37
+ - - "~>"
38
+ - !ruby/object:Gem::Version
39
+ version: '2.6'
40
+ type: :runtime
41
+ prerelease: false
42
+ version_requirements: !ruby/object:Gem::Requirement
43
+ requirements:
44
+ - - "~>"
25
45
  - !ruby/object:Gem::Version
26
- version: 0.3.4
46
+ version: '2.6'
27
47
  - !ruby/object:Gem::Dependency
28
48
  name: bundler
29
49
  requirement: !ruby/object:Gem::Requirement
@@ -94,7 +114,7 @@ licenses:
94
114
  - MIT
95
115
  metadata:
96
116
  allowed_push_host: https://rubygems.org
97
- changelog_uri: https://github.com/dry-rb/dry-auto_inject/blob/master/CHANGELOG.md
117
+ changelog_uri: https://github.com/dry-rb/dry-auto_inject/blob/main/CHANGELOG.md
98
118
  source_code_uri: https://github.com/dry-rb/dry-auto_inject
99
119
  bug_tracker_uri: https://github.com/dry-rb/dry-auto_inject/issues
100
120
  post_install_message: