dry-auto_inject 0.9.0 → 1.0.0.rc1

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: daff2a53b3de2a3419386d02569f43e6050c0c82553bafbe610c3d1baf51dc05
4
+ data.tar.gz: 496c832c754bd1e40e0fe993314f4bc02822827e764159dedc60deb4fb7d4a0e
5
5
  SHA512:
6
- metadata.gz: 561d57d6c0aae98c94a6c6121dcd47601178fe37ce3c6077d87f28b85f4da7113112a66efba4c091f50dcbc1983212d2212abacf175845a212064cdbe340a389
7
- data.tar.gz: 942e8def2974a6d131180ab66e1895ff2104ba960372513edea233598bb65ca52c612f359fcd33a43f698593aad288aa9012b75e29072c8d35e0a3af0bde87ae
6
+ metadata.gz: 83fc8dad8b499b8e527db3be8c06dccc59e316ca3e5bf64f547c3cc39e963abce68a6c7beba60df4910dbac56ed08f65512f5e97de84d862b28737e35d4ec9e4
7
+ data.tar.gz: a140f5e006556858e5197f85451210eb7b7bfbd50a4732f4bfb955edce1d83c3f8f84af84849c81efd86e2e0a63b7559578e75f40e57f8e1751bbd879d21559e
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
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...main](https://github.com/dry-rb/dry-auto_inject/compare/v0.9.0...main)
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.rc1"
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.rc1
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-04 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
+ - - "~>"
25
38
  - !ruby/object:Gem::Version
26
- version: 0.3.4
39
+ version: '2.6'
40
+ type: :runtime
41
+ prerelease: false
42
+ version_requirements: !ruby/object:Gem::Requirement
43
+ requirements:
44
+ - - "~>"
45
+ - !ruby/object:Gem::Version
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:
@@ -108,9 +128,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
108
128
  version: 2.7.0
109
129
  required_rubygems_version: !ruby/object:Gem::Requirement
110
130
  requirements:
111
- - - ">="
131
+ - - ">"
112
132
  - !ruby/object:Gem::Version
113
- version: '0'
133
+ version: 1.3.1
114
134
  requirements: []
115
135
  rubygems_version: 3.1.6
116
136
  signing_key: