injectable 2.1.1 → 2.1.3
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/{ruby.yml → rspec.yml} +7 -8
- data/.github/workflows/rubocop.yml +26 -0
- data/.gitignore +2 -0
- data/.rubocop.yml +57 -0
- data/.rubocop_todo.yml +132 -0
- data/.ruby-version +1 -0
- data/CHANGELOG.md +22 -6
- data/Gemfile +1 -1
- data/Gemfile.lock +91 -25
- data/README.md +3 -1
- data/Rakefile +3 -3
- data/bin/console +3 -3
- data/injectable.gemspec +11 -6
- data/lib/injectable/dependency.rb +1 -3
- data/lib/injectable/instance_methods.rb +3 -0
- data/lib/injectable/version.rb +1 -1
- metadata +49 -21
- data/.travis.yml +0 -7
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1dc9cf8ac093f13331e2a8942eaac2aab522dd98d06a8e4eb3c7335bc68e4e21
|
4
|
+
data.tar.gz: a8cc4e032cbd71bf02b4efc1f595df1857806a2352df54ec9df1f4b97dc59b6e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 074e89cb53bc5af5c78c1438747770f7a282e8640dae6730c37bf0690e9627ddd80bc1b41167655534ceac917ee27b9093411f6f6c9120db4958983898870a43
|
7
|
+
data.tar.gz: a27dec842d4ce13cae9e8bcd3ba622eb160c34675f10a94906682019015d9f243598d22ae0899024fba05cc1addc535c04ec76f187b0074ed5b08af7a4ca88b4
|
@@ -1,4 +1,4 @@
|
|
1
|
-
name:
|
1
|
+
name: RSpec
|
2
2
|
|
3
3
|
on:
|
4
4
|
push:
|
@@ -10,16 +10,15 @@ jobs:
|
|
10
10
|
build:
|
11
11
|
runs-on: ubuntu-latest
|
12
12
|
strategy:
|
13
|
+
fail-fast: false
|
13
14
|
matrix:
|
14
|
-
ruby: [
|
15
|
+
ruby: ['3.2.8', '3.3.8', '3.4.5']
|
15
16
|
steps:
|
16
|
-
- uses: actions/checkout@
|
17
|
+
- uses: actions/checkout@v4
|
17
18
|
- name: Set up Ruby ${{ matrix.ruby }}
|
18
|
-
uses:
|
19
|
+
uses: ruby/setup-ruby@v1
|
19
20
|
with:
|
20
21
|
ruby-version: ${{ matrix.ruby }}
|
22
|
+
bundler-cache: true # runs 'bundle install' and caches installed gems automatically
|
21
23
|
- name: Build and test with Rake
|
22
|
-
run:
|
23
|
-
gem install bundler
|
24
|
-
bundle install --jobs 4 --retry 3
|
25
|
-
bundle exec rake
|
24
|
+
run: bundle exec rake
|
@@ -0,0 +1,26 @@
|
|
1
|
+
name: rubocop
|
2
|
+
|
3
|
+
on:
|
4
|
+
push:
|
5
|
+
branches: [ master ]
|
6
|
+
pull_request:
|
7
|
+
branches: [ master ]
|
8
|
+
|
9
|
+
permissions:
|
10
|
+
contents: read
|
11
|
+
pull-requests: write
|
12
|
+
jobs:
|
13
|
+
rubocop:
|
14
|
+
name: runner / rubocop
|
15
|
+
runs-on: ubuntu-latest
|
16
|
+
steps:
|
17
|
+
- uses: actions/checkout@v4
|
18
|
+
- uses: ruby/setup-ruby@v1
|
19
|
+
with:
|
20
|
+
ruby-version: '3.4'
|
21
|
+
bundler-cache: true
|
22
|
+
- uses: reviewdog/action-rubocop@v2
|
23
|
+
with:
|
24
|
+
reporter: github-pr-review # Default is github-pr-check
|
25
|
+
skip_install: true
|
26
|
+
use_bundler: true
|
data/.gitignore
CHANGED
data/.rubocop.yml
ADDED
@@ -0,0 +1,57 @@
|
|
1
|
+
inherit_from: .rubocop_todo.yml
|
2
|
+
|
3
|
+
plugins:
|
4
|
+
- rubocop-rspec
|
5
|
+
|
6
|
+
AllCops:
|
7
|
+
DisplayCopNames: true
|
8
|
+
DisplayStyleGuide: true
|
9
|
+
Enabled: true
|
10
|
+
NewCops: enable
|
11
|
+
SuggestExtensions: false
|
12
|
+
TargetRubyVersion: 3.4
|
13
|
+
|
14
|
+
Layout/EmptyLinesAroundAttributeAccessor:
|
15
|
+
Enabled: true
|
16
|
+
AllowAliasSyntax: true
|
17
|
+
|
18
|
+
Layout/IndentationConsistency:
|
19
|
+
Enabled: true
|
20
|
+
EnforcedStyle: normal
|
21
|
+
|
22
|
+
Layout/IndentationWidth:
|
23
|
+
Enabled: true
|
24
|
+
Width: 2
|
25
|
+
|
26
|
+
Layout/SpaceInsideHashLiteralBraces:
|
27
|
+
Enabled: true
|
28
|
+
EnforcedStyle: space
|
29
|
+
EnforcedStyleForEmptyBraces: no_space
|
30
|
+
|
31
|
+
Lint/SymbolConversion:
|
32
|
+
Enabled: true
|
33
|
+
EnforcedStyle: strict
|
34
|
+
|
35
|
+
RSpec/DescribedClass:
|
36
|
+
Enabled: true
|
37
|
+
EnforcedStyle: described_class
|
38
|
+
SkipBlocks: true
|
39
|
+
|
40
|
+
Style/FrozenStringLiteralComment:
|
41
|
+
Enabled: true
|
42
|
+
EnforcedStyle: never
|
43
|
+
|
44
|
+
Style/HashSyntax:
|
45
|
+
Enabled: true
|
46
|
+
EnforcedStyle: ruby19_no_mixed_keys
|
47
|
+
EnforcedShorthandSyntax: either_consistent
|
48
|
+
UseHashRocketsWithSymbolValues: false
|
49
|
+
PreferHashRocketsForNonAlnumEndingSymbols: false
|
50
|
+
|
51
|
+
Style/QuotedSymbols:
|
52
|
+
Enabled: true
|
53
|
+
EnforcedStyle: single_quotes
|
54
|
+
|
55
|
+
Style/StringLiterals:
|
56
|
+
Enabled: true
|
57
|
+
EnforcedStyle: single_quotes
|
data/.rubocop_todo.yml
ADDED
@@ -0,0 +1,132 @@
|
|
1
|
+
# This configuration was generated by
|
2
|
+
# `rubocop --auto-gen-config`
|
3
|
+
# on 2025-07-19 18:45:18 UTC using RuboCop version 1.78.0.
|
4
|
+
# The point is for the user to remove these configuration records
|
5
|
+
# one by one as the offenses are removed from the code base.
|
6
|
+
# Note that changes in the inspected code, or installation of new
|
7
|
+
# versions of RuboCop, may require this file to be generated again.
|
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
|
+
# Offense count: 4
|
25
|
+
# Configuration parameters: AllowedMethods.
|
26
|
+
# AllowedMethods: enums
|
27
|
+
Lint/ConstantDefinitionInBlock:
|
28
|
+
Exclude:
|
29
|
+
- 'spec/injectable/dependency_spec.rb'
|
30
|
+
- 'spec/injectable_spec.rb'
|
31
|
+
|
32
|
+
# Offense count: 3
|
33
|
+
# Configuration parameters: AllowComments.
|
34
|
+
Lint/EmptyClass:
|
35
|
+
Exclude:
|
36
|
+
- 'spec/injectable/dependency_spec.rb'
|
37
|
+
|
38
|
+
# Offense count: 1
|
39
|
+
# Configuration parameters: AllowedParentClasses.
|
40
|
+
Lint/MissingSuper:
|
41
|
+
Exclude:
|
42
|
+
- 'lib/injectable/class_methods.rb'
|
43
|
+
|
44
|
+
# Offense count: 1
|
45
|
+
Lint/StructNewOverride:
|
46
|
+
Exclude:
|
47
|
+
- 'lib/injectable/dependency.rb'
|
48
|
+
|
49
|
+
# Offense count: 1
|
50
|
+
# Configuration parameters: CountComments, CountAsOne, AllowedMethods, AllowedPatterns.
|
51
|
+
Metrics/MethodLength:
|
52
|
+
Max: 21
|
53
|
+
|
54
|
+
# Offense count: 1
|
55
|
+
# Configuration parameters: EnforcedStyle, CheckMethodNames, CheckSymbols, AllowedIdentifiers, AllowedPatterns.
|
56
|
+
# SupportedStyles: snake_case, normalcase, non_integer
|
57
|
+
# AllowedIdentifiers: TLS1_1, TLS1_2, capture3, iso8601, rfc1123_date, rfc822, rfc2822, rfc3339, x86_64
|
58
|
+
Naming/VariableNumber:
|
59
|
+
Exclude:
|
60
|
+
- 'lib/injectable/dependency.rb'
|
61
|
+
|
62
|
+
# Offense count: 4
|
63
|
+
# Configuration parameters: Prefixes, AllowedPatterns.
|
64
|
+
# Prefixes: when, with, without
|
65
|
+
RSpec/ContextWording:
|
66
|
+
Exclude:
|
67
|
+
- 'spec/injectable/dependencies_proxy_spec.rb'
|
68
|
+
- 'spec/injectable/dependency_spec.rb'
|
69
|
+
- 'spec/injectable_spec.rb'
|
70
|
+
|
71
|
+
# Offense count: 1
|
72
|
+
RSpec/DescribeMethod:
|
73
|
+
Exclude:
|
74
|
+
- 'spec/injectable/dependency_spec.rb'
|
75
|
+
|
76
|
+
# Offense count: 5
|
77
|
+
# Configuration parameters: CountAsOne.
|
78
|
+
RSpec/ExampleLength:
|
79
|
+
Max: 6
|
80
|
+
|
81
|
+
# Offense count: 1
|
82
|
+
RSpec/IdenticalEqualityAssertion:
|
83
|
+
Exclude:
|
84
|
+
- 'spec/injectable/dependencies_proxy_spec.rb'
|
85
|
+
|
86
|
+
# Offense count: 6
|
87
|
+
RSpec/LeakyConstantDeclaration:
|
88
|
+
Exclude:
|
89
|
+
- 'spec/injectable/dependency_spec.rb'
|
90
|
+
- 'spec/injectable_spec.rb'
|
91
|
+
|
92
|
+
# Offense count: 4
|
93
|
+
# Configuration parameters: AllowSubject.
|
94
|
+
RSpec/MultipleMemoizedHelpers:
|
95
|
+
Max: 8
|
96
|
+
|
97
|
+
# Offense count: 34
|
98
|
+
# Configuration parameters: EnforcedStyle, IgnoreSharedExamples.
|
99
|
+
# SupportedStyles: always, named_only
|
100
|
+
RSpec/NamedSubject:
|
101
|
+
Exclude:
|
102
|
+
- 'spec/injectable/dependencies_graph_spec.rb'
|
103
|
+
- 'spec/injectable/dependency_spec.rb'
|
104
|
+
- 'spec/injectable_spec.rb'
|
105
|
+
|
106
|
+
# Offense count: 3
|
107
|
+
# Configuration parameters: Include, CustomTransform, IgnoreMethods, IgnoreMetadata.
|
108
|
+
# Include: **/*_spec.rb
|
109
|
+
RSpec/SpecFilePathFormat:
|
110
|
+
Exclude:
|
111
|
+
- '**/spec/routing/**/*'
|
112
|
+
- 'spec/injectable/dependencies_graph_spec.rb'
|
113
|
+
- 'spec/injectable/dependencies_proxy_spec.rb'
|
114
|
+
- 'spec/injectable/dependency_spec.rb'
|
115
|
+
|
116
|
+
# Offense count: 17
|
117
|
+
# Configuration parameters: IgnoreNameless, IgnoreSymbolicNames.
|
118
|
+
RSpec/VerifiedDoubles:
|
119
|
+
Exclude:
|
120
|
+
- 'spec/injectable/dependencies_graph_spec.rb'
|
121
|
+
- 'spec/injectable/dependencies_proxy_spec.rb'
|
122
|
+
- 'spec/injectable/dependency_spec.rb'
|
123
|
+
- 'spec/injectable_spec.rb'
|
124
|
+
|
125
|
+
# Offense count: 2
|
126
|
+
# Configuration parameters: AllowedConstants.
|
127
|
+
Style/Documentation:
|
128
|
+
Exclude:
|
129
|
+
- 'spec/**/*'
|
130
|
+
- 'test/**/*'
|
131
|
+
- 'lib/injectable/class_methods.rb'
|
132
|
+
- 'lib/injectable/instance_methods.rb'
|
data/.ruby-version
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
3.4.5
|
data/CHANGELOG.md
CHANGED
@@ -1,22 +1,38 @@
|
|
1
|
-
|
1
|
+
# Unreleased
|
2
2
|
|
3
|
-
|
3
|
+
## 2.1.3 - 2025-07-21
|
4
|
+
|
5
|
+
* Drop support for Rubies below 3.2
|
6
|
+
* Add support for Rubies up to 3.4.5
|
7
|
+
* Updates Github Actions versions for checkout and Ruby setup
|
8
|
+
* Enables requirement of MFA in Rubygems
|
9
|
+
* Sets up Rubocop Github Action
|
10
|
+
* Sets up Rubocop todo and config
|
11
|
+
* Fixes several Rubocop flaggings
|
12
|
+
|
13
|
+
## 2.1.2 - 2023-03-31
|
14
|
+
|
15
|
+
* Drop support for Ruby 2.7
|
16
|
+
* Add Ruby 3.2.1 to test matrix
|
17
|
+
* Updates Github Actions versions for checkout and Ruby setup
|
18
|
+
|
19
|
+
## 2.1.1 - 2021-03-15
|
4
20
|
|
5
21
|
* bug fixes
|
6
22
|
* Address final Ruby 2.7 warnings (#24)
|
7
23
|
|
8
|
-
|
24
|
+
## 2.1.0 - 2021-01-05
|
9
25
|
|
10
26
|
* enhancements
|
11
27
|
* Return `method` object instead of monkey patched instance (#17)
|
12
28
|
* Prepare for Ruby 3.0 (#22)
|
13
29
|
|
14
|
-
|
30
|
+
## 2.0.0 - 2020-03-16
|
15
31
|
|
16
32
|
* breaking changes
|
17
33
|
* Raises exception if shadowing an existing `#call` method in a dependency (#15)
|
18
34
|
|
19
|
-
|
35
|
+
## 1.0.3 - 2020-03-16
|
20
36
|
|
21
37
|
* enhancements
|
22
38
|
* Added GitHub Actions as CI (#9)
|
@@ -24,7 +40,7 @@
|
|
24
40
|
* bug fixes
|
25
41
|
* Fixed a bug that wouldn't pass a block if `#call` was aliased (#7)
|
26
42
|
|
27
|
-
|
43
|
+
## 1.0.2 - 2020-03-02
|
28
44
|
|
29
45
|
* security
|
30
46
|
* Bump `rake` to 12.3.3 (#11)
|
data/Gemfile
CHANGED
data/Gemfile.lock
CHANGED
@@ -1,45 +1,111 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
injectable (2.1.
|
4
|
+
injectable (2.1.3)
|
5
5
|
|
6
6
|
GEM
|
7
7
|
remote: https://rubygems.org/
|
8
8
|
specs:
|
9
|
-
|
9
|
+
ast (2.4.3)
|
10
|
+
byebug (12.0.0)
|
10
11
|
coderay (1.1.3)
|
11
|
-
diff-lcs (1.
|
12
|
-
|
13
|
-
|
12
|
+
diff-lcs (1.6.2)
|
13
|
+
json (2.13.0)
|
14
|
+
language_server-protocol (3.17.0.5)
|
15
|
+
lint_roller (1.1.0)
|
16
|
+
method_source (1.1.0)
|
17
|
+
parallel (1.27.0)
|
18
|
+
parser (3.3.8.0)
|
19
|
+
ast (~> 2.4.1)
|
20
|
+
racc
|
21
|
+
prism (1.4.0)
|
22
|
+
pry (0.15.2)
|
14
23
|
coderay (~> 1.1)
|
15
24
|
method_source (~> 1.0)
|
16
|
-
pry-byebug (3.
|
17
|
-
byebug (~>
|
18
|
-
pry (
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
rspec-
|
26
|
-
|
25
|
+
pry-byebug (3.11.0)
|
26
|
+
byebug (~> 12.0)
|
27
|
+
pry (>= 0.13, < 0.16)
|
28
|
+
racc (1.8.1)
|
29
|
+
rainbow (3.1.1)
|
30
|
+
rake (13.3.0)
|
31
|
+
regexp_parser (2.10.0)
|
32
|
+
rspec (3.13.1)
|
33
|
+
rspec-core (~> 3.13.0)
|
34
|
+
rspec-expectations (~> 3.13.0)
|
35
|
+
rspec-mocks (~> 3.13.0)
|
36
|
+
rspec-core (3.13.5)
|
37
|
+
rspec-support (~> 3.13.0)
|
38
|
+
rspec-expectations (3.13.5)
|
27
39
|
diff-lcs (>= 1.2.0, < 2.0)
|
28
|
-
rspec-support (~> 3.
|
29
|
-
rspec-mocks (3.
|
40
|
+
rspec-support (~> 3.13.0)
|
41
|
+
rspec-mocks (3.13.5)
|
30
42
|
diff-lcs (>= 1.2.0, < 2.0)
|
31
|
-
rspec-support (~> 3.
|
32
|
-
rspec-support (3.
|
43
|
+
rspec-support (~> 3.13.0)
|
44
|
+
rspec-support (3.13.4)
|
45
|
+
rubocop (1.78.0)
|
46
|
+
json (~> 2.3)
|
47
|
+
language_server-protocol (~> 3.17.0.2)
|
48
|
+
lint_roller (~> 1.1.0)
|
49
|
+
parallel (~> 1.10)
|
50
|
+
parser (>= 3.3.0.2)
|
51
|
+
rainbow (>= 2.2.2, < 4.0)
|
52
|
+
regexp_parser (>= 2.9.3, < 3.0)
|
53
|
+
rubocop-ast (>= 1.45.1, < 2.0)
|
54
|
+
ruby-progressbar (~> 1.7)
|
55
|
+
unicode-display_width (>= 2.4.0, < 4.0)
|
56
|
+
rubocop-ast (1.46.0)
|
57
|
+
parser (>= 3.3.7.2)
|
58
|
+
prism (~> 1.4)
|
59
|
+
rubocop-rspec (3.6.0)
|
60
|
+
lint_roller (~> 1.1)
|
61
|
+
rubocop (~> 1.72, >= 1.72.1)
|
62
|
+
ruby-progressbar (1.13.0)
|
63
|
+
unicode-display_width (3.1.4)
|
64
|
+
unicode-emoji (~> 4.0, >= 4.0.4)
|
65
|
+
unicode-emoji (4.0.4)
|
33
66
|
|
34
67
|
PLATFORMS
|
35
68
|
ruby
|
36
69
|
|
37
70
|
DEPENDENCIES
|
38
|
-
bundler (~> 2.
|
71
|
+
bundler (~> 2.7)
|
39
72
|
injectable!
|
40
|
-
pry-byebug
|
41
|
-
rake (~> 13.
|
42
|
-
rspec (~> 3.
|
73
|
+
pry-byebug (~> 3.11)
|
74
|
+
rake (~> 13.3)
|
75
|
+
rspec (~> 3.13)
|
76
|
+
rubocop (~> 1.78)
|
77
|
+
rubocop-rspec (~> 3.6)
|
78
|
+
|
79
|
+
CHECKSUMS
|
80
|
+
ast (2.4.3) sha256=954615157c1d6a382bc27d690d973195e79db7f55e9765ac7c481c60bdb4d383
|
81
|
+
byebug (12.0.0) sha256=d4a150d291cca40b66ec9ca31f754e93fed8aa266a17335f71bb0afa7fca1a1e
|
82
|
+
coderay (1.1.3) sha256=dc530018a4684512f8f38143cd2a096c9f02a1fc2459edcfe534787a7fc77d4b
|
83
|
+
diff-lcs (1.6.2) sha256=9ae0d2cba7d4df3075fe8cd8602a8604993efc0dfa934cff568969efb1909962
|
84
|
+
injectable (2.1.3)
|
85
|
+
json (2.13.0) sha256=a4bdf1ce8db5617ec6c59e021db4a398e54b57b335e1fa417ac7badc3fb7c1a0
|
86
|
+
language_server-protocol (3.17.0.5) sha256=fd1e39a51a28bf3eec959379985a72e296e9f9acfce46f6a79d31ca8760803cc
|
87
|
+
lint_roller (1.1.0) sha256=2c0c845b632a7d172cb849cc90c1bce937a28c5c8ccccb50dfd46a485003cc87
|
88
|
+
method_source (1.1.0) sha256=181301c9c45b731b4769bc81e8860e72f9161ad7d66dd99103c9ab84f560f5c5
|
89
|
+
parallel (1.27.0) sha256=4ac151e1806b755fb4e2dc2332cbf0e54f2e24ba821ff2d3dcf86bf6dc4ae130
|
90
|
+
parser (3.3.8.0) sha256=2476364142b307fa5a1b1ece44f260728be23858a9c71078e956131a75453c45
|
91
|
+
prism (1.4.0) sha256=dc0e3e00e93160213dc2a65519d9002a4a1e7b962db57d444cf1a71565bb703e
|
92
|
+
pry (0.15.2) sha256=12d54b8640d3fa29c9211dd4ffb08f3fd8bf7a4fd9b5a73ce5b59c8709385b6b
|
93
|
+
pry-byebug (3.11.0) sha256=0b0abb7d309bc7f00044d512a3c8567274f7012b944b38becc8440439a1cea72
|
94
|
+
racc (1.8.1) sha256=4a7f6929691dbec8b5209a0b373bc2614882b55fc5d2e447a21aaa691303d62f
|
95
|
+
rainbow (3.1.1) sha256=039491aa3a89f42efa1d6dec2fc4e62ede96eb6acd95e52f1ad581182b79bc6a
|
96
|
+
rake (13.3.0) sha256=96f5092d786ff412c62fde76f793cc0541bd84d2eb579caa529aa8a059934493
|
97
|
+
regexp_parser (2.10.0) sha256=cb6f0ddde88772cd64bff1dbbf68df66d376043fe2e66a9ef77fcb1b0c548c61
|
98
|
+
rspec (3.13.1) sha256=b9f9a58fa915b8d94a1d6b3195fe6dd28c4c34836a6097015142c4a9ace72140
|
99
|
+
rspec-core (3.13.5) sha256=ab3f682897c6131c67f9a17cfee5022a597f283aebe654d329a565f9937a4fa3
|
100
|
+
rspec-expectations (3.13.5) sha256=33a4d3a1d95060aea4c94e9f237030a8f9eae5615e9bd85718fe3a09e4b58836
|
101
|
+
rspec-mocks (3.13.5) sha256=e4338a6f285ada9fe56f5893f5457783af8194f5d08884d17a87321d5195ea81
|
102
|
+
rspec-support (3.13.4) sha256=184b1814f6a968102b57df631892c7f1990a91c9a3b9e80ef892a0fc2a71a3f7
|
103
|
+
rubocop (1.78.0) sha256=8b74a6f912eb4fd3e6878851f7f7f45dcad8c7185c34250d4f952b0ee80d6bc0
|
104
|
+
rubocop-ast (1.46.0) sha256=0da7f6ad5b98614f89b74f11873c191059c823eae07d6ffd40a42a3338f2232b
|
105
|
+
rubocop-rspec (3.6.0) sha256=c0e4205871776727e54dee9cc91af5fd74578001551ba40e1fe1a1ab4b404479
|
106
|
+
ruby-progressbar (1.13.0) sha256=80fc9c47a9b640d6834e0dc7b3c94c9df37f08cb072b7761e4a71e22cff29b33
|
107
|
+
unicode-display_width (3.1.4) sha256=8caf2af1c0f2f07ec89ef9e18c7d88c2790e217c482bfc78aaa65eadd5415ac1
|
108
|
+
unicode-emoji (4.0.4) sha256=2c2c4ef7f353e5809497126285a50b23056cc6e61b64433764a35eff6c36532a
|
43
109
|
|
44
110
|
BUNDLED WITH
|
45
|
-
2.
|
111
|
+
2.7.0
|
data/README.md
CHANGED
@@ -4,7 +4,7 @@
|
|
4
4
|
|
5
5
|
`Injectable` is an opinionated and declarative [Dependency Injection](https://en.wikipedia.org/wiki/Dependency_injection) library for ruby.
|
6
6
|
|
7
|
-
It is being used in production (under ruby
|
7
|
+
It is being used in production (under ruby 3.1) in [RubiconMD](https://github.com/rubiconmd) and was extracted from its codebase.
|
8
8
|
|
9
9
|
## Installation
|
10
10
|
|
@@ -339,6 +339,8 @@ After checking out the repo, run `bin/setup` to install dependencies. Then, run
|
|
339
339
|
|
340
340
|
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 tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).
|
341
341
|
|
342
|
+
Please consider configuring [https://editorconfig.org/] on your favourite IDE/editor, so basic file formatting is consistent and avoids cross-platform issues. Some editors require [a plugin](https://editorconfig.org/#download), meanwhile others have it [pre-installed](https://editorconfig.org/#pre-installed).
|
343
|
+
|
342
344
|
## Contributing
|
343
345
|
|
344
346
|
Bug reports and pull requests are welcome on GitHub at https://github.com/rubiconmd/injectable. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant](http://contributor-covenant.org) code of conduct.
|
data/Rakefile
CHANGED
data/bin/console
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
#!/usr/bin/env ruby
|
2
2
|
|
3
|
-
require
|
4
|
-
require
|
3
|
+
require 'bundler/setup'
|
4
|
+
require 'injectable'
|
5
5
|
|
6
6
|
# You can add fixtures and/or initialization code here to make experimenting
|
7
7
|
# with your gem easier. You can also use a different console, if you like.
|
@@ -10,5 +10,5 @@ require "injectable"
|
|
10
10
|
# require "pry"
|
11
11
|
# Pry.start
|
12
12
|
|
13
|
-
require
|
13
|
+
require 'irb'
|
14
14
|
IRB.start(__FILE__)
|
data/injectable.gemspec
CHANGED
@@ -12,18 +12,23 @@ Gem::Specification.new do |spec|
|
|
12
12
|
spec.homepage = 'https://github.com/rubiconmd/injectable'
|
13
13
|
spec.license = 'MIT'
|
14
14
|
|
15
|
+
spec.metadata['rubygems_mfa_required'] = 'true'
|
16
|
+
|
15
17
|
# Specify which files should be added to the gem when it is released.
|
16
18
|
# The `git ls-files -z` loads the files in the RubyGem that have been added into git.
|
17
|
-
spec.files
|
19
|
+
spec.files = Dir.chdir(File.expand_path(__dir__)) do
|
18
20
|
`git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
|
19
21
|
end
|
22
|
+
|
20
23
|
spec.bindir = 'exe'
|
21
24
|
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
22
25
|
spec.require_paths = ['lib']
|
23
|
-
spec.required_ruby_version = '>= 2
|
26
|
+
spec.required_ruby_version = '>= 3.2'
|
24
27
|
|
25
|
-
spec.add_development_dependency 'bundler', '~> 2.
|
26
|
-
spec.add_development_dependency 'pry-byebug'
|
27
|
-
spec.add_development_dependency 'rake', '~> 13.
|
28
|
-
spec.add_development_dependency 'rspec', '~> 3.
|
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.78'
|
33
|
+
spec.add_development_dependency 'rubocop-rspec', '~> 3.6'
|
29
34
|
end
|
@@ -35,9 +35,7 @@ module Injectable
|
|
35
35
|
def wrap_call(the_instance)
|
36
36
|
return the_instance unless call
|
37
37
|
|
38
|
-
if the_instance.respond_to?
|
39
|
-
raise Injectable::MethodAlreadyExistsException
|
40
|
-
end
|
38
|
+
raise(Injectable::MethodAlreadyExistsException) if the_instance.respond_to?(:call)
|
41
39
|
|
42
40
|
the_instance.public_method(call)
|
43
41
|
end
|
@@ -24,12 +24,14 @@ module Injectable
|
|
24
24
|
return if (self.class.ancestors - [Injectable::InstanceMethods]).any? do |ancestor|
|
25
25
|
ancestor.instance_methods(false).include?(:call)
|
26
26
|
end
|
27
|
+
|
27
28
|
raise NoMethodError, "A #call method with zero arity must be defined in #{self.class}"
|
28
29
|
end
|
29
30
|
|
30
31
|
def check_missing_arguments!(expected, args)
|
31
32
|
missing = expected - args.keys
|
32
33
|
return if missing.empty?
|
34
|
+
|
33
35
|
raise ArgumentError, "missing keywords: #{missing.join(',')}"
|
34
36
|
end
|
35
37
|
|
@@ -42,6 +44,7 @@ module Injectable
|
|
42
44
|
def variables_from_dependencies!(args)
|
43
45
|
self.class.dependencies.names.each do |name|
|
44
46
|
next if self.class.initialize_arguments.key?(name)
|
47
|
+
|
45
48
|
instance_variable_set("@#{name}", args[name]) if args.key?(name)
|
46
49
|
end
|
47
50
|
end
|
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: 2.1.
|
4
|
+
version: 2.1.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Papipo
|
@@ -9,10 +9,9 @@ authors:
|
|
9
9
|
- jantequera
|
10
10
|
- amrocco
|
11
11
|
- rewritten
|
12
|
-
autorequire:
|
13
12
|
bindir: exe
|
14
13
|
cert_chain: []
|
15
|
-
date:
|
14
|
+
date: 1980-01-02 00:00:00.000000000 Z
|
16
15
|
dependencies:
|
17
16
|
- !ruby/object:Gem::Dependency
|
18
17
|
name: bundler
|
@@ -20,67 +19,97 @@ dependencies:
|
|
20
19
|
requirements:
|
21
20
|
- - "~>"
|
22
21
|
- !ruby/object:Gem::Version
|
23
|
-
version: '2.
|
22
|
+
version: '2.7'
|
24
23
|
type: :development
|
25
24
|
prerelease: false
|
26
25
|
version_requirements: !ruby/object:Gem::Requirement
|
27
26
|
requirements:
|
28
27
|
- - "~>"
|
29
28
|
- !ruby/object:Gem::Version
|
30
|
-
version: '2.
|
29
|
+
version: '2.7'
|
31
30
|
- !ruby/object:Gem::Dependency
|
32
31
|
name: pry-byebug
|
33
32
|
requirement: !ruby/object:Gem::Requirement
|
34
33
|
requirements:
|
35
|
-
- - "
|
34
|
+
- - "~>"
|
36
35
|
- !ruby/object:Gem::Version
|
37
|
-
version: '
|
36
|
+
version: '3.11'
|
38
37
|
type: :development
|
39
38
|
prerelease: false
|
40
39
|
version_requirements: !ruby/object:Gem::Requirement
|
41
40
|
requirements:
|
42
|
-
- - "
|
41
|
+
- - "~>"
|
43
42
|
- !ruby/object:Gem::Version
|
44
|
-
version: '
|
43
|
+
version: '3.11'
|
45
44
|
- !ruby/object:Gem::Dependency
|
46
45
|
name: rake
|
47
46
|
requirement: !ruby/object:Gem::Requirement
|
48
47
|
requirements:
|
49
48
|
- - "~>"
|
50
49
|
- !ruby/object:Gem::Version
|
51
|
-
version: '13.
|
50
|
+
version: '13.3'
|
52
51
|
type: :development
|
53
52
|
prerelease: false
|
54
53
|
version_requirements: !ruby/object:Gem::Requirement
|
55
54
|
requirements:
|
56
55
|
- - "~>"
|
57
56
|
- !ruby/object:Gem::Version
|
58
|
-
version: '13.
|
57
|
+
version: '13.3'
|
59
58
|
- !ruby/object:Gem::Dependency
|
60
59
|
name: rspec
|
61
60
|
requirement: !ruby/object:Gem::Requirement
|
62
61
|
requirements:
|
63
62
|
- - "~>"
|
64
63
|
- !ruby/object:Gem::Version
|
65
|
-
version: '3.
|
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.78'
|
79
|
+
type: :development
|
80
|
+
prerelease: false
|
81
|
+
version_requirements: !ruby/object:Gem::Requirement
|
82
|
+
requirements:
|
83
|
+
- - "~>"
|
84
|
+
- !ruby/object:Gem::Version
|
85
|
+
version: '1.78'
|
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.6'
|
66
93
|
type: :development
|
67
94
|
prerelease: false
|
68
95
|
version_requirements: !ruby/object:Gem::Requirement
|
69
96
|
requirements:
|
70
97
|
- - "~>"
|
71
98
|
- !ruby/object:Gem::Version
|
72
|
-
version: '3.
|
73
|
-
description:
|
99
|
+
version: '3.6'
|
74
100
|
email:
|
75
101
|
- dev@rubiconmd.com
|
76
102
|
executables: []
|
77
103
|
extensions: []
|
78
104
|
extra_rdoc_files: []
|
79
105
|
files:
|
80
|
-
- ".github/workflows/
|
106
|
+
- ".github/workflows/rspec.yml"
|
107
|
+
- ".github/workflows/rubocop.yml"
|
81
108
|
- ".gitignore"
|
82
109
|
- ".rspec"
|
83
|
-
- ".
|
110
|
+
- ".rubocop.yml"
|
111
|
+
- ".rubocop_todo.yml"
|
112
|
+
- ".ruby-version"
|
84
113
|
- CHANGELOG.md
|
85
114
|
- CODE_OF_CONDUCT.md
|
86
115
|
- Gemfile
|
@@ -103,8 +132,8 @@ files:
|
|
103
132
|
homepage: https://github.com/rubiconmd/injectable
|
104
133
|
licenses:
|
105
134
|
- MIT
|
106
|
-
metadata:
|
107
|
-
|
135
|
+
metadata:
|
136
|
+
rubygems_mfa_required: 'true'
|
108
137
|
rdoc_options: []
|
109
138
|
require_paths:
|
110
139
|
- lib
|
@@ -112,15 +141,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
112
141
|
requirements:
|
113
142
|
- - ">="
|
114
143
|
- !ruby/object:Gem::Version
|
115
|
-
version: '2
|
144
|
+
version: '3.2'
|
116
145
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
117
146
|
requirements:
|
118
147
|
- - ">="
|
119
148
|
- !ruby/object:Gem::Version
|
120
149
|
version: '0'
|
121
150
|
requirements: []
|
122
|
-
rubygems_version: 3.
|
123
|
-
signing_key:
|
151
|
+
rubygems_version: 3.7.0
|
124
152
|
specification_version: 4
|
125
153
|
summary: A library to help you build nice service objects with dependency injection.
|
126
154
|
test_files: []
|