unity-dependency-container 1.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/CHANGELOG.md +5 -0
- data/Gemfile +8 -0
- data/Gemfile.lock +19 -0
- data/README.md +35 -0
- data/Rakefile +4 -0
- data/bin/console +15 -0
- data/bin/setup +8 -0
- data/lib/unity/dependency_container/version.rb +7 -0
- data/lib/unity/dependency_container.rb +25 -0
- data/lib/unity-dependency-container.rb +1 -0
- metadata +56 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 2ebccc95a98e2bb957d09819d66793e2a84aba0f29f6ba6a6173abbb8a9cf85c
|
4
|
+
data.tar.gz: b77f544d0f1fc4317761b5ccb913d5a0695b011645301c937b336430c47cccb0
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 10ae97b11f95e14207a1ebd551e01016dab0f4646b8ff8052239a856f05e933e4a9414ed6c01b39a51e412fda8c73fd0e120c40f0d19ed8a4e21dd6c7eb6e765
|
7
|
+
data.tar.gz: b1ea601ca9bcace408908202827c0b07d95f9474dade8436d5efa81503aed7c8de3b87267171ff30fb5ad94871a13945f11edac90b122afde4500c6bda2e87ca
|
data/CHANGELOG.md
ADDED
data/Gemfile
ADDED
data/Gemfile.lock
ADDED
@@ -0,0 +1,19 @@
|
|
1
|
+
PATH
|
2
|
+
remote: .
|
3
|
+
specs:
|
4
|
+
unity-dependency-container (1.0.0)
|
5
|
+
|
6
|
+
GEM
|
7
|
+
remote: https://rubygems.org/
|
8
|
+
specs:
|
9
|
+
rake (13.0.6)
|
10
|
+
|
11
|
+
PLATFORMS
|
12
|
+
x86_64-darwin-20
|
13
|
+
|
14
|
+
DEPENDENCIES
|
15
|
+
rake (~> 13.0)
|
16
|
+
unity-dependency-container!
|
17
|
+
|
18
|
+
BUNDLED WITH
|
19
|
+
2.2.30
|
data/README.md
ADDED
@@ -0,0 +1,35 @@
|
|
1
|
+
# Unity::DependencyContainer
|
2
|
+
|
3
|
+
Welcome to your new gem! In this directory, you'll find the files you need to be able to package up your Ruby library into a gem. Put your Ruby code in the file `lib/unity/dependency_container`. To experiment with that code, run `bin/console` for an interactive prompt.
|
4
|
+
|
5
|
+
TODO: Delete this and the text above, and describe your gem
|
6
|
+
|
7
|
+
## Installation
|
8
|
+
|
9
|
+
Add this line to your application's Gemfile:
|
10
|
+
|
11
|
+
```ruby
|
12
|
+
gem 'unity-dependency-container'
|
13
|
+
```
|
14
|
+
|
15
|
+
And then execute:
|
16
|
+
|
17
|
+
$ bundle install
|
18
|
+
|
19
|
+
Or install it yourself as:
|
20
|
+
|
21
|
+
$ gem install unity-dependency-container
|
22
|
+
|
23
|
+
## Usage
|
24
|
+
|
25
|
+
TODO: Write usage instructions here
|
26
|
+
|
27
|
+
## Development
|
28
|
+
|
29
|
+
After checking out the repo, run `bin/setup` to install dependencies. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
|
30
|
+
|
31
|
+
To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and the created tag, and push the `.gem` file to [rubygems.org](https://rubygems.org).
|
32
|
+
|
33
|
+
## Contributing
|
34
|
+
|
35
|
+
Bug reports and pull requests are welcome on GitHub at https://github.com/[USERNAME]/unity-dependency-container.
|
data/Rakefile
ADDED
data/bin/console
ADDED
@@ -0,0 +1,15 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
# frozen_string_literal: true
|
3
|
+
|
4
|
+
require "bundler/setup"
|
5
|
+
require "unity/dependency_container"
|
6
|
+
|
7
|
+
# You can add fixtures and/or initialization code here to make experimenting
|
8
|
+
# with your gem easier. You can also use a different console, if you like.
|
9
|
+
|
10
|
+
# (If you use this, don't forget to add pry to your Gemfile!)
|
11
|
+
# require "pry"
|
12
|
+
# Pry.start
|
13
|
+
|
14
|
+
require "irb"
|
15
|
+
IRB.start(__FILE__)
|
data/bin/setup
ADDED
@@ -0,0 +1,25 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require_relative "dependency_container/version"
|
4
|
+
|
5
|
+
module Unity
|
6
|
+
module DependencyContainer
|
7
|
+
class Error < StandardError; end
|
8
|
+
|
9
|
+
def di_container_repository
|
10
|
+
@di_container_repository ||= {}
|
11
|
+
end
|
12
|
+
|
13
|
+
def di_instances
|
14
|
+
@di_instances ||= {}
|
15
|
+
end
|
16
|
+
|
17
|
+
def di(name)
|
18
|
+
di_instances[name] ||= di_container_repository[name].call
|
19
|
+
end
|
20
|
+
|
21
|
+
def dependency(name, &block)
|
22
|
+
di_container_repository[name] = block
|
23
|
+
end
|
24
|
+
end
|
25
|
+
end
|
@@ -0,0 +1 @@
|
|
1
|
+
require 'unity/dependency_container'
|
metadata
ADDED
@@ -0,0 +1,56 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: unity-dependency-container
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 1.0.0
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- saluzafa
|
8
|
+
autorequire:
|
9
|
+
bindir: exe
|
10
|
+
cert_chain: []
|
11
|
+
date: 2022-03-15 00:00:00.000000000 Z
|
12
|
+
dependencies: []
|
13
|
+
description: Extend module/class abilities to provide dependencies container/injection
|
14
|
+
email:
|
15
|
+
- julien@pocketsizesun.com
|
16
|
+
executables: []
|
17
|
+
extensions: []
|
18
|
+
extra_rdoc_files: []
|
19
|
+
files:
|
20
|
+
- CHANGELOG.md
|
21
|
+
- Gemfile
|
22
|
+
- Gemfile.lock
|
23
|
+
- README.md
|
24
|
+
- Rakefile
|
25
|
+
- bin/console
|
26
|
+
- bin/setup
|
27
|
+
- lib/unity-dependency-container.rb
|
28
|
+
- lib/unity/dependency_container.rb
|
29
|
+
- lib/unity/dependency_container/version.rb
|
30
|
+
homepage: https://github.com/pocketsizesun/unity-dependency-container
|
31
|
+
licenses: []
|
32
|
+
metadata:
|
33
|
+
allowed_push_host: https://rubygems.org
|
34
|
+
homepage_uri: https://github.com/pocketsizesun/unity-dependency-container
|
35
|
+
source_code_uri: https://github.com/pocketsizesun/unity-dependency-container
|
36
|
+
changelog_uri: https://github.com/pocketsizesun/unity-dependency-container
|
37
|
+
post_install_message:
|
38
|
+
rdoc_options: []
|
39
|
+
require_paths:
|
40
|
+
- lib
|
41
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
42
|
+
requirements:
|
43
|
+
- - ">="
|
44
|
+
- !ruby/object:Gem::Version
|
45
|
+
version: 2.6.0
|
46
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
47
|
+
requirements:
|
48
|
+
- - ">="
|
49
|
+
- !ruby/object:Gem::Version
|
50
|
+
version: '0'
|
51
|
+
requirements: []
|
52
|
+
rubygems_version: 3.2.3
|
53
|
+
signing_key:
|
54
|
+
specification_version: 4
|
55
|
+
summary: Unity - Dependencies container utility
|
56
|
+
test_files: []
|