Skip to content

Commit b20c79a

Browse files
authored
Merge pull request #557 from DannyBen/fix/ini-lib
Fix INI library when loading multiple files
2 parents c0fd6f2 + 30b7318 commit b20c79a

File tree

9 files changed

+11
-7
lines changed

9 files changed

+11
-7
lines changed

bashly.gemspec

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,10 @@ Gem::Specification.new do |s|
2424
s.add_dependency 'requires', '~> 1.1.0'
2525
s.add_dependency 'tty-markdown', '~> 0.7'
2626

27+
# Sub-dependenceis (Ruby 3.3.5 warnings)
28+
s.add_dependency 'logger' # required by filewatcher
29+
s.add_dependency 'ostruct' # required by json
30+
2731
# Ruby 3.0 comes with Psych 3.3.0, which does not have the `unsafe_load`
2832
# ref: https://github.com/ruby/psych/commit/cb50aa8d3fb8be01897becff77b4922b12a0ab4c
2933
s.add_dependency 'psych', '>= 3.3.2', '< 7'

examples/config/src/lib/ini.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727
##
2828
## Load an INI file and populate the associative array `ini`.
2929
ini_load() {
30+
unset ini
3031
declare -gA ini
3132

3233
local ini_file="$1"

examples/ini/src/lib/ini.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727
##
2828
## Load an INI file and populate the associative array `ini`.
2929
ini_load() {
30+
unset ini
3031
declare -gA ini
3132

3233
local ini_file="$1"

examples/render-mandoc/docs/download.1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
.\" Automatically generated by Pandoc 3.2
22
.\"
3-
.TH "download" "1" "August 2024" "Version 0.1.0" "Sample application"
3+
.TH "download" "1" "September 2024" "Version 0.1.0" "Sample application"
44
.SH NAME
55
\f[B]download\f[R] \- Sample application
66
.SH SYNOPSIS

examples/render-mandoc/docs/download.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
% download(1) Version 0.1.0 | Sample application
22
% Lana Lang
3-
% August 2024
3+
% September 2024
44

55
NAME
66
==================================================

lib/bashly/libraries/ini/ini.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727
##
2828
## Load an INI file and populate the associative array `ini`.
2929
ini_load() {
30+
unset ini
3031
declare -gA ini
3132

3233
local ini_file="$1"

spec/approvals/examples/render-mandoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,4 +44,4 @@ ISSUE TRACKER
4444
AUTHORS
4545
Lana Lang.
4646

47-
Version 0.1.0 August 2024 download(1)
47+
Version 0.1.0 September 2024 download(1)

spec/approvals/libraries/render/mandoc/render-1-download.1

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,4 +27,3 @@ EXAMPLES
2727

2828
download example.com ./output -f
2929

30-
Version 0.1.0 MONTH YEAR ... APPNAME

spec/bashly/libraries/render_mandoc_spec.rb

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,10 +28,9 @@
2828
.to match_approval('libraries/render/mandoc/render-1-download.md')
2929
.except(/\w{3,9} 202\d/, 'MONTH YEAR')
3030

31-
expect(`man "#{target}/download.1" | col -bx`)
31+
expect(`man "#{target}/download.1" | col -bx | sed '$d'`)
3232
.to match_approval('libraries/render/mandoc/render-1-download.1')
3333
.diff(leeway)
34-
.except(/\w{3,9} 202\d.*/, 'MONTH YEAR ... APPNAME')
3534
end
3635
end
3736

@@ -41,7 +40,6 @@
4140
it 'saves a markdown and man files for each command' do
4241
expect { subject.instance_eval render_script }
4342
.to output_approval('libraries/render/mandoc/render-2')
44-
.except(/\w{3,9} 202\d.*/, 'MONTH YEAR ... APPNAME')
4543

4644
expect(File.read "#{target}/cli-download.md")
4745
.to match_approval('libraries/render/mandoc/render-2-download.md')

0 commit comments

Comments
 (0)