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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 99fbf2409631fe5afb97b9807059612f5eaa0e237bf44685a8f9aa993db1b87b
4
- data.tar.gz: 36636acf529dc8610985e3bd96310482a0e0f9003836c6a902411cf908735166
3
+ metadata.gz: df2fae455d522ba26500abac0d203b29e1b173391b2e9eb9c27f9de83f282a55
4
+ data.tar.gz: 5e34e6d5b0eef09348906b45f6bb5c2db3d1874c6d4f3f05c5a017baca5f5da1
5
5
  SHA512:
6
- metadata.gz: c9dccd95e578ea578f226c273c132f6021a23b856a25606557044cbaa0aea3403e0522b236c87a581a69653fc0264c8c3c38eb643baf4e9538db5534ffe0a316
7
- data.tar.gz: b64096695a61f14423ca8d90363b3fd1d09317aa3eac742e4e9aef4b4ff0381cfd0f443fca2d498092673fd122d639e8b93f182ba1854d38fe138e742e19dc5d
6
+ metadata.gz: fad3b4fcbf8beb5811458891ad529a405fe85f19af613eb986369e51573eb87524d5849a566e7009a1a6c8d6f142e5a6f60a5e3ce82f9b60e82cabcfc814d02b
7
+ data.tar.gz: 1049e060ed5326a3f67acea98258fca5c2880f46ae1edc3b1d08070e7012d374d975c062e076adfb2a127e0f3027ba0117b57ba97bc06f43d1ab3f904f63a0a4
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- carioca (2.0.3)
4
+ carioca (2.0.4)
5
5
  deep_merge (~> 1.2)
6
6
  i18n (~> 1.10)
7
7
  locale (~> 2.1)
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 yourgem-0.1.0.gem into the pkg directory
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 yourgem-0.1.0.gem into system gems
43
- rake install:local # Build and install yourgem-0.1.0.gem into system gems without network access
44
- rake release[remote] # Create tag v0.1.0 and build and push yourgem-0.1.0.gem to Set to 'http://mygemserver.com'
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 saved
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-04T23:11:52.663459 #88808] DEBUG -- Carioca: Preloaded service :i18n on locale : en
136
- D, [2022-03-04T23:11:52.663519 #88808] DEBUG -- Carioca: Preloaded service :logger ready on STDOUT
137
- D, [2022-03-04T23:11:52.663537 #88808] DEBUG -- Carioca: Initializing Carioca registry
138
- D, [2022-03-04T23:11:52.663550 #88808] DEBUG -- Carioca: Preparing builtins services
139
- D, [2022-03-04T23:11:52.663580 #88808] DEBUG -- Carioca: Adding service configuration
140
- D, [2022-03-04T23:11:52.663609 #88808] DEBUG -- Carioca: Adding service i18n
141
- D, [2022-03-04T23:11:52.663649 #88808] DEBUG -- Carioca: Initializing registry from file : ./config/carioca.registry
142
- D, [2022-03-04T23:11:52.663773 #88808] DEBUG -- Carioca: Adding service uuid
143
- D, [2022-03-04T23:11:52.663794 #88808] DEBUG -- Carioca: Registry initialized successfully
144
- I, [2022-03-04T23:11:52.663802 #88808] INFO -- Sample::YourGemCMD: Log me as class method
145
- I, [2022-03-04T23:11:52.663813 #88808] INFO -- #<Sample::YourGemCMD:0x00000001312c0bf0>: Log me as an instance method
146
- D, [2022-03-04T23:11:52.663844 #88808] DEBUG -- Carioca: Starting service uuid
147
- W, [2022-03-04T23:11:52.682812 #88808] WARN -- Sample::YourGemCMD: Give me an UUID : 0505f3f0-7e36-013a-22c7-1e00870a7189
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 :debug, :init_from_file, :output_colors, :output_emoji
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
@@ -1,7 +1,7 @@
1
1
  module Carioca
2
2
  module Constants
3
3
 
4
- VERSION = '2.0.3'
4
+ VERSION = '2.0.4'
5
5
  DEFAULT_REGISTRY_FILE = './config/carioca.registry'
6
6
  DEFAULT_CONFIG_FILE = './config/settings.yml'
7
7
  DEFAULT_ENVIRONMENT = :development
@@ -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.3
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-06 00:00:00.000000000 Z
11
+ date: 2022-03-07 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: tty-prompt