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 +4 -4
- data/VERSION +1 -1
- data/lib/core_extensions/psych.rb +29 -0
- data/lib/nib/debug.rb +0 -2
- data/lib/nib/history/compose.rb +3 -1
- data/lib/nib/options.rb +1 -7
- data/lib/nib.rb +1 -0
- 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: b69fb8eb3b9ba8f08e35a98aecb2334e6ed064202851793609a2611928ac047f
|
4
|
+
data.tar.gz: f60ce60ae0b32ebd7bfe6adfa68aded161d3d35f3a038bc036121f86a9c2ddd7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9f487437d32af8de8e5f4cd31664a11f70661bd4290f9c6314b146f1f73cf382e47af8e2101826586214b8bbb2ecbc1efb34c91ddaaf9cd9fb594cdf06c677d8
|
7
|
+
data.tar.gz: 8bf1f908a299ea019744b92e7c0dd72a9f276ff2f45b119ca01e1cd8e186cf946b5954597aacff42ed9b9f5eb49c2636052ca64104b976fd893f6dd82b530c74
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
2.1.
|
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
data/lib/nib/history/compose.rb
CHANGED
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
|
-
|
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
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.
|
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-
|
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.
|
212
|
+
rubygems_version: 3.3.3
|
212
213
|
signing_key:
|
213
214
|
specification_version: 4
|
214
215
|
summary: The tip of the pen (compose)
|