scorpion-ioc 1.0.0 → 1.0.1
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/lib/scorpion/object.rb +2 -2
- data/lib/scorpion/version.rb +1 -1
- data/spec/lib/scorpion/object_spec.rb +10 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8bcefe82f54c3f0dd48602205116198a0648c419
|
4
|
+
data.tar.gz: 1789116607e25c58cf48be18b1c9079724a6e591
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 02e503ad56f4fa1229bb79471dd21790f5f2f31290fb6707cbd1a9c0110fd37df6e9b3f20b6517a4355ca8545cbc63c29de48e41ad116328a1ce580be043f279
|
7
|
+
data.tar.gz: a951682ffc0a35358bcfc6f531784849a4ba788ee3425209af1741010d52fb93b889ce52b24f75d5c49c6d34022c05cc855a6be5a6ddde494758095878c39adc
|
data/lib/scorpion/object.rb
CHANGED
@@ -122,8 +122,8 @@ module Scorpion
|
|
122
122
|
# Define a single dependency and accessor.
|
123
123
|
# @param [Symbol] name of the dependency.
|
124
124
|
# @param [Class,Module,Symbol] contract describing the desired behavior of the dependency.
|
125
|
-
def attr_dependency( name, contract, &block )
|
126
|
-
attr = injected_attributes.define_attribute name, contract, &block
|
125
|
+
def attr_dependency( name, contract, **options, &block )
|
126
|
+
attr = injected_attributes.define_attribute name, contract, **options, &block
|
127
127
|
build_injected_attribute attr
|
128
128
|
adjust_injected_attribute_visibility attr
|
129
129
|
validate_initializer_injections
|
data/lib/scorpion/version.rb
CHANGED
@@ -129,6 +129,16 @@ describe Scorpion::Object do
|
|
129
129
|
|
130
130
|
expect( klass.new ).to respond_to :logger
|
131
131
|
end
|
132
|
+
|
133
|
+
it "defines attributes with options" do
|
134
|
+
klass = Class.new do
|
135
|
+
include Scorpion::Object
|
136
|
+
|
137
|
+
attr_dependency :logger, Test::Object::Logger, lazy: true
|
138
|
+
end
|
139
|
+
|
140
|
+
expect( klass.new ).to respond_to :logger
|
141
|
+
end
|
132
142
|
end
|
133
143
|
|
134
144
|
describe "inheritance" do
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: scorpion-ioc
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Paul Alexander
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-10-
|
11
|
+
date: 2017-10-12 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|