soar_configured_factory 0.1.0 → 0.1.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/README.md +28 -9
- data/lib/soar_configured_factory/version.rb +1 -1
- data/sanity/Gemfile +1 -0
- data/sanity/sanity.rb +11 -1
- data/soar_configured_factory.gemspec +2 -2
- metadata +4 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d2951abb4e9bac4a74126c6e0b0518e903fff036
|
4
|
+
data.tar.gz: 1c824fcd3ef75d7bf0a9a042e29da8e96ba136f9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 54a47f7f6f4de1c68a0cd492522f48887aeef48870985bd87d129ba3af79bc040e6e4e49be55b7e0eab1afc282b79375314f09f49c14a3f56cf2621b0c85282b
|
7
|
+
data.tar.gz: a0e72028ca43306d00c567f901747fb682c02a46f7f8225d94b9be2215762f9862b23a6b8b03a1d0f474b3b644a04dd4af04f3b5a58a68ac0a43bb3060f1e402
|
data/README.md
CHANGED
@@ -1,14 +1,6 @@
|
|
1
1
|
# SoarConfiguredFactory
|
2
2
|
|
3
|
-
|
4
|
-
|
5
|
-
This gem provides the thread worker that workers in the SOAR architecture can extend from for threading purposes.
|
6
|
-
|
7
|
-
```ruby
|
8
|
-
class MyConfiguredFactory < SoarConfiguredFactory::ConfiguredFactory
|
9
|
-
end
|
10
|
-
@factory = MyConfiguredFactory.new
|
11
|
-
```
|
3
|
+
This gem provides the basic factory for the SOAR architecture. The factory creates objects based on adaptors specified in the configuration.
|
12
4
|
|
13
5
|
## Installation
|
14
6
|
|
@@ -34,9 +26,36 @@ Run the rspec test tests:
|
|
34
26
|
|
35
27
|
## Usage
|
36
28
|
|
29
|
+
Create the factory by instantiating it with the configuration containing the adaptor classes:
|
30
|
+
|
31
|
+
```ruby
|
32
|
+
configuration = {
|
33
|
+
'type_a' => {
|
34
|
+
'adaptor' => 'type_a_class::type_a',
|
35
|
+
'some other configuration' => 'the object of class type_a will need'
|
36
|
+
}
|
37
|
+
}
|
38
|
+
my_factory = SoarConfiguredFactory::ConfiguredFactory.new(configuration)
|
39
|
+
```
|
40
|
+
|
41
|
+
Create objects using the factory by simply calling create:
|
42
|
+
```ruby
|
43
|
+
my_object = my_factory.create('type_a')
|
44
|
+
```
|
37
45
|
|
38
46
|
## Detailed example
|
39
47
|
|
48
|
+
```ruby
|
49
|
+
configuration = {
|
50
|
+
'log4r' => {
|
51
|
+
'adaptor' => 'Log4rAuditor::Log4rAuditor',
|
52
|
+
'file_name' => 'soar_sc.log',
|
53
|
+
'standard_stream' => 'stdout',
|
54
|
+
}
|
55
|
+
}
|
56
|
+
auditor_factory = SoarConfiguredFactory::ConfiguredFactory.new(configuration)
|
57
|
+
auditor = auditor_factory.create('log4r')
|
58
|
+
```
|
40
59
|
|
41
60
|
## Contributing
|
42
61
|
|
data/sanity/Gemfile
CHANGED
data/sanity/sanity.rb
CHANGED
@@ -1,8 +1,18 @@
|
|
1
1
|
require 'soar_configured_factory'
|
2
|
+
require 'log4r_auditor'
|
2
3
|
|
3
4
|
class Main
|
4
|
-
|
5
5
|
def test_sanity
|
6
|
+
configuration = {
|
7
|
+
'log4r' => {
|
8
|
+
'adaptor' => 'Log4rAuditor::Log4rAuditor',
|
9
|
+
'file_name' => 'soar_sc.log',
|
10
|
+
'standard_stream' => 'stdout',
|
11
|
+
}
|
12
|
+
}
|
13
|
+
auditor_factory = SoarConfiguredFactory::ConfiguredFactory.new(configuration)
|
14
|
+
auditor = auditor_factory.create('log4r')
|
15
|
+
puts auditor
|
6
16
|
end
|
7
17
|
end
|
8
18
|
|
@@ -6,8 +6,8 @@ require 'soar_configured_factory/version'
|
|
6
6
|
Gem::Specification.new do |spec|
|
7
7
|
spec.name = "soar_configured_factory"
|
8
8
|
spec.version = SoarConfiguredFactory::VERSION
|
9
|
-
spec.authors = ["Barney de Villiers"]
|
10
|
-
spec.email = ["barney.de.villiers@hetzner.co.za"]
|
9
|
+
spec.authors = ["Ernst Van Graan", "Barney de Villiers"]
|
10
|
+
spec.email = ["ernst.van.graan@hetzner.co.za", "barney.de.villiers@hetzner.co.za"]
|
11
11
|
|
12
12
|
spec.summary = %q{Configured Factory for SOAR architecture}
|
13
13
|
spec.description = %q{Configured Factory for SOAR architecture providing basic factory using provided configuration}
|
metadata
CHANGED
@@ -1,14 +1,15 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: soar_configured_factory
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
|
+
- Ernst Van Graan
|
7
8
|
- Barney de Villiers
|
8
9
|
autorequire:
|
9
10
|
bindir: exe
|
10
11
|
cert_chain: []
|
11
|
-
date: 2016-
|
12
|
+
date: 2016-08-23 00:00:00.000000000 Z
|
12
13
|
dependencies:
|
13
14
|
- !ruby/object:Gem::Dependency
|
14
15
|
name: bundler
|
@@ -69,6 +70,7 @@ dependencies:
|
|
69
70
|
description: Configured Factory for SOAR architecture providing basic factory using
|
70
71
|
provided configuration
|
71
72
|
email:
|
73
|
+
- ernst.van.graan@hetzner.co.za
|
72
74
|
- barney.de.villiers@hetzner.co.za
|
73
75
|
executables: []
|
74
76
|
extensions: []
|