carioca 2.0.9 → 2.0.10
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 +23 -0
- data/VERSION +1 -1
- data/assets/images/logo_carioca.png +0 -0
- data/lib/carioca/configuration.rb +2 -1
- data/lib/carioca/constants.rb +3 -1
- data/lib/carioca/services/output.rb +4 -2
- metadata +4 -3
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 2b56dfd6b3c6d3725261eb39f73b429c6b031909973e4a3483f945202925ffbb
|
|
4
|
+
data.tar.gz: 2836fb78374d34e658546145b0bcbb98d25d1e2e26d641d73805c7ac73529f68
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 1a7068081ac2e1d3344fb1ee6bfedf86b590ed0fbeacbb40fc9f9d7ca98d13c4c47d6d3b99539c2d63ab8ce91c9afe09880612d7a52228acf484f08a7ba4b541
|
|
7
|
+
data.tar.gz: c77b855e6e2edb451bc95d0382565e13d97383874478b81d729fff0a7f60d0b600f7238e89b3f4029ea505240f9efe7970c25b6b16e97d6bc6e2729ef4469d17
|
data/README.md
CHANGED
|
@@ -3,6 +3,29 @@
|
|
|
3
3
|
Carioca : Container And Registry with Inversion Of Control for your Applications
|
|
4
4
|
|
|
5
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
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+

|
|
9
|
+
|
|
10
|
+
[](https://rubydoc.info/gems/carioca)
|
|
11
|
+

|
|
12
|
+

|
|
13
|
+

|
|
14
|
+

|
|
15
|
+
|
|
16
|
+

|
|
17
|
+
[](https://badge.fury.io/rb/carioca)
|
|
18
|
+

|
|
19
|
+

|
|
20
|
+

|
|
21
|
+
|
|
22
|
+
<noscript><a href="https://liberapay.com/ruydiaz/donate"><img alt="Donate using Liberapay" src="https://liberapay.com/assets/widgets/donate.svg"></a></noscript>
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+

|
|
26
|
+
_Container And Registry with Inversion Of Control for your Applications__
|
|
27
|
+
|
|
28
|
+
|
|
6
29
|
## Installation
|
|
7
30
|
|
|
8
31
|
Install it yourself as:
|
data/VERSION
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
2.0.
|
|
1
|
+
2.0.10
|
|
Binary file
|
|
@@ -6,7 +6,7 @@ module Carioca
|
|
|
6
6
|
include Carioca::Helpers
|
|
7
7
|
attr_accessor :filename, :name, :builtins, :log_target, :default_locale, :locales_load_path, :debugger_tracer,
|
|
8
8
|
:config_file, :config_root, :environment, :supported_environment, :output_mode, :log_level
|
|
9
|
-
attr_writer :init_from_file, :output_colors, :output_emoji
|
|
9
|
+
attr_writer :init_from_file, :output_colors, :output_emoji, :output_target
|
|
10
10
|
attr_reader :log_file, :locales_availables, :debug
|
|
11
11
|
|
|
12
12
|
def initialize
|
|
@@ -27,6 +27,7 @@ module Carioca
|
|
|
27
27
|
@output_mode = DEFAULT_OUTPUT_MODE.dup
|
|
28
28
|
@output_colors = DEFAULT_COLORS_STATUS.dup
|
|
29
29
|
@output_emoji = DEFAULT_EMOJI_STATUS.dup
|
|
30
|
+
@output_target = DEFAULT_OUTPUT_TARGET.dup
|
|
30
31
|
path = search_file_in_gem('carioca', 'config/locales')
|
|
31
32
|
@locales_load_path = Dir["#{File.expand_path(path)}/*.yml"]
|
|
32
33
|
Dir["#{path}/*.yml"].sort.each do |file|
|
data/lib/carioca/constants.rb
CHANGED
|
@@ -8,6 +8,7 @@ module Carioca
|
|
|
8
8
|
DEFAULT_CONFIG_ROOT = :carioca
|
|
9
9
|
DEFAULT_LOCALE = :en
|
|
10
10
|
|
|
11
|
+
DEFAULT_OUTPUT_TARGET = STDOUT
|
|
11
12
|
DEFAULT_OUTPUT_MODE = :mono
|
|
12
13
|
DEFAULT_EMOJI_STATUS = true
|
|
13
14
|
DEFAULT_COLORS_STATUS = true
|
|
@@ -54,7 +55,8 @@ module Carioca
|
|
|
54
55
|
mode: Carioca::Registry.config.output_mode,
|
|
55
56
|
emoji: Carioca::Registry.config.output_emoji?,
|
|
56
57
|
colors: Carioca::Registry.config.output_colors?,
|
|
57
|
-
level: Carioca::Registry.config.log_level
|
|
58
|
+
level: Carioca::Registry.config.log_level,
|
|
59
|
+
target: Carioca::Registry.config.output_target
|
|
58
60
|
)"
|
|
59
61
|
},
|
|
60
62
|
debugger: {
|
|
@@ -109,12 +109,13 @@ module Carioca
|
|
|
109
109
|
end
|
|
110
110
|
|
|
111
111
|
# constructor
|
|
112
|
-
def initialize(level: :debug, mode: :mono, emoji: true, colors: true)
|
|
112
|
+
def initialize(level: :debug, mode: :mono, emoji: true, colors: true, target: STDOUT)
|
|
113
113
|
registry = Carioca::Registry.get
|
|
114
114
|
@logger = registry.get_service name: :logger
|
|
115
115
|
@i18n = registry.get_service name: :i18n
|
|
116
116
|
@debug = Carioca::Registry.config.debug?
|
|
117
117
|
self.level = level
|
|
118
|
+
@target = target
|
|
118
119
|
@mode = mode
|
|
119
120
|
@emoji = check_unicode_term ? emoji : false
|
|
120
121
|
@color = colors
|
|
@@ -122,6 +123,7 @@ module Carioca
|
|
|
122
123
|
set.push mode
|
|
123
124
|
set.push :emoji if @emoji
|
|
124
125
|
set.push :colors if @color
|
|
126
|
+
set.push target
|
|
125
127
|
@logger.debug('Carioca->Output') { @i18n.t('output.load.context', confset: set.to_s) } if @debug
|
|
126
128
|
raise "Unknown output mode : #{@mode}" unless MODE.include? @mode
|
|
127
129
|
end
|
|
@@ -181,7 +183,7 @@ module Carioca
|
|
|
181
183
|
block = proc { save }
|
|
182
184
|
@logger.send target_level, source, &block
|
|
183
185
|
end
|
|
184
|
-
puts message if @mode == :mono or @mode == :dual
|
|
186
|
+
@target.puts message if @mode == :mono or @mode == :dual
|
|
185
187
|
end
|
|
186
188
|
end
|
|
187
189
|
end
|
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.10
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Romain GEORGES
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: exe
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date:
|
|
11
|
+
date: 2023-05-24 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: deep_merge
|
|
@@ -196,6 +196,7 @@ files:
|
|
|
196
196
|
- README.md
|
|
197
197
|
- Rakefile
|
|
198
198
|
- VERSION
|
|
199
|
+
- assets/images/logo_carioca.png
|
|
199
200
|
- bin/console
|
|
200
201
|
- bin/setup
|
|
201
202
|
- carioca.gemspec
|
|
@@ -252,7 +253,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
252
253
|
- !ruby/object:Gem::Version
|
|
253
254
|
version: '0'
|
|
254
255
|
requirements: []
|
|
255
|
-
rubygems_version: 3.
|
|
256
|
+
rubygems_version: 3.3.5
|
|
256
257
|
signing_key:
|
|
257
258
|
specification_version: 4
|
|
258
259
|
summary: 'Carioca : Container And Registry with Inversion Of Control for your Applications'
|