sinject 0.2.4 → 1.0.0

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.
@@ -0,0 +1,9 @@
1
+ module Sinject
2
+ class ContainerItem
3
+ attr_accessor :key
4
+ attr_accessor :instance
5
+ attr_accessor :single_instance
6
+ attr_accessor :class_name
7
+ attr_accessor :initialize_block
8
+ end
9
+ end
@@ -0,0 +1,17 @@
1
+ module Sinject
2
+ class DependencyGroup
3
+
4
+ def register(container)
5
+
6
+ end
7
+
8
+ def is_valid?
9
+ return true
10
+ end
11
+
12
+ def self.descendants
13
+ ObjectSpace.each_object(Class).select { |klass| klass < self }
14
+ end
15
+
16
+ end
17
+ end
@@ -0,0 +1,64 @@
1
+ module Sinject
2
+ class DependencyContractMissingMethodsException < StandardError
3
+ def initialize(methods)
4
+ @methods = methods
5
+ end
6
+
7
+ def to_s
8
+ method_names = @methods.join(', ')
9
+ "The following methods have not been implemented: '#{method_names}'"
10
+ end
11
+ end
12
+
13
+ class DependencyContractInvalidParametersException < StandardError
14
+ def initialize(method, parameters)
15
+ @method = method
16
+ @parameters = parameters
17
+ end
18
+
19
+ def to_s
20
+ parameter_names = @parameters.join(', ')
21
+ "The method signature of method: '#{@method}' does not match the contract parameters: '#{parameter_names}'"
22
+ end
23
+ end
24
+
25
+ class DependencyInitializeException < StandardError
26
+
27
+ def initialize(expected_type)
28
+ @expected_type = expected_type
29
+ end
30
+
31
+ def to_s
32
+ "The custom dependency initializer does not return an object of the expected type: '#{@expected_type}'"
33
+ end
34
+
35
+ end
36
+
37
+ class DependencyRegistrationException < StandardError
38
+
39
+ def initialize(key)
40
+ @key = key
41
+ end
42
+
43
+ def to_s
44
+ "A Dependency has already been registered for the key: '#{key}'"
45
+ end
46
+
47
+ end
48
+
49
+ class DependencyRegistrationKeyNotSpecifiedException < StandardError
50
+
51
+ def to_s
52
+ "A key must be specified to register a dependency."
53
+ end
54
+
55
+ end
56
+
57
+ class DependencyRegistrationClassNotSpecifiedException < StandardError
58
+
59
+ def to_s
60
+ "A dependency class must be specified to register a dependency."
61
+ end
62
+
63
+ end
64
+ end
@@ -1,3 +1,3 @@
1
1
  module Sinject
2
- VERSION = "0.2.4"
2
+ VERSION = "1.0.0"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sinject
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.4
4
+ version: 1.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - vaughan britton
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2016-03-03 00:00:00.000000000 Z
11
+ date: 2016-04-29 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -59,7 +59,14 @@ executables: []
59
59
  extensions: []
60
60
  extra_rdoc_files: []
61
61
  files:
62
+ - ".DS_Store"
62
63
  - ".gitignore"
64
+ - ".idea/.rakeTasks"
65
+ - ".idea/misc.xml"
66
+ - ".idea/modules.xml"
67
+ - ".idea/sinject.iml"
68
+ - ".idea/vcs.xml"
69
+ - ".idea/workspace.xml"
63
70
  - ".rspec"
64
71
  - CODE_OF_CONDUCT.md
65
72
  - Gemfile
@@ -69,6 +76,11 @@ files:
69
76
  - bin/console
70
77
  - bin/setup
71
78
  - lib/sinject.rb
79
+ - lib/sinject/class.rb
80
+ - lib/sinject/container.rb
81
+ - lib/sinject/container_item.rb
82
+ - lib/sinject/dependency_group.rb
83
+ - lib/sinject/exceptions.rb
72
84
  - lib/sinject/version.rb
73
85
  - sinject.gemspec
74
86
  homepage: https://github.com/vaughanbrittonsage/sinject