data_collector 0.63.0 → 0.64.0

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 9006d40456c852cf21b98977606ed64c8211a40e9796e94bb7ec07c5837c1b03
4
- data.tar.gz: ab5172a04a592e5a319d95f9e6e4918eb3e6eb3f7783b2583a89428a5145efca
3
+ metadata.gz: cc87874763fab91f643447fac3148e3d31fd6fcfad889eb4e64d46ade463ac89
4
+ data.tar.gz: 8b8a01033c3cad493c2cc011d1d1bfb92cb5f3412fbd585dad34cfd19ee83647
5
5
  SHA512:
6
- metadata.gz: 6ff82dcd3e220c5b3ef6d5ffc6719f3c06e90b4aa71490feb0f07c0c4375f16bbddb0e7f80a3a3dd96870b85a018ccd4da091d7acf321141c85b2f9f77043f39
7
- data.tar.gz: c6d4c02d7c93fd4bb90813bcd20285a40dd781ba161e38770ab9ba627609c08ef11cd56bb8a6703030a1573ade7e6a7011e37068a97226ce334947980215d171
6
+ metadata.gz: c4d0abd5ba7864ef268c584feec3b273ba54e30830c9e9addb061905bf66a2d63805b3965ad675fde02aa12102308ec6d4dee6b70fb89700723da031049f81ee
7
+ data.tar.gz: 9ae512465969cc870884ab4355f6cacc2e2e1a2cae9e77d694f4a198ae65d9d138037e6c5cf46b844a6c30db997373bdf832ce4a07d27ad979e28e2ba72b73ee
data/README.md CHANGED
@@ -403,7 +403,15 @@ Engine directives:
403
403
  ### Config
404
404
 
405
405
  The config object points to a configuration file (default: "config.yml").
406
-
406
+ - Configuration is automatically reloaded when the file is modified
407
+ - All hash keys are converted to symbols (:key instead of "key")
408
+ - Writing values with []= immediately persists changes to the YAML file
409
+ - The class uses a singleton pattern - you cannot create instances with .new
410
+ - Environment variable substitution uses ${VAR_NAME} syntax in the YAML file
411
+
412
+ ```shell
413
+ export SECRET=my_secret
414
+ ```
407
415
  __Example__ config.yml
408
416
  ```yaml
409
417
  cache: "/tmp"
@@ -22,6 +22,7 @@ module DataCollector
22
22
  end
23
23
 
24
24
  def self.path
25
+ init if @config_file_path.empty?
25
26
  @config_file_path
26
27
  end
27
28
 
@@ -52,6 +53,16 @@ module DataCollector
52
53
  @config.keys
53
54
  end
54
55
 
56
+ def self.raw
57
+ init
58
+ @config
59
+ end
60
+
61
+ def self.dig(*args)
62
+ init
63
+ @config.dig(*args)
64
+ end
65
+
55
66
  def self.init
56
67
  @config_file_name = 'config.yml' if @config_file_name.nil?
57
68
  discover_config_file_path
@@ -66,6 +77,8 @@ module DataCollector
66
77
  end
67
78
 
68
79
  def self.discover_config_file_path
80
+ @config_file_name = ENV['CONFIG_FILE_NAME'] if ENV.key?('CONFIG_FILE_NAME')
81
+
69
82
  if @config_file_path.nil? || @config_file_path.empty?
70
83
  if ENV.key?('CONFIG_FILE_PATH')
71
84
  @config_file_path = ENV['CONFIG_FILE_PATH']
@@ -126,10 +126,6 @@ module DataCollector
126
126
  output_data.size == 1 &&
127
127
  not((output_data.first.is_a?(Array) || output_data.first.is_a?(Hash)))
128
128
  output_data = output_data.first
129
- # elsif output_data.is_a?(Array) &&
130
- # output_data.size == 1 &&
131
- # (output_data.first.is_a?(Array) || output_data.first.is_a?(Hash))
132
- # output_data = output_data.first
133
129
  end
134
130
 
135
131
  if options.with_indifferent_access.key?('_no_array_with_one_element') &&
@@ -1,4 +1,4 @@
1
1
  # encoding: utf-8
2
2
  module DataCollector
3
- VERSION = "0.63.0"
3
+ VERSION = "0.64.0"
4
4
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: data_collector
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.63.0
4
+ version: 0.64.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Mehmet Celik
@@ -407,7 +407,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
407
407
  - !ruby/object:Gem::Version
408
408
  version: '0'
409
409
  requirements: []
410
- rubygems_version: 3.6.9
410
+ rubygems_version: 3.7.2
411
411
  specification_version: 4
412
412
  summary: ETL helper library
413
413
  test_files: []