config_file_manager 0.1.0 → 0.1.2

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: 7b201bea17abb482354c6f78d6a9d593bea969d1d9230a19f7fc4d4f57e61386
4
- data.tar.gz: 3dfee6b8202650db06b0b16ffa9635973a7fb6296a9071401e54061af859f8c4
3
+ metadata.gz: 9b4fdc0a8ed8426e6d4ecd41d04ff9ad0aa8e817aca12189cc6cbe0878b81748
4
+ data.tar.gz: 903cfee08159f7a560fbc8305282d540799f06271363862898aaa4121545981c
5
5
  SHA512:
6
- metadata.gz: 0cfe298ff1a28b1f7d1deaae12f802eb9eb2d33118c3c8aaf22b991847ed624a1684c8cd6e38a64b6d989685fa32be1406cf13ecb8e436930f3e8ea52c465672
7
- data.tar.gz: 3d00173997bb351a91a50b0d941f11ba76078579c84b87c652b0febf358ae712971cd5c429c661036ab452b59bf030c84fb7ca6c0272e4236113998eecff0e8e
6
+ metadata.gz: 305ed92cf6e19d9b6b4d5ab1af990f5dde5236c53345e206797081ccb8eb43890def787aa3834fe325ecab0bdd31cfcbe522c88315e11c3abe406ce1654fff38
7
+ data.tar.gz: 1c5368b9ef06c10ce0476f1c3f09589869e134547bf7350aad2ef75bb12bd29a0ff0613287cb0a88ddca14f3d8f00773725d26758e658edb07d6b777d65997fc
data/CHANGELOG.md CHANGED
@@ -1,5 +1,13 @@
1
1
  ## [Unreleased]
2
2
 
3
+ ## [0.1.2] - 2023-08-29
4
+
5
+ - Fix `ConfigFileManager#create_missing_dirs`
6
+
7
+ ## [0.1.1] - 2023-08-28
8
+
9
+ - Add support for Psych < 4
10
+
3
11
  ## [0.1.0] - 2023-08-28
4
12
 
5
13
  - Initial release
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  class ConfigFileManager # rubocop:disable Style/StaticClass
4
- VERSION = '0.1.0'
4
+ VERSION = '0.1.2'
5
5
  end
@@ -125,7 +125,7 @@ class ConfigFileManager
125
125
  def create_missing_dirs(example_extension: @example_extension, print: false)
126
126
  puts COLORS.blue('== Copying missing config directories ==') if print
127
127
  dirs(example_extension: example_extension).each do |dir|
128
- create_missing_dir("#{dir}#{example_extension}", file, print: print)
128
+ create_missing_dir("#{dir}#{example_extension}", dir, print: print)
129
129
  end
130
130
  end
131
131
 
@@ -173,7 +173,7 @@ class ConfigFileManager
173
173
  # @return [Hash, Array]
174
174
  def load_yaml(*file_name, env: @env, symbolize: true)
175
175
  env = env.to_sym if env && symbolize
176
- parsed = ::YAML.load(load_erb(*file_name), symbolize_names: symbolize) # rubocop:disable Security/YAMLLoad
176
+ parsed = ruby_load_yaml(load_erb(*file_name), symbolize_names: symbolize)
177
177
  return parsed unless env
178
178
 
179
179
  parsed[env]
@@ -184,6 +184,11 @@ class ConfigFileManager
184
184
  ::File.delete(file_path(*file_name))
185
185
  end
186
186
 
187
+ # @param dir_name [Array<String>]
188
+ def delete_dir(*dir_name)
189
+ ::FileUtils.rm_r(file_path(*dir_name))
190
+ end
191
+
187
192
  # @param file_name [Array<String>]
188
193
  # @return [String]
189
194
  def load_erb(*file_name)
@@ -218,6 +223,16 @@ class ConfigFileManager
218
223
 
219
224
  private
220
225
 
226
+ if ::Psych::VERSION >= '4'
227
+ def ruby_load_yaml(content, **options) # rubocop:disable Style/DocumentationMethod
228
+ ::YAML.load(content, aliases: true, **options) # rubocop:disable Security/YAMLLoad
229
+ end
230
+ else
231
+ def ruby_load_yaml(content, **options) # rubocop:disable Style/DocumentationMethod
232
+ ::YAML.load(content, **options) # rubocop:disable Security/YAMLLoad
233
+ end
234
+ end
235
+
221
236
  # @param original_name [String]
222
237
  # @param new_name [String]
223
238
  # @param print [Boolean]
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: config_file_manager
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Mateusz Drewniak
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2023-08-28 00:00:00.000000000 Z
11
+ date: 2023-08-29 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: pastel
@@ -38,7 +38,6 @@ files:
38
38
  - Rakefile
39
39
  - lib/config_file_manager.rb
40
40
  - lib/config_file_manager/version.rb
41
- - pkg/config_loader-0.1.0.gem
42
41
  - sig/config_loader.rbs
43
42
  homepage: https://github.com/Verseth/ruby-config-loader
44
43
  licenses:
Binary file