carioca 2.0.9 → 2.0.10

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: 9f7a044cde7b83f6e73cec4fa5dbc6281d2aa16cf027d18f2c1c6a74e6c71b0a
4
- data.tar.gz: 53866fb3c83823e1c684a5cc20df85aa0eae7c2a64fc373f6c9af793dc87ff5e
3
+ metadata.gz: 2b56dfd6b3c6d3725261eb39f73b429c6b031909973e4a3483f945202925ffbb
4
+ data.tar.gz: 2836fb78374d34e658546145b0bcbb98d25d1e2e26d641d73805c7ac73529f68
5
5
  SHA512:
6
- metadata.gz: 0e436fcf0a2c93f1ccc5562ba594760a27531545a86d88ed1c5f7984184478c39658539d7f335573fd11c79549696f0b58106adbc58aa7333e8abcebab036a69
7
- data.tar.gz: b5114171a548715d2d6c093dea0551c553877023c0b8bcb49ec5a3e1687b63e41127f8917a317fde875ec4930f43d7235a695a044712b8b6d710c12612eb420d
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
+ ![GitHub](https://img.shields.io/github/license/Ultragreen/carioca)
9
+
10
+ [![Documentation](https://img.shields.io/badge/docs-rubydoc.info-brightgreen)](https://rubydoc.info/gems/carioca)
11
+ ![GitHub issues](https://img.shields.io/github/issues/Ultragreen/carioca)
12
+ ![GitHub tag (latest by date)](https://img.shields.io/github/v/tag/Ultragreen/carioca)
13
+ ![GitHub top language](https://img.shields.io/github/languages/top/Ultragreen/carioca)
14
+ ![GitHub milestones](https://img.shields.io/github/milestones/open/Ultragreen/carioca)
15
+
16
+ ![Gem](https://img.shields.io/gem/dt/carioca)
17
+ [![Gem Version](https://badge.fury.io/rb/sc4ry.svg)](https://badge.fury.io/rb/carioca)
18
+ ![Twitter Follow](https://img.shields.io/twitter/follow/Ultragreen?style=social)
19
+ ![GitHub Org's stars](https://img.shields.io/github/stars/Ultragreen?style=social)
20
+ ![GitHub watchers](https://img.shields.io/github/watchers/Ultragreen/carioca?style=social)
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
+ ![Sc4ry logo](assets/images/logo_carioca.png)
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.9
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|
@@ -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.9
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: 2022-10-21 00:00:00.000000000 Z
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.1.2
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'