cayuga 0.0.3 → 0.0.4
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/.idea/.rakeTasks +1 -1
- data/.idea/dictionaries/patrick.xml +1 -0
- data/.idea/workspace.xml +564 -413
- data/cayuga.gemspec +1 -0
- data/cayuga.iml +1 -0
- data/lib/cayuga/object/constants.rb +17 -1
- data/lib/cayuga/object/factory.rb +6 -5
- data/lib/cayuga/object/named_object.rb +1 -1
- data/lib/cayuga/object/object.rb +4 -0
- data/lib/cayuga/object/singleton.rb +1 -0
- data/lib/cayuga/version.rb +1 -1
- metadata +16 -2
data/cayuga.gemspec
CHANGED
data/cayuga.iml
CHANGED
@@ -18,6 +18,7 @@
|
|
18
18
|
<orderEntry type="library" scope="PROVIDED" name="diff-lcs (v1.3, ruby-2.4.4-p296) [gem]" level="application" />
|
19
19
|
<orderEntry type="library" scope="PROVIDED" name="facets (v3.1.0, ruby-2.4.4-p296) [gem]" level="application" />
|
20
20
|
<orderEntry type="library" scope="PROVIDED" name="file-tail (v1.2.0, ruby-2.4.4-p296) [gem]" level="application" />
|
21
|
+
<orderEntry type="library" scope="PROVIDED" name="ice_nine (v0.11.2, ruby-2.4.4-p296) [gem]" level="application" />
|
21
22
|
<orderEntry type="library" scope="PROVIDED" name="memoist (v0.16.0, ruby-2.4.4-p296) [gem]" level="application" />
|
22
23
|
<orderEntry type="library" scope="PROVIDED" name="rake (v10.5.0, ruby-2.4.4-p296) [gem]" level="application" />
|
23
24
|
<orderEntry type="library" scope="PROVIDED" name="rspec (v3.8.0, ruby-2.4.4-p296) [gem]" level="application" />
|
@@ -6,20 +6,36 @@ require 'cayuga'
|
|
6
6
|
module Cayuga
|
7
7
|
module Object
|
8
8
|
class Constants < Singleton
|
9
|
+
def constant(constant)
|
10
|
+
constants[constant.symbolize]
|
11
|
+
end
|
12
|
+
|
13
|
+
alias [] :constant
|
9
14
|
|
10
15
|
def directory(constant)
|
11
16
|
directories[constant.symbolize]
|
12
17
|
end
|
13
18
|
|
19
|
+
def file(constant)
|
20
|
+
files[constant.symbolize]
|
21
|
+
end
|
22
|
+
|
23
|
+
def repository(constant)
|
24
|
+
repositories[constant.symbolize]
|
25
|
+
end
|
26
|
+
|
14
27
|
private_class_method :new
|
15
28
|
|
16
29
|
private
|
17
30
|
|
18
|
-
attr_reader :factory, :directories
|
31
|
+
attr_reader :factory, :constants, :directories, :files, :repositories
|
19
32
|
|
20
33
|
def initialize(factory, configuration)
|
21
34
|
super
|
35
|
+
@constants = configuration[:constants]
|
22
36
|
@directories = configuration[:directories]
|
37
|
+
@files = configuration[:files]
|
38
|
+
@repositories = configuration[:repositories]
|
23
39
|
end
|
24
40
|
|
25
41
|
end
|
@@ -2,6 +2,8 @@
|
|
2
2
|
# Copyright (c) 2018 Patrick Thomas. All rights reserved.
|
3
3
|
#
|
4
4
|
require 'json'
|
5
|
+
require 'ice_nine'
|
6
|
+
require 'ice_nine/core_ext/object'
|
5
7
|
require 'cayuga'
|
6
8
|
|
7
9
|
module Cayuga
|
@@ -83,13 +85,12 @@ module Cayuga
|
|
83
85
|
attr_reader :configuration, :types, :instances
|
84
86
|
|
85
87
|
def initialize(config)
|
86
|
-
@configuration = JSON.parse(File.read(config), symbolize_names: true)
|
88
|
+
@configuration = JSON.parse(File.read(config), symbolize_names: true).deep_freeze
|
87
89
|
@configuration_name = configuration[:configuration_name]
|
88
90
|
@logs_directory = configuration[:directories][:logs]
|
89
91
|
@types = {}
|
90
|
-
|
91
|
-
register_classes(configuration[:
|
92
|
-
# register_classes(INDEXED_CLASSES, :indexed)
|
92
|
+
register_classes(configuration[:object_classes],:object)
|
93
|
+
register_classes(configuration[:singleton_classes], :singleton)
|
93
94
|
register_classes(
|
94
95
|
configuration[:named_object_classes], :named
|
95
96
|
)
|
@@ -119,7 +120,7 @@ module Cayuga
|
|
119
120
|
# unless klass == LoggerFactory
|
120
121
|
# log.info("factory #{klass} created ")
|
121
122
|
# end
|
122
|
-
when :singleton
|
123
|
+
when :object, :singleton
|
123
124
|
object = klass.create(self, configuration)
|
124
125
|
# log.info("singleton #{klass} created ")
|
125
126
|
when :named
|
data/lib/cayuga/object/object.rb
CHANGED
data/lib/cayuga/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: cayuga
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- patrick
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-11-
|
11
|
+
date: 2018-11-19 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -108,6 +108,20 @@ dependencies:
|
|
108
108
|
- - "~>"
|
109
109
|
- !ruby/object:Gem::Version
|
110
110
|
version: '0.16'
|
111
|
+
- !ruby/object:Gem::Dependency
|
112
|
+
name: ice_nine
|
113
|
+
requirement: !ruby/object:Gem::Requirement
|
114
|
+
requirements:
|
115
|
+
- - "~>"
|
116
|
+
- !ruby/object:Gem::Version
|
117
|
+
version: '0.11'
|
118
|
+
type: :development
|
119
|
+
prerelease: false
|
120
|
+
version_requirements: !ruby/object:Gem::Requirement
|
121
|
+
requirements:
|
122
|
+
- - "~>"
|
123
|
+
- !ruby/object:Gem::Version
|
124
|
+
version: '0.11'
|
111
125
|
description:
|
112
126
|
email:
|
113
127
|
- peateas@gmail.com
|