nib 2.1.0 → 2.1.1

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: 4222483b3c2ebfb88a93d8d6798d250bfac16bdd01e685d2c8397dacbd3e72f0
4
- data.tar.gz: abd1e97f561ac535af89409e11fdf20f0c5be96404e6fa90e43561e9ce6a97b4
3
+ metadata.gz: b69fb8eb3b9ba8f08e35a98aecb2334e6ed064202851793609a2611928ac047f
4
+ data.tar.gz: f60ce60ae0b32ebd7bfe6adfa68aded161d3d35f3a038bc036121f86a9c2ddd7
5
5
  SHA512:
6
- metadata.gz: 5612ed97ecd998f1cf22fab6262bcde9fb1f4ac9e06588c1418c3c4fa7f6d68cbb9744ea2a89bdcccee9f2a5a80f926cafbce8e30349d8e6440707147393604e
7
- data.tar.gz: b2a84a25909913a4941357727c0f6304a5f09a0f3358eaf892c04e9884a1a157b1254f74f4d66b36893eab65ca7b2978827cc3a0940126bb694abd960ff03f18
6
+ metadata.gz: 9f487437d32af8de8e5f4cd31664a11f70661bd4290f9c6314b146f1f73cf382e47af8e2101826586214b8bbb2ecbc1efb34c91ddaaf9cd9fb594cdf06c677d8
7
+ data.tar.gz: 8bf1f908a299ea019744b92e7c0dd72a9f276ff2f45b119ca01e1cd8e186cf946b5954597aacff42ed9b9f5eb49c2636052ca64104b976fd893f6dd82b530c74
data/VERSION CHANGED
@@ -1 +1 @@
1
- 2.1.0
1
+ 2.1.1
@@ -0,0 +1,29 @@
1
+ require 'yaml'
2
+
3
+ module CoreExtensions
4
+ # Handle the fact that we are loading potentially "unsafe" YAML while still
5
+ # supporting Ruby 2.7 and 3.0.
6
+ module Psych
7
+ def flexible_load(string)
8
+ load_with = if ::Psych.respond_to?(:unsafe_load)
9
+ :unsafe_load
10
+ else
11
+ :load
12
+ end
13
+
14
+ ::Psych.send(load_with, string)
15
+ end
16
+
17
+ def flexible_load_file(path)
18
+ load_with = if ::Psych.respond_to?(:unsafe_load_file)
19
+ :unsafe_load_file
20
+ else
21
+ :load_file
22
+ end
23
+
24
+ ::Psych.send(load_with, path)
25
+ end
26
+ end
27
+ end
28
+
29
+ Psych.extend CoreExtensions::Psych
data/lib/nib/debug.rb CHANGED
@@ -1,5 +1,3 @@
1
- require 'yaml'
2
-
3
1
  class Nib::Debug
4
2
  include Nib::Command
5
3
 
@@ -28,7 +28,9 @@ class Nib::History::Compose
28
28
  end
29
29
 
30
30
  def original_config
31
- @original_config ||= YAML.safe_load(docker_compose_config.gsub(/\$/, '$$'))
31
+ @original_config ||= Psych.flexible_load(
32
+ docker_compose_config.gsub(/\$/, '$$')
33
+ )
32
34
  end
33
35
 
34
36
  def file
data/lib/nib/options.rb CHANGED
@@ -4,13 +4,7 @@ module Nib::Options
4
4
  def config
5
5
  return @config if @config
6
6
 
7
- load_with = if YAML.respond_to?(:unsafe_load_file)
8
- :unsafe_load_file
9
- else
10
- :load_file
11
- end
12
-
13
- @config = YAML.send(load_with, "#{Nib::GEM_ROOT}/config/options.yml")
7
+ @config = Psych.flexible_load_file("#{Nib::GEM_ROOT}/config/options.yml")
14
8
  end
15
9
 
16
10
  def options_for(type, name)
data/lib/nib.rb CHANGED
@@ -2,6 +2,7 @@ require 'nib/version'
2
2
 
3
3
  require 'core_extensions/hash'
4
4
  require 'core_extensions/string'
5
+ require 'core_extensions/psych'
5
6
 
6
7
  require 'nib/options'
7
8
  require 'nib/options/augmenter'
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: nib
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.1.0
4
+ version: 2.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - John Allen
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2022-01-20 00:00:00.000000000 Z
12
+ date: 2022-02-09 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: gli
@@ -166,6 +166,7 @@ files:
166
166
  - config/commands/shell/pryrc
167
167
  - config/options.yml
168
168
  - lib/core_extensions/hash.rb
169
+ - lib/core_extensions/psych.rb
169
170
  - lib/core_extensions/string.rb
170
171
  - lib/nib.rb
171
172
  - lib/nib/check_for_update.rb
@@ -208,7 +209,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
208
209
  - !ruby/object:Gem::Version
209
210
  version: '0'
210
211
  requirements: []
211
- rubygems_version: 3.2.22
212
+ rubygems_version: 3.3.3
212
213
  signing_key:
213
214
  specification_version: 4
214
215
  summary: The tip of the pen (compose)