injectable 2.1.5 → 3.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.github/workflows/rspec.yml +3 -3
- data/.github/workflows/rubocop.yml +2 -3
- data/.github/workflows/simpelcov.yml +2 -3
- data/.rubocop.yml +1 -1
- data/.rubocop_todo.yml +3 -18
- data/.ruby-version +1 -1
- data/.simplecov +14 -0
- data/CHANGELOG.md +14 -1
- data/Gemfile +9 -0
- data/Gemfile.lock +58 -51
- data/injectable.gemspec +1 -10
- data/lib/injectable/class_methods.rb +15 -11
- data/lib/injectable/dependencies_proxy.rb +1 -1
- data/lib/injectable/dependency.rb +1 -1
- data/lib/injectable/instance_methods.rb +1 -1
- data/lib/injectable/version.rb +1 -1
- metadata +5 -116
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: e3e5aa25b9958c6fec84662a80c146b15f1c61a28a539b36f5c620033a851dbf
|
|
4
|
+
data.tar.gz: acb557a02dcb360468bfc065810256ab7f61332c7b3cc2338d4c31818fac0bb8
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: f0e3548423a92e1f2490a59cbb86bb4b0adfc156689172f4fc874d5ae555c8f69efced4c997ed608539a4bca95c668a7ba738baa1c7ea878bfd829fef2eefae1
|
|
7
|
+
data.tar.gz: 474f835133e779f947a9a99a255828d5021c78e7e0f0584f27bf14079ae4039505333ea411cd1989b3592eb7169266cea95e024a0cd816a02d6a907dfab9fe5e
|
data/.github/workflows/rspec.yml
CHANGED
|
@@ -12,11 +12,11 @@ jobs:
|
|
|
12
12
|
strategy:
|
|
13
13
|
fail-fast: false
|
|
14
14
|
matrix:
|
|
15
|
-
ruby: ['3.
|
|
15
|
+
ruby: ['3.3.11', '3.4.9', '4.0.3']
|
|
16
16
|
steps:
|
|
17
|
-
- uses: actions/checkout@
|
|
17
|
+
- uses: actions/checkout@v6.0.2
|
|
18
18
|
- name: Set up Ruby ${{ matrix.ruby }}
|
|
19
|
-
uses: ruby/setup-ruby@v1
|
|
19
|
+
uses: ruby/setup-ruby@v1.305.0
|
|
20
20
|
with:
|
|
21
21
|
ruby-version: ${{ matrix.ruby }}
|
|
22
22
|
bundler-cache: true # runs 'bundle install' and caches installed gems automatically
|
|
@@ -14,10 +14,9 @@ jobs:
|
|
|
14
14
|
name: runner / rubocop
|
|
15
15
|
runs-on: ubuntu-latest
|
|
16
16
|
steps:
|
|
17
|
-
- uses: actions/checkout@
|
|
18
|
-
- uses: ruby/setup-ruby@v1
|
|
17
|
+
- uses: actions/checkout@v6.0.2
|
|
18
|
+
- uses: ruby/setup-ruby@v1.305.0
|
|
19
19
|
with:
|
|
20
|
-
ruby-version: '3.4'
|
|
21
20
|
bundler-cache: true
|
|
22
21
|
- uses: reviewdog/action-rubocop@v2
|
|
23
22
|
with:
|
|
@@ -12,11 +12,10 @@ jobs:
|
|
|
12
12
|
code_coverage:
|
|
13
13
|
runs-on: ubuntu-latest
|
|
14
14
|
steps:
|
|
15
|
-
- uses: actions/checkout@
|
|
15
|
+
- uses: actions/checkout@v6.0.2
|
|
16
16
|
- name: Set up Ruby
|
|
17
|
-
uses: ruby/setup-ruby@v1
|
|
17
|
+
uses: ruby/setup-ruby@v1.305.0
|
|
18
18
|
with:
|
|
19
|
-
ruby-version: 3.4.7
|
|
20
19
|
bundler-cache: true # runs 'bundle install' and caches installed gems automatically
|
|
21
20
|
- name: Build and test with Rake
|
|
22
21
|
run: COVERAGE=true bundle exec rake
|
data/.rubocop.yml
CHANGED
data/.rubocop_todo.yml
CHANGED
|
@@ -1,26 +1,11 @@
|
|
|
1
1
|
# This configuration was generated by
|
|
2
2
|
# `rubocop --auto-gen-config`
|
|
3
|
-
# on
|
|
3
|
+
# on 2026-01-10 12:23:26 UTC using RuboCop version 1.82.1.
|
|
4
4
|
# The point is for the user to remove these configuration records
|
|
5
5
|
# one by one as the offenses are removed from the code base.
|
|
6
6
|
# Note that changes in the inspected code, or installation of new
|
|
7
7
|
# versions of RuboCop, may require this file to be generated again.
|
|
8
8
|
|
|
9
|
-
# Offense count: 6
|
|
10
|
-
# Configuration parameters: EnforcedStyle, AllowedGems, Include.
|
|
11
|
-
# SupportedStyles: Gemfile, gems.rb, gemspec
|
|
12
|
-
# Include: **/*.gemspec, **/Gemfile, **/gems.rb
|
|
13
|
-
Gemspec/DevelopmentDependencies:
|
|
14
|
-
Exclude:
|
|
15
|
-
- 'injectable.gemspec'
|
|
16
|
-
|
|
17
|
-
# Offense count: 1
|
|
18
|
-
# Configuration parameters: Severity, Include.
|
|
19
|
-
# Include: **/*.gemspec
|
|
20
|
-
Gemspec/RequiredRubyVersion:
|
|
21
|
-
Exclude:
|
|
22
|
-
- 'injectable.gemspec'
|
|
23
|
-
|
|
24
9
|
# Offense count: 4
|
|
25
10
|
# Configuration parameters: AllowedMethods.
|
|
26
11
|
# AllowedMethods: enums
|
|
@@ -104,8 +89,8 @@ RSpec/NamedSubject:
|
|
|
104
89
|
- 'spec/injectable_spec.rb'
|
|
105
90
|
|
|
106
91
|
# Offense count: 3
|
|
107
|
-
# Configuration parameters:
|
|
108
|
-
#
|
|
92
|
+
# Configuration parameters: CustomTransform, IgnoreMethods, IgnoreMetadata, InflectorPath, EnforcedInflector.
|
|
93
|
+
# SupportedInflectors: default, active_support
|
|
109
94
|
RSpec/SpecFilePathFormat:
|
|
110
95
|
Exclude:
|
|
111
96
|
- '**/spec/routing/**/*'
|
data/.ruby-version
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
4.0.3
|
data/.simplecov
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
require 'simplecov-json'
|
|
2
|
+
|
|
3
|
+
SimpleCov.formatters = SimpleCov::Formatter::MultiFormatter.new(
|
|
4
|
+
[
|
|
5
|
+
SimpleCov::Formatter::HTMLFormatter,
|
|
6
|
+
SimpleCov::Formatter::JSONFormatter
|
|
7
|
+
]
|
|
8
|
+
)
|
|
9
|
+
|
|
10
|
+
SimpleCov.start do
|
|
11
|
+
enable_coverage(:branch)
|
|
12
|
+
|
|
13
|
+
load_profile 'test_frameworks'
|
|
14
|
+
end
|
data/CHANGELOG.md
CHANGED
|
@@ -1,6 +1,19 @@
|
|
|
1
1
|
# Unreleased
|
|
2
2
|
|
|
3
|
-
##
|
|
3
|
+
## 3.0.0 - 2026-04-25
|
|
4
|
+
|
|
5
|
+
* adds Ruby 4.0.3 to support matrix
|
|
6
|
+
* drops EOL'ed Ruby 3.2
|
|
7
|
+
* upgrades gemspec dependencies
|
|
8
|
+
* maintain and appease the authorities (Rubocop)
|
|
9
|
+
|
|
10
|
+
## 2.1.6 - 2026-01-12
|
|
11
|
+
|
|
12
|
+
* adds Ruby 4 to the support matrix
|
|
13
|
+
* upgrades gemspec dependencies
|
|
14
|
+
* maintain and appease the authorities (Rubocop)
|
|
15
|
+
|
|
16
|
+
## 2.1.5 - 2025-11-12
|
|
4
17
|
|
|
5
18
|
* adds simplecov
|
|
6
19
|
|
data/Gemfile
CHANGED
|
@@ -2,3 +2,12 @@ source 'https://rubygems.org'
|
|
|
2
2
|
|
|
3
3
|
# Specify your gem's dependencies in injectable.gemspec
|
|
4
4
|
gemspec
|
|
5
|
+
|
|
6
|
+
gem 'bundler', '~> 4.0'
|
|
7
|
+
gem 'pry-byebug', '~> 3.12'
|
|
8
|
+
gem 'rake', '~> 13.4'
|
|
9
|
+
gem 'rspec', '~> 3.13'
|
|
10
|
+
gem 'rubocop', '~> 1.86'
|
|
11
|
+
gem 'rubocop-rspec', '~> 3.9'
|
|
12
|
+
gem 'simplecov', '~> 0.22'
|
|
13
|
+
gem 'simplecov-json', '~> 0.2'
|
data/Gemfile.lock
CHANGED
|
@@ -1,65 +1,70 @@
|
|
|
1
1
|
PATH
|
|
2
2
|
remote: .
|
|
3
3
|
specs:
|
|
4
|
-
injectable (
|
|
4
|
+
injectable (3.0.0)
|
|
5
5
|
|
|
6
6
|
GEM
|
|
7
7
|
remote: https://rubygems.org/
|
|
8
8
|
specs:
|
|
9
9
|
ast (2.4.3)
|
|
10
|
-
byebug (
|
|
10
|
+
byebug (13.0.0)
|
|
11
|
+
reline (>= 0.6.0)
|
|
11
12
|
coderay (1.1.3)
|
|
12
13
|
diff-lcs (1.6.2)
|
|
13
14
|
docile (1.4.1)
|
|
14
|
-
|
|
15
|
+
io-console (0.8.2)
|
|
16
|
+
json (2.19.4)
|
|
15
17
|
language_server-protocol (3.17.0.5)
|
|
16
18
|
lint_roller (1.1.0)
|
|
17
19
|
method_source (1.1.0)
|
|
18
|
-
parallel (1.
|
|
19
|
-
parser (3.3.
|
|
20
|
+
parallel (2.1.0)
|
|
21
|
+
parser (3.3.11.1)
|
|
20
22
|
ast (~> 2.4.1)
|
|
21
23
|
racc
|
|
22
|
-
prism (1.
|
|
23
|
-
pry (0.
|
|
24
|
+
prism (1.9.0)
|
|
25
|
+
pry (0.16.0)
|
|
24
26
|
coderay (~> 1.1)
|
|
25
27
|
method_source (~> 1.0)
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
28
|
+
reline (>= 0.6.0)
|
|
29
|
+
pry-byebug (3.12.0)
|
|
30
|
+
byebug (~> 13.0)
|
|
31
|
+
pry (>= 0.13, < 0.17)
|
|
29
32
|
racc (1.8.1)
|
|
30
33
|
rainbow (3.1.1)
|
|
31
|
-
rake (13.
|
|
32
|
-
regexp_parser (2.
|
|
33
|
-
|
|
34
|
+
rake (13.4.2)
|
|
35
|
+
regexp_parser (2.12.0)
|
|
36
|
+
reline (0.6.3)
|
|
37
|
+
io-console (~> 0.5)
|
|
38
|
+
rspec (3.13.2)
|
|
34
39
|
rspec-core (~> 3.13.0)
|
|
35
40
|
rspec-expectations (~> 3.13.0)
|
|
36
41
|
rspec-mocks (~> 3.13.0)
|
|
37
|
-
rspec-core (3.13.
|
|
42
|
+
rspec-core (3.13.6)
|
|
38
43
|
rspec-support (~> 3.13.0)
|
|
39
44
|
rspec-expectations (3.13.5)
|
|
40
45
|
diff-lcs (>= 1.2.0, < 2.0)
|
|
41
46
|
rspec-support (~> 3.13.0)
|
|
42
|
-
rspec-mocks (3.13.
|
|
47
|
+
rspec-mocks (3.13.8)
|
|
43
48
|
diff-lcs (>= 1.2.0, < 2.0)
|
|
44
49
|
rspec-support (~> 3.13.0)
|
|
45
|
-
rspec-support (3.13.
|
|
46
|
-
rubocop (1.
|
|
50
|
+
rspec-support (3.13.7)
|
|
51
|
+
rubocop (1.86.1)
|
|
47
52
|
json (~> 2.3)
|
|
48
53
|
language_server-protocol (~> 3.17.0.2)
|
|
49
54
|
lint_roller (~> 1.1.0)
|
|
50
|
-
parallel (
|
|
55
|
+
parallel (>= 1.10)
|
|
51
56
|
parser (>= 3.3.0.2)
|
|
52
57
|
rainbow (>= 2.2.2, < 4.0)
|
|
53
58
|
regexp_parser (>= 2.9.3, < 3.0)
|
|
54
|
-
rubocop-ast (>= 1.
|
|
59
|
+
rubocop-ast (>= 1.49.0, < 2.0)
|
|
55
60
|
ruby-progressbar (~> 1.7)
|
|
56
61
|
unicode-display_width (>= 2.4.0, < 4.0)
|
|
57
|
-
rubocop-ast (1.
|
|
62
|
+
rubocop-ast (1.49.1)
|
|
58
63
|
parser (>= 3.3.7.2)
|
|
59
|
-
prism (~> 1.
|
|
60
|
-
rubocop-rspec (3.
|
|
64
|
+
prism (~> 1.7)
|
|
65
|
+
rubocop-rspec (3.9.0)
|
|
61
66
|
lint_roller (~> 1.1)
|
|
62
|
-
rubocop (~> 1.
|
|
67
|
+
rubocop (~> 1.81)
|
|
63
68
|
ruby-progressbar (1.13.0)
|
|
64
69
|
simplecov (0.22.0)
|
|
65
70
|
docile (~> 1.1)
|
|
@@ -70,59 +75,61 @@ GEM
|
|
|
70
75
|
json
|
|
71
76
|
simplecov
|
|
72
77
|
simplecov_json_formatter (0.1.4)
|
|
73
|
-
unicode-display_width (3.
|
|
74
|
-
unicode-emoji (~> 4.
|
|
75
|
-
unicode-emoji (4.0
|
|
78
|
+
unicode-display_width (3.2.0)
|
|
79
|
+
unicode-emoji (~> 4.1)
|
|
80
|
+
unicode-emoji (4.2.0)
|
|
76
81
|
|
|
77
82
|
PLATFORMS
|
|
78
83
|
ruby
|
|
79
84
|
|
|
80
85
|
DEPENDENCIES
|
|
81
|
-
bundler (~>
|
|
86
|
+
bundler (~> 4.0)
|
|
82
87
|
injectable!
|
|
83
|
-
pry-byebug (~> 3.
|
|
84
|
-
rake (~> 13.
|
|
88
|
+
pry-byebug (~> 3.12)
|
|
89
|
+
rake (~> 13.4)
|
|
85
90
|
rspec (~> 3.13)
|
|
86
|
-
rubocop (~> 1.
|
|
87
|
-
rubocop-rspec (~> 3.
|
|
91
|
+
rubocop (~> 1.86)
|
|
92
|
+
rubocop-rspec (~> 3.9)
|
|
88
93
|
simplecov (~> 0.22)
|
|
89
94
|
simplecov-json (~> 0.2)
|
|
90
95
|
|
|
91
96
|
CHECKSUMS
|
|
92
97
|
ast (2.4.3) sha256=954615157c1d6a382bc27d690d973195e79db7f55e9765ac7c481c60bdb4d383
|
|
93
|
-
byebug (
|
|
98
|
+
byebug (13.0.0) sha256=d2263efe751941ca520fa29744b71972d39cbc41839496706f5d9b22e92ae05d
|
|
94
99
|
coderay (1.1.3) sha256=dc530018a4684512f8f38143cd2a096c9f02a1fc2459edcfe534787a7fc77d4b
|
|
95
100
|
diff-lcs (1.6.2) sha256=9ae0d2cba7d4df3075fe8cd8602a8604993efc0dfa934cff568969efb1909962
|
|
96
101
|
docile (1.4.1) sha256=96159be799bfa73cdb721b840e9802126e4e03dfc26863db73647204c727f21e
|
|
97
|
-
injectable (
|
|
98
|
-
|
|
102
|
+
injectable (3.0.0)
|
|
103
|
+
io-console (0.8.2) sha256=d6e3ae7a7cc7574f4b8893b4fca2162e57a825b223a177b7afa236c5ef9814cc
|
|
104
|
+
json (2.19.4) sha256=670a7d333fb3b18ca5b29cb255eb7bef099e40d88c02c80bd42a3f30fe5239ac
|
|
99
105
|
language_server-protocol (3.17.0.5) sha256=fd1e39a51a28bf3eec959379985a72e296e9f9acfce46f6a79d31ca8760803cc
|
|
100
106
|
lint_roller (1.1.0) sha256=2c0c845b632a7d172cb849cc90c1bce937a28c5c8ccccb50dfd46a485003cc87
|
|
101
107
|
method_source (1.1.0) sha256=181301c9c45b731b4769bc81e8860e72f9161ad7d66dd99103c9ab84f560f5c5
|
|
102
|
-
parallel (1.
|
|
103
|
-
parser (3.3.
|
|
104
|
-
prism (1.
|
|
105
|
-
pry (0.
|
|
106
|
-
pry-byebug (3.
|
|
108
|
+
parallel (2.1.0) sha256=b35258865c2e31134c5ecb708beaaf6772adf9d5efae28e93e99260877b09356
|
|
109
|
+
parser (3.3.11.1) sha256=d17ace7aabe3e72c3cc94043714be27cc6f852f104d81aa284c2281aecc65d54
|
|
110
|
+
prism (1.9.0) sha256=7b530c6a9f92c24300014919c9dcbc055bf4cdf51ec30aed099b06cd6674ef85
|
|
111
|
+
pry (0.16.0) sha256=d76c69065698ed1f85e717bd33d7942c38a50868f6b0673c636192b3d1b6054e
|
|
112
|
+
pry-byebug (3.12.0) sha256=594e094ae8a8390a7ad4c7b36ae36e13304ed02664c67417d108dc5f7213d1b7
|
|
107
113
|
racc (1.8.1) sha256=4a7f6929691dbec8b5209a0b373bc2614882b55fc5d2e447a21aaa691303d62f
|
|
108
114
|
rainbow (3.1.1) sha256=039491aa3a89f42efa1d6dec2fc4e62ede96eb6acd95e52f1ad581182b79bc6a
|
|
109
|
-
rake (13.
|
|
110
|
-
regexp_parser (2.
|
|
111
|
-
|
|
112
|
-
rspec
|
|
115
|
+
rake (13.4.2) sha256=cb825b2bd5f1f8e91ca37bddb4b9aaf345551b4731da62949be002fa89283701
|
|
116
|
+
regexp_parser (2.12.0) sha256=35a916a1d63190ab5c9009457136ae5f3c0c7512d60291d0d1378ba18ce08ebb
|
|
117
|
+
reline (0.6.3) sha256=1198b04973565b36ec0f11542ab3f5cfeeec34823f4e54cebde90968092b1835
|
|
118
|
+
rspec (3.13.2) sha256=206284a08ad798e61f86d7ca3e376718d52c0bc944626b2349266f239f820587
|
|
119
|
+
rspec-core (3.13.6) sha256=a8823c6411667b60a8bca135364351dda34cd55e44ff94c4be4633b37d828b2d
|
|
113
120
|
rspec-expectations (3.13.5) sha256=33a4d3a1d95060aea4c94e9f237030a8f9eae5615e9bd85718fe3a09e4b58836
|
|
114
|
-
rspec-mocks (3.13.
|
|
115
|
-
rspec-support (3.13.
|
|
116
|
-
rubocop (1.
|
|
117
|
-
rubocop-ast (1.
|
|
118
|
-
rubocop-rspec (3.
|
|
121
|
+
rspec-mocks (3.13.8) sha256=086ad3d3d17533f4237643de0b5c42f04b66348c28bf6b9c2d3f4a3b01af1d47
|
|
122
|
+
rspec-support (3.13.7) sha256=0640e5570872aafefd79867901deeeeb40b0c9875a36b983d85f54fb7381c47c
|
|
123
|
+
rubocop (1.86.1) sha256=44415f3f01d01a21e01132248d2fd0867572475b566ca188a0a42133a08d4531
|
|
124
|
+
rubocop-ast (1.49.1) sha256=4412f3ee70f6fe4546cc489548e0f6fcf76cafcfa80fa03af67098ffed755035
|
|
125
|
+
rubocop-rspec (3.9.0) sha256=8fa70a3619408237d789aeecfb9beef40576acc855173e60939d63332fdb55e2
|
|
119
126
|
ruby-progressbar (1.13.0) sha256=80fc9c47a9b640d6834e0dc7b3c94c9df37f08cb072b7761e4a71e22cff29b33
|
|
120
127
|
simplecov (0.22.0) sha256=fe2622c7834ff23b98066bb0a854284b2729a569ac659f82621fc22ef36213a5
|
|
121
128
|
simplecov-html (0.13.2) sha256=bd0b8e54e7c2d7685927e8d6286466359b6f16b18cb0df47b508e8d73c777246
|
|
122
129
|
simplecov-json (0.2.3) sha256=c63823b5dfc95c85ff4cb94251765f08a166bdd68098f259368cbfe738e281f7
|
|
123
130
|
simplecov_json_formatter (0.1.4) sha256=529418fbe8de1713ac2b2d612aa3daa56d316975d307244399fa4838c601b428
|
|
124
|
-
unicode-display_width (3.
|
|
125
|
-
unicode-emoji (4.0
|
|
131
|
+
unicode-display_width (3.2.0) sha256=0cdd96b5681a5949cdbc2c55e7b420facae74c4aaf9a9815eee1087cb1853c42
|
|
132
|
+
unicode-emoji (4.2.0) sha256=519e69150f75652e40bf736106cfbc8f0f73aa3fb6a65afe62fefa7f80b0f80f
|
|
126
133
|
|
|
127
134
|
BUNDLED WITH
|
|
128
|
-
|
|
135
|
+
4.0.10
|
data/injectable.gemspec
CHANGED
|
@@ -23,14 +23,5 @@ Gem::Specification.new do |spec|
|
|
|
23
23
|
spec.bindir = 'exe'
|
|
24
24
|
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
|
25
25
|
spec.require_paths = ['lib']
|
|
26
|
-
spec.required_ruby_version = '>= 3.
|
|
27
|
-
|
|
28
|
-
spec.add_development_dependency 'bundler', '~> 2.7'
|
|
29
|
-
spec.add_development_dependency 'pry-byebug', '~> 3.11'
|
|
30
|
-
spec.add_development_dependency 'rake', '~> 13.3'
|
|
31
|
-
spec.add_development_dependency 'rspec', '~> 3.13'
|
|
32
|
-
spec.add_development_dependency 'rubocop', '~> 1.81'
|
|
33
|
-
spec.add_development_dependency 'rubocop-rspec', '~> 3.7'
|
|
34
|
-
spec.add_development_dependency 'simplecov', '~> 0.22'
|
|
35
|
-
spec.add_development_dependency 'simplecov-json', '~> 0.2'
|
|
26
|
+
spec.required_ruby_version = '>= 3.3'
|
|
36
27
|
end
|
|
@@ -28,22 +28,26 @@ module Injectable
|
|
|
28
28
|
|
|
29
29
|
ivar = "@#{name}"
|
|
30
30
|
|
|
31
|
+
# Define the instance reader immediately when this attribute is declared
|
|
32
|
+
# so instances always respond to the reader even if the singleton
|
|
33
|
+
# class value has not been set yet.
|
|
34
|
+
if singleton_class?
|
|
35
|
+
class_eval do
|
|
36
|
+
define_method(name) do
|
|
37
|
+
if instance_variable_defined? ivar
|
|
38
|
+
instance_variable_get ivar
|
|
39
|
+
else
|
|
40
|
+
singleton_class.send name
|
|
41
|
+
end
|
|
42
|
+
end
|
|
43
|
+
end
|
|
44
|
+
end
|
|
45
|
+
|
|
31
46
|
define_singleton_method("#{name}=") do |val|
|
|
32
47
|
singleton_class.class_eval do
|
|
33
48
|
define_method(name) { val }
|
|
34
49
|
end
|
|
35
50
|
|
|
36
|
-
if singleton_class?
|
|
37
|
-
class_eval do
|
|
38
|
-
define_method(name) do
|
|
39
|
-
if instance_variable_defined? ivar
|
|
40
|
-
instance_variable_get ivar
|
|
41
|
-
else
|
|
42
|
-
singleton_class.send name
|
|
43
|
-
end
|
|
44
|
-
end
|
|
45
|
-
end
|
|
46
|
-
end
|
|
47
51
|
val
|
|
48
52
|
end
|
|
49
53
|
end
|
|
@@ -19,7 +19,7 @@ module Injectable
|
|
|
19
19
|
def memoized_dependencies_of(name)
|
|
20
20
|
return [] if dependencies_of(name).empty?
|
|
21
21
|
|
|
22
|
-
dependencies_of(name).
|
|
22
|
+
dependencies_of(name).to_h { |dep| [dep, get(dep)] }
|
|
23
23
|
end
|
|
24
24
|
|
|
25
25
|
def dependencies_of(name)
|
|
@@ -22,7 +22,7 @@ module Injectable
|
|
|
22
22
|
|
|
23
23
|
def check_call_definition!
|
|
24
24
|
return if (self.class.ancestors - [Injectable::InstanceMethods]).any? do |ancestor|
|
|
25
|
-
ancestor.
|
|
25
|
+
ancestor.method_defined?(:call, false)
|
|
26
26
|
end
|
|
27
27
|
|
|
28
28
|
raise NoMethodError, "A #call method with zero arity must be defined in #{self.class}"
|
data/lib/injectable/version.rb
CHANGED
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: injectable
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version:
|
|
4
|
+
version: 3.0.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Papipo
|
|
@@ -12,119 +12,7 @@ authors:
|
|
|
12
12
|
bindir: exe
|
|
13
13
|
cert_chain: []
|
|
14
14
|
date: 1980-01-02 00:00:00.000000000 Z
|
|
15
|
-
dependencies:
|
|
16
|
-
- !ruby/object:Gem::Dependency
|
|
17
|
-
name: bundler
|
|
18
|
-
requirement: !ruby/object:Gem::Requirement
|
|
19
|
-
requirements:
|
|
20
|
-
- - "~>"
|
|
21
|
-
- !ruby/object:Gem::Version
|
|
22
|
-
version: '2.7'
|
|
23
|
-
type: :development
|
|
24
|
-
prerelease: false
|
|
25
|
-
version_requirements: !ruby/object:Gem::Requirement
|
|
26
|
-
requirements:
|
|
27
|
-
- - "~>"
|
|
28
|
-
- !ruby/object:Gem::Version
|
|
29
|
-
version: '2.7'
|
|
30
|
-
- !ruby/object:Gem::Dependency
|
|
31
|
-
name: pry-byebug
|
|
32
|
-
requirement: !ruby/object:Gem::Requirement
|
|
33
|
-
requirements:
|
|
34
|
-
- - "~>"
|
|
35
|
-
- !ruby/object:Gem::Version
|
|
36
|
-
version: '3.11'
|
|
37
|
-
type: :development
|
|
38
|
-
prerelease: false
|
|
39
|
-
version_requirements: !ruby/object:Gem::Requirement
|
|
40
|
-
requirements:
|
|
41
|
-
- - "~>"
|
|
42
|
-
- !ruby/object:Gem::Version
|
|
43
|
-
version: '3.11'
|
|
44
|
-
- !ruby/object:Gem::Dependency
|
|
45
|
-
name: rake
|
|
46
|
-
requirement: !ruby/object:Gem::Requirement
|
|
47
|
-
requirements:
|
|
48
|
-
- - "~>"
|
|
49
|
-
- !ruby/object:Gem::Version
|
|
50
|
-
version: '13.3'
|
|
51
|
-
type: :development
|
|
52
|
-
prerelease: false
|
|
53
|
-
version_requirements: !ruby/object:Gem::Requirement
|
|
54
|
-
requirements:
|
|
55
|
-
- - "~>"
|
|
56
|
-
- !ruby/object:Gem::Version
|
|
57
|
-
version: '13.3'
|
|
58
|
-
- !ruby/object:Gem::Dependency
|
|
59
|
-
name: rspec
|
|
60
|
-
requirement: !ruby/object:Gem::Requirement
|
|
61
|
-
requirements:
|
|
62
|
-
- - "~>"
|
|
63
|
-
- !ruby/object:Gem::Version
|
|
64
|
-
version: '3.13'
|
|
65
|
-
type: :development
|
|
66
|
-
prerelease: false
|
|
67
|
-
version_requirements: !ruby/object:Gem::Requirement
|
|
68
|
-
requirements:
|
|
69
|
-
- - "~>"
|
|
70
|
-
- !ruby/object:Gem::Version
|
|
71
|
-
version: '3.13'
|
|
72
|
-
- !ruby/object:Gem::Dependency
|
|
73
|
-
name: rubocop
|
|
74
|
-
requirement: !ruby/object:Gem::Requirement
|
|
75
|
-
requirements:
|
|
76
|
-
- - "~>"
|
|
77
|
-
- !ruby/object:Gem::Version
|
|
78
|
-
version: '1.81'
|
|
79
|
-
type: :development
|
|
80
|
-
prerelease: false
|
|
81
|
-
version_requirements: !ruby/object:Gem::Requirement
|
|
82
|
-
requirements:
|
|
83
|
-
- - "~>"
|
|
84
|
-
- !ruby/object:Gem::Version
|
|
85
|
-
version: '1.81'
|
|
86
|
-
- !ruby/object:Gem::Dependency
|
|
87
|
-
name: rubocop-rspec
|
|
88
|
-
requirement: !ruby/object:Gem::Requirement
|
|
89
|
-
requirements:
|
|
90
|
-
- - "~>"
|
|
91
|
-
- !ruby/object:Gem::Version
|
|
92
|
-
version: '3.7'
|
|
93
|
-
type: :development
|
|
94
|
-
prerelease: false
|
|
95
|
-
version_requirements: !ruby/object:Gem::Requirement
|
|
96
|
-
requirements:
|
|
97
|
-
- - "~>"
|
|
98
|
-
- !ruby/object:Gem::Version
|
|
99
|
-
version: '3.7'
|
|
100
|
-
- !ruby/object:Gem::Dependency
|
|
101
|
-
name: simplecov
|
|
102
|
-
requirement: !ruby/object:Gem::Requirement
|
|
103
|
-
requirements:
|
|
104
|
-
- - "~>"
|
|
105
|
-
- !ruby/object:Gem::Version
|
|
106
|
-
version: '0.22'
|
|
107
|
-
type: :development
|
|
108
|
-
prerelease: false
|
|
109
|
-
version_requirements: !ruby/object:Gem::Requirement
|
|
110
|
-
requirements:
|
|
111
|
-
- - "~>"
|
|
112
|
-
- !ruby/object:Gem::Version
|
|
113
|
-
version: '0.22'
|
|
114
|
-
- !ruby/object:Gem::Dependency
|
|
115
|
-
name: simplecov-json
|
|
116
|
-
requirement: !ruby/object:Gem::Requirement
|
|
117
|
-
requirements:
|
|
118
|
-
- - "~>"
|
|
119
|
-
- !ruby/object:Gem::Version
|
|
120
|
-
version: '0.2'
|
|
121
|
-
type: :development
|
|
122
|
-
prerelease: false
|
|
123
|
-
version_requirements: !ruby/object:Gem::Requirement
|
|
124
|
-
requirements:
|
|
125
|
-
- - "~>"
|
|
126
|
-
- !ruby/object:Gem::Version
|
|
127
|
-
version: '0.2'
|
|
15
|
+
dependencies: []
|
|
128
16
|
email:
|
|
129
17
|
- dev@rubiconmd.com
|
|
130
18
|
executables: []
|
|
@@ -139,6 +27,7 @@ files:
|
|
|
139
27
|
- ".rubocop.yml"
|
|
140
28
|
- ".rubocop_todo.yml"
|
|
141
29
|
- ".ruby-version"
|
|
30
|
+
- ".simplecov"
|
|
142
31
|
- CHANGELOG.md
|
|
143
32
|
- CODE_OF_CONDUCT.md
|
|
144
33
|
- Gemfile
|
|
@@ -170,14 +59,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
|
170
59
|
requirements:
|
|
171
60
|
- - ">="
|
|
172
61
|
- !ruby/object:Gem::Version
|
|
173
|
-
version: '3.
|
|
62
|
+
version: '3.3'
|
|
174
63
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
|
175
64
|
requirements:
|
|
176
65
|
- - ">="
|
|
177
66
|
- !ruby/object:Gem::Version
|
|
178
67
|
version: '0'
|
|
179
68
|
requirements: []
|
|
180
|
-
rubygems_version:
|
|
69
|
+
rubygems_version: 4.0.10
|
|
181
70
|
specification_version: 4
|
|
182
71
|
summary: A library to help you build nice service objects with dependency injection.
|
|
183
72
|
test_files: []
|