scorpion-ioc 0.5.17 → 0.5.18

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 54b4e38bcbe61c32aeff6adc0138857fbd9d0203
4
- data.tar.gz: 373bf814dc967bb59c44beb38b7c2de9e3b503ba
3
+ metadata.gz: 42be77fc3302846ea5024d902c5b5d54e5a51691
4
+ data.tar.gz: 898c87cbc1341f97922696e85b883a4bb4c8a0a5
5
5
  SHA512:
6
- metadata.gz: 700caed2c071bb394be1c0d451440064f6d1e8bfc1ffb37f12af1b65387c0be7e2da7c81de02d765603ac87b37d28213fa1692392fa4672c4712349b628b3ca4
7
- data.tar.gz: 5f3e64a7229831ad4d1a6311f1d199fc5a09b84a6bfd8b015073f1c26542a24f0ee671044af6f3949db88dd446ab2bd8187211127fdaae6dbc0381592b8b75b8
6
+ metadata.gz: b5bcc6fd2fa5e4323fe1afc0dbe83cf8a0c0b525728bc51f16af17821b66e3e18986e6457f4aa3c0587ac0fdc670025776b3c0c231bbcc256cb39c3e07b0e894
7
+ data.tar.gz: 61bcd4a087be0c3283c138728ac3880dce307324d51bbe217aed85da627ccacde05686fcdec21404ea3bc733c01a41691a88fa271f28080fab2f9d01c44e198d
@@ -1 +1 @@
1
- 2.2.2
1
+ 2.3.1
data/Gemfile CHANGED
@@ -15,6 +15,7 @@ group :test do
15
15
  gem 'simplecov', github: "colszowka/simplecov"
16
16
  gem 'ruby_gntp', '~> 0.3.4'
17
17
  gem 'awesome_print'
18
+ gem 'nokogiri', '1.6.7.2'
18
19
 
19
20
  gem "codeclimate-test-reporter", group: :test, require: nil
20
21
  end
@@ -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
@@ -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
- base.nest ||= Scorpion.instance.build_nest
85
+
86
86
 
87
87
  super
88
88
  end
@@ -1,5 +1,5 @@
1
1
  module Scorpion
2
- VERSION_NUMBER = "0.5.17"
2
+ VERSION_NUMBER = "0.5.18"
3
3
  VERSION_SUFFIX = ""
4
4
  VERSION = "#{VERSION_NUMBER}#{VERSION_SUFFIX}"
5
5
  end
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.17
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-04-27 00:00:00.000000000 Z
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.0
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: