hypo 0.6.1 → 0.6.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 570be7a2692c701a65a85bf763ba51cba31ba7cf
4
- data.tar.gz: 5f6524db0fa6e97cd66165464739465878a14580
3
+ metadata.gz: 1671c3b418f72e704152244916967ebe0c2288d4
4
+ data.tar.gz: 55fde3998486b713e045de9878e45fa5ac336242
5
5
  SHA512:
6
- metadata.gz: a3ee766a7b565241e51fc2baf8843e9712657e0d790745ec747c1513f02d1580be11088820e5516a3e594ecae2bcfa34611f6f121242bfd4ce62cff88214cc67
7
- data.tar.gz: ab4f9f1f0624d3c39ed6f93d50dc6ff4c98b63c77667e3f98dce7a40122fc8096d3c0f92dffb9259cc801218f260454f56a6a5a0710cfb3c79b0119d4334430b
6
+ metadata.gz: bcd9ba4639e366d6f74f7275561aa9bc4c2a84c16907f7521dfb07c63564d8d4dcf9f011b7ff68738a8108ee3c7747d3eb6c48371d79f69aa7a25af052d76fe2
7
+ data.tar.gz: 267d919d6d1c9a2316747c47a3f94f95072a55137972cd8aa93ee4c471577b298fc7d165dc959f0ee9842afba1e3cd0a49666bb015789a3a392acad84104fdf7
@@ -1,6 +1,8 @@
1
1
  require 'hypo/container_error'
2
2
  require 'hypo/component'
3
3
  require 'hypo/instance'
4
+ require 'hypo/life_cycle/transient'
5
+ require 'hypo/life_cycle/singleton'
4
6
 
5
7
  module Hypo
6
8
  class Container
@@ -19,7 +21,7 @@ module Hypo
19
21
  component = type.new(item, self, name)
20
22
 
21
23
  if @components.key?(component.name)
22
- raise ContainerError, "Component of type \"#{component.type.to_s}\" has already been registered"
24
+ raise ContainerError, "Component \"#{component.name}\" has already been registered"
23
25
  end
24
26
 
25
27
  @components[component.name] = component
@@ -33,6 +35,10 @@ module Hypo
33
35
  @components[name].instance
34
36
  end
35
37
 
38
+ def remove(name)
39
+ @components.delete(name)
40
+ end
41
+
36
42
  def add_life_cycle(life_cycle, name)
37
43
  @life_cycles[name] = life_cycle
38
44
 
data/lib/hypo/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Hypo
2
- VERSION = '0.6.1'
2
+ VERSION = '0.6.2'
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: hypo
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.6.1
4
+ version: 0.6.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Vladimir Kalinkin