soar_configured_factory 0.1.0 → 0.1.1

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: 835aaeae1a41514b29dcb57e0f498d9449d33791
4
- data.tar.gz: 062ad8df8403f63187024af0aebb46bd3ca268b9
3
+ metadata.gz: d2951abb4e9bac4a74126c6e0b0518e903fff036
4
+ data.tar.gz: 1c824fcd3ef75d7bf0a9a042e29da8e96ba136f9
5
5
  SHA512:
6
- metadata.gz: 14ec96e6953e71b9aeb7ba8fe77bdbde961602ab00c6fc57374d4866179e965bfd58e352f93b31c12ec7dfa9d14d618ff54493f20db2724a0c1635457bc950ba
7
- data.tar.gz: 134a6fd6cfcfdd31e65856ce5e55137f3eeecd53f4c71a18d9c7520c784c5cacfc05c2e47fef8df77fe65f2f831bae9ec63ad263c2220874cf1c94242ea20adc
6
+ metadata.gz: 54a47f7f6f4de1c68a0cd492522f48887aeef48870985bd87d129ba3af79bc040e6e4e49be55b7e0eab1afc282b79375314f09f49c14a3f56cf2621b0c85282b
7
+ data.tar.gz: a0e72028ca43306d00c567f901747fb682c02a46f7f8225d94b9be2215762f9862b23a6b8b03a1d0f474b3b644a04dd4af04f3b5a58a68ac0a43bb3060f1e402
data/README.md CHANGED
@@ -1,14 +1,6 @@
1
1
  # SoarConfiguredFactory
2
2
 
3
- [![Build Status](http://soar-ci.dev.auto-h.net:8080/job/soar_configured_factory/badge/icon)](http://soar-ci.dev.auto-h.net:8080/job/soar_configured_factory)
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
 
@@ -1,3 +1,3 @@
1
1
  module SoarConfiguredFactory
2
- VERSION = "0.1.0"
2
+ VERSION = "0.1.1"
3
3
  end
data/sanity/Gemfile CHANGED
@@ -1,3 +1,4 @@
1
1
  source 'https://rubygems.org'
2
2
 
3
3
  gem 'soar_configured_factory', :path => "../"
4
+ gem 'log4r_auditor', '~> 0.0.4'
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.0
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-07-28 00:00:00.000000000 Z
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: []