scorpion-ioc 0.5.17 → 0.5.18
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.ruby-version +1 -1
- data/Gemfile +1 -0
- data/lib/scorpion.rb +11 -0
- data/lib/scorpion/rails/nest.rb +2 -2
- data/lib/scorpion/version.rb +1 -1
- metadata +3 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 42be77fc3302846ea5024d902c5b5d54e5a51691
|
4
|
+
data.tar.gz: 898c87cbc1341f97922696e85b883a4bb4c8a0a5
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b5bcc6fd2fa5e4323fe1afc0dbe83cf8a0c0b525728bc51f16af17821b66e3e18986e6457f4aa3c0587ac0fdc670025776b3c0c231bbcc256cb39c3e07b0e894
|
7
|
+
data.tar.gz: 61bcd4a087be0c3283c138728ac3880dce307324d51bbe217aed85da627ccacde05686fcdec21404ea3bc733c01a41691a88fa271f28080fab2f9d01c44e198d
|
data/.ruby-version
CHANGED
@@ -1 +1 @@
|
|
1
|
-
2.
|
1
|
+
2.3.1
|
data/Gemfile
CHANGED
data/lib/scorpion.rb
CHANGED
@@ -114,11 +114,22 @@ module Scorpion
|
|
114
114
|
# level code (controllers, scripts, etc.) should explicitly access these
|
115
115
|
# methods.
|
116
116
|
|
117
|
+
# @!attribute instance
|
117
118
|
# @return [Scorpion] main scorpion for the app.
|
118
119
|
def self.instance
|
120
|
+
@instance_referenced = true
|
119
121
|
@instance
|
120
122
|
end
|
121
123
|
@instance = Scorpion::Hunter.new
|
124
|
+
@instance_referenced = false
|
125
|
+
|
126
|
+
def self.instance=( scorpion )
|
127
|
+
if @instance_referenced
|
128
|
+
logger.warn "Replacing the global Scorpion.instance will not update any Scorpion::Nest instances created with the original scorpion."
|
129
|
+
@instance_referenced = false
|
130
|
+
end
|
131
|
+
@instance = scorpion
|
132
|
+
end
|
122
133
|
|
123
134
|
# Prepare the {#instance} for hunting.
|
124
135
|
# @param [Boolean] reset true to free all existing resource and initialize a
|
data/lib/scorpion/rails/nest.rb
CHANGED
@@ -43,7 +43,7 @@ module Scorpion
|
|
43
43
|
# @return [Scorpion::Nest] the nest used to conceive scorpions to
|
44
44
|
# hunt for objects on each request.
|
45
45
|
def self.nest
|
46
|
-
nest_instance
|
46
|
+
nest_instance || ( self.nest = Scorpion.instance.build_nest )
|
47
47
|
end
|
48
48
|
def self.nest=( value )
|
49
49
|
nest_instance.destroy if nest_instance
|
@@ -82,7 +82,7 @@ module Scorpion
|
|
82
82
|
end
|
83
83
|
end
|
84
84
|
end
|
85
|
-
|
85
|
+
|
86
86
|
|
87
87
|
super
|
88
88
|
end
|
data/lib/scorpion/version.rb
CHANGED
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: 0.5.
|
4
|
+
version: 0.5.18
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Paul Alexander
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-
|
11
|
+
date: 2016-09-23 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|
@@ -219,7 +219,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
219
219
|
version: '0'
|
220
220
|
requirements: []
|
221
221
|
rubyforge_project:
|
222
|
-
rubygems_version: 2.5.
|
222
|
+
rubygems_version: 2.5.1
|
223
223
|
signing_key:
|
224
224
|
specification_version: 4
|
225
225
|
summary: Add IoC to rails with minimal fuss and ceremony
|
@@ -254,4 +254,3 @@ test_files:
|
|
254
254
|
- spec/lib/scorpion/rspec/helper_spec.rb
|
255
255
|
- spec/lib/scorpion_spec.rb
|
256
256
|
- spec/spec_helper.rb
|
257
|
-
has_rdoc:
|