containable 0.0.0 → 0.2.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: c4612ffe8feecbd919a8286e151409ed2cbbb2f3efb55b66ee3957782b84bcfd
4
- data.tar.gz: f1e571c55ca9d2220ddd6cef0aa3a51a51b6af8f70ce6b42ce3ddec857051014
3
+ metadata.gz: b1e298c787a7b1af3ec410a5a32d51ec1216746399332cbffc9d9001c83a6b47
4
+ data.tar.gz: b6f38a2cd98b8f5a4ee4b9878d24757caa79ce5bef706504123a77b69526af80
5
5
  SHA512:
6
- metadata.gz: cb282e4356aef70209655372b29494f63131d3c3491b7b50f4421b0ac269b9e5504411bc8e1d9fe5ca2ea787404f59b8c8a74aee836a6276bf1a3958d64196fc
7
- data.tar.gz: 58a76ad49b7b3ddc42f8002a378752d98b91e61520e0dc2caa6fb69405fb507684429b60299a8a9f65c461c0196fc7f20cb2b44f581308be18a037474933f561
6
+ metadata.gz: a9d282dd36d6062d4b38704170c0867148e86928f5d11a9c636ce6d703d4f9edc0ece5423a460659affc7e3958cfd2e00064563a9d45a10e51a2915dff4f97de
7
+ data.tar.gz: 5dc4a5db810937e870d6749893626593908f58fe0eba64b60edc8a17c436a7ccb736e7a59b310ff5a8a870132a63bccb2544c840941ee0e12caf47d325b4f280
checksums.yaml.gz.sig CHANGED
@@ -1,2 +1,2 @@
1
- ���K��+fK^К��S����ϚG��ͅ���xC[8KM���&�֭����}�D����T���٩��p��#�H��Ny|�Co���ؔ(t��u��O{��@H������0��f�\70���6>Mq-�ZJ4��z[a,B��H�=z;C 8�;n?�u4��('d͈��_R���2n��p
2
- 59��;eF��&q����%�+�E�}y"�a܃\���$���r���J53�`g��0[��L���v7�b�카K?[
1
+ /K��QKue �~En8و�?Cw4�1gS����� >�D�K��������!�{��=�;/>��>O�:L�Б.�IY.�d^X�ف=�f8f3�W/�b��з��U�S��X�o��dl݄�:^WA����%TQyM���H�BTn����u�����g�����9.��9���lj~�醠f5>�Gl̉�|�އ}��2
2
+ ��xb^XtU�>���*�-�#����q#b��h&�C �U���8i�VtPH�<��i/��lL�L���kȃ�a`*#�F<���E@�0En؟�?nB�V�E[zw�d��r�VzλXoXtc�~���yV��.�T��-g P<):�ت�#O�(����0����Uu��l
data/README.adoc CHANGED
@@ -32,7 +32,7 @@ To install _with_ security, run:
32
32
  [source,bash]
33
33
  ----
34
34
  # 💡 Skip this line if you already have the public certificate installed.
35
- gem cert --add <(curl --compressed --location https://alchemists.io/projects/containable/gems.pem)
35
+ gem cert --add <(curl --compressed --location https://alchemists.io/gems.pem)
36
36
  gem install containable --trust-policy HighSecurity
37
37
  ----
38
38
 
data/containable.gemspec CHANGED
@@ -2,11 +2,11 @@
2
2
 
3
3
  Gem::Specification.new do |spec|
4
4
  spec.name = "containable"
5
- spec.version = "0.0.0"
5
+ spec.version = "0.2.0"
6
6
  spec.authors = ["Brooke Kuhlmann"]
7
7
  spec.email = ["brooke@alchemists.io"]
8
8
  spec.homepage = "https://alchemists.io/projects/containable"
9
- spec.summary = "A thread-safe container for use with dependency injection."
9
+ spec.summary = "A thread-safe dependency injection container."
10
10
  spec.license = "Hippocratic-2.1"
11
11
 
12
12
  spec.metadata = {
@@ -4,7 +4,7 @@ require "concurrent/hash"
4
4
 
5
5
  module Containable
6
6
  # Provides safe registration and resolution of dependencies.
7
- class Vault < Module
7
+ class Builder < Module
8
8
  def initialize dependencies = Concurrent::Hash.new, register: Register, resolver: Resolver
9
9
  super()
10
10
 
@@ -16,6 +16,8 @@ module Containable
16
16
 
17
17
  alias_method :[]=, :register
18
18
  alias_method :[], :resolve
19
+
20
+ freeze
19
21
  end
20
22
 
21
23
  def extended descendant
@@ -3,7 +3,7 @@
3
3
  module Containable
4
4
  # Allows stubbing of dependencies for testing purposes only.
5
5
  module Test
6
- def resolve(key) = stubs.fetch(key.to_s) { super(key) }
6
+ def resolve(key) = stubs.fetch(key.to_s) { super }
7
7
 
8
8
  alias [] resolve
9
9
 
data/lib/containable.rb CHANGED
@@ -1,17 +1,17 @@
1
1
  # frozen_string_literal: true
2
2
 
3
+ require "containable/builder"
3
4
  require "containable/register"
4
5
  require "containable/resolver"
5
- require "containable/vault"
6
6
 
7
7
  # Main namespace.
8
8
  module Containable
9
9
  def self.extended descendant
10
10
  super
11
- descendant.extend Vault.new
11
+ descendant.extend Builder.new
12
12
  end
13
13
 
14
- def self.[](register: Register, resolver: Resolver) = Vault.new(register:, resolver:)
14
+ def self.[](register: Register, resolver: Resolver) = Builder.new(register:, resolver:)
15
15
 
16
16
  def stub!(**)
17
17
  require "containable/test"
data.tar.gz.sig CHANGED
Binary file
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: containable
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.0
4
+ version: 0.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Brooke Kuhlmann
@@ -35,7 +35,7 @@ cert_chain:
35
35
  3n5C8/6Zh9DYTkpcwPSuIfAga6wf4nXc9m6JAw8AuMLaiWN/r/2s4zJsUHYERJEu
36
36
  gZGm4JqtuSg8pYjPeIJxS960owq+SfuC+jxqmRA54BisFCv/0VOJi7tiJVY=
37
37
  -----END CERTIFICATE-----
38
- date: 2024-04-03 00:00:00.000000000 Z
38
+ date: 2024-05-31 00:00:00.000000000 Z
39
39
  dependencies:
40
40
  - !ruby/object:Gem::Dependency
41
41
  name: concurrent-ruby
@@ -64,10 +64,10 @@ files:
64
64
  - README.adoc
65
65
  - containable.gemspec
66
66
  - lib/containable.rb
67
+ - lib/containable/builder.rb
67
68
  - lib/containable/register.rb
68
69
  - lib/containable/resolver.rb
69
70
  - lib/containable/test.rb
70
- - lib/containable/vault.rb
71
71
  homepage: https://alchemists.io/projects/containable
72
72
  licenses:
73
73
  - Hippocratic-2.1
@@ -94,8 +94,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
94
94
  - !ruby/object:Gem::Version
95
95
  version: '0'
96
96
  requirements: []
97
- rubygems_version: 3.5.7
97
+ rubygems_version: 3.5.11
98
98
  signing_key:
99
99
  specification_version: 4
100
- summary: A thread-safe container for use with dependency injection.
100
+ summary: A thread-safe dependency injection container.
101
101
  test_files: []
metadata.gz.sig CHANGED
Binary file