carioca 2.0.3 → 2.0.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/README.md +27 -18
- data/lib/carioca/configuration.rb +8 -3
- data/lib/carioca/constants.rb +1 -1
- data/lib/carioca/dependencies.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: df2fae455d522ba26500abac0d203b29e1b173391b2e9eb9c27f9de83f282a55
|
4
|
+
data.tar.gz: 5e34e6d5b0eef09348906b45f6bb5c2db3d1874c6d4f3f05c5a017baca5f5da1
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: fad3b4fcbf8beb5811458891ad529a405fe85f19af613eb986369e51573eb87524d5849a566e7009a1a6c8d6f142e5a6f60a5e3ce82f9b60e82cabcfc814d02b
|
7
|
+
data.tar.gz: 1049e060ed5326a3f67acea98258fca5c2880f46ae1edc3b1d08070e7012d374d975c062e076adfb2a127e0f3027ba0117b57ba97bc06f43d1ab3f904f63a0a4
|
data/Gemfile.lock
CHANGED
data/README.md
CHANGED
@@ -1,5 +1,8 @@
|
|
1
1
|
# Carioca
|
2
2
|
|
3
|
+
Carioca : Container And Registry with Inversion Of Control for your Applications
|
4
|
+
|
5
|
+
Carioca 2: is a complete rewrite who provide a full IoC/DI light Container and a services registry, build with logs, config and Internationalization facilities for designing your applications
|
3
6
|
## Installation
|
4
7
|
|
5
8
|
Install it yourself as:
|
@@ -35,17 +38,21 @@ require "carioca/rake/manage"
|
|
35
38
|
Verify, all is right with :
|
36
39
|
|
37
40
|
$ rake -T
|
38
|
-
rake build # Build
|
41
|
+
rake build # Build sample-0.1.0.gem into the pkg directory
|
42
|
+
rake carioca:gem:init_path # prepare Gem vitals path for Carioca
|
39
43
|
rake carioca:registry:add_service # Adding service to Carioca Registry file
|
44
|
+
rake carioca:services:config:init # Initialise Service configuration file ./config/settings.yml file
|
40
45
|
rake clean # Remove any temporary products
|
41
46
|
rake clobber # Remove any generated files
|
42
|
-
rake install # Build and install
|
43
|
-
rake install:local # Build and install
|
44
|
-
rake release[remote] # Create tag v0.1.0 and build and push
|
47
|
+
rake install # Build and install sample-0.1.0.gem into system gems
|
48
|
+
rake install:local # Build and install sample-0.1.0.gem into system gems without network access
|
49
|
+
rake release[remote] # Create tag v0.1.0 and build and push sample-0.1.0.gem to Set to 'http://mygemserver.com'
|
45
50
|
rake spec # Run RSpec code examples
|
46
51
|
|
47
52
|
You could now initialize the Carioca registry following the wizard, with (sample with a simple UUID generator gem):
|
48
53
|
|
54
|
+
$ rake carioca:gem:init_path
|
55
|
+
Carioca : Initialising vitals gem path : done
|
49
56
|
$ rake carioca:registry:add_service
|
50
57
|
Carioca : registering service :
|
51
58
|
Registry File path ? ./config/carioca.registry
|
@@ -63,7 +70,7 @@ You could now initialize the Carioca registry following the wizard, with (sample
|
|
63
70
|
* service: UUID
|
64
71
|
* resource: uuid
|
65
72
|
Is it correct ? Yes
|
66
|
-
Carioca : Registry
|
73
|
+
Carioca : Registry saving : done
|
67
74
|
|
68
75
|
This will initiate a Carioca Registry (YAML file, the format will be describe after, the wizard support all type of services, managed by Carioca, all keys are Symbols):
|
69
76
|
|
@@ -132,19 +139,21 @@ After this, don't forget to stage new files, and you could build & install the g
|
|
132
139
|
$ rake install && yourgem_cmd
|
133
140
|
yourgem 0.1.0 built to pkg/yourgem-0.1.0.gem.
|
134
141
|
yourgem (0.1.0) installed.
|
135
|
-
D, [2022-03-
|
136
|
-
D, [2022-03-
|
137
|
-
D, [2022-03-
|
138
|
-
D, [2022-03-
|
139
|
-
D, [2022-03-
|
140
|
-
D, [2022-03-
|
141
|
-
D, [2022-03-
|
142
|
-
D, [2022-03-
|
143
|
-
D, [2022-03-
|
144
|
-
|
145
|
-
|
146
|
-
|
147
|
-
|
142
|
+
D, [2022-03-07T01:06:20.337961 #21513] DEBUG -- Carioca: Preloaded service :i18n on locale : en
|
143
|
+
D, [2022-03-07T01:06:20.338020 #21513] DEBUG -- Carioca: Preloaded service :logger ready on STDOUT
|
144
|
+
D, [2022-03-07T01:06:20.338037 #21513] DEBUG -- Carioca: Initializing Carioca registry
|
145
|
+
D, [2022-03-07T01:06:20.338049 #21513] DEBUG -- Carioca: Preparing builtins services
|
146
|
+
D, [2022-03-07T01:06:20.338079 #21513] DEBUG -- Carioca: Adding service configuration
|
147
|
+
D, [2022-03-07T01:06:20.338107 #21513] DEBUG -- Carioca: Adding service i18n
|
148
|
+
D, [2022-03-07T01:06:20.338133 #21513] DEBUG -- Carioca: Adding service output
|
149
|
+
D, [2022-03-07T01:06:20.338156 #21513] DEBUG -- Carioca: Adding service debugger
|
150
|
+
D, [2022-03-07T01:06:20.338191 #21513] DEBUG -- Carioca: Initializing registry from file : ./config/carioca.registry
|
151
|
+
D, [2022-03-07T01:06:20.338312 #21513] DEBUG -- Carioca: Adding service uuid
|
152
|
+
D, [2022-03-07T01:06:20.338333 #21513] DEBUG -- Carioca: Registry initialized successfully
|
153
|
+
I, [2022-03-07T01:06:20.338340 #21513] INFO -- Sample::YourGemCMD: Log me as class method
|
154
|
+
I, [2022-03-07T01:06:20.338351 #21513] INFO -- #<Sample::YourGemCMD:0x0000000148270698>: Log me as an instance method
|
155
|
+
D, [2022-03-07T01:06:20.338381 #21513] DEBUG -- Carioca: Starting service uuid
|
156
|
+
W, [2022-03-07T01:06:20.353142 #21513] WARN -- Sample::YourGemCMD: Give me an UUID : 574cc860-7fd8-013a-2323-1e00870a7189
|
148
157
|
|
149
158
|
You could see, somme interesting things :
|
150
159
|
* Carioca have an internationalisation service (this service will be explain in detail after):
|
@@ -4,8 +4,8 @@ module Carioca
|
|
4
4
|
include Carioca::Helpers
|
5
5
|
attr_accessor :filename, :name, :builtins, :log_target, :default_locale, :locales_load_path, :debugger_tracer
|
6
6
|
attr_accessor :config_file, :config_root, :environment, :supported_environment, :output_mode, :log_level
|
7
|
-
attr_writer :
|
8
|
-
attr_reader :log_file, :locales_availables
|
7
|
+
attr_writer :init_from_file, :output_colors, :output_emoji
|
8
|
+
attr_reader :log_file, :locales_availables, :debug
|
9
9
|
def initialize
|
10
10
|
@init_from_file = true
|
11
11
|
@filename = DEFAULT_REGISTRY_FILE.dup
|
@@ -14,7 +14,6 @@ module Carioca
|
|
14
14
|
@builtins = BUILTINS
|
15
15
|
@log_file = ''
|
16
16
|
@log_level = DEFAULT_LOG_LEVEL.dup
|
17
|
-
@log_level = :info if @debug == false and @log_level == :debug
|
18
17
|
@config_file = DEFAULT_CONFIG_FILE.dup
|
19
18
|
@environment = DEFAULT_ENVIRONMENT.dup
|
20
19
|
@config_root = DEFAULT_CONFIG_ROOT.dup
|
@@ -33,6 +32,12 @@ module Carioca
|
|
33
32
|
@debugger_tracer = DEFAULT_DEBUGGER_TRACER.dup
|
34
33
|
end
|
35
34
|
|
35
|
+
def debug=(state)
|
36
|
+
@debug = state
|
37
|
+
@log_level = :info if @debug == false and @log_level == :debug
|
38
|
+
@log_level = :debug if @debug == true
|
39
|
+
end
|
40
|
+
|
36
41
|
def debug?
|
37
42
|
return @debug
|
38
43
|
end
|
data/lib/carioca/constants.rb
CHANGED
data/lib/carioca/dependencies.rb
CHANGED
@@ -8,11 +8,11 @@ require 'locale'
|
|
8
8
|
require 'deep_merge'
|
9
9
|
require 'pastel'
|
10
10
|
|
11
|
+
require_relative 'helpers'
|
11
12
|
require_relative 'constants'
|
12
13
|
require_relative 'validator'
|
13
14
|
require_relative 'mixin'
|
14
15
|
require_relative 'container'
|
15
|
-
require_relative 'helpers'
|
16
16
|
require_relative 'configuration'
|
17
17
|
|
18
18
|
require_relative 'registry_file'
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: carioca
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.0.
|
4
|
+
version: 2.0.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Romain GEORGES
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2022-03-
|
11
|
+
date: 2022-03-07 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: tty-prompt
|