bashly 0.6.6 → 0.6.7

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: e61f83f8d8f8b4992a5f7d66731de37d640dd1da71c8bc243558ba173f56a76c
4
- data.tar.gz: c85eb4ea1c11c97c494b969075553f3a341bc29ac44ba94a4763d5efe1b03af0
3
+ metadata.gz: c47271e43a775ff08c071428540301ed1fa0656c7d58020c9825dfbc492804ef
4
+ data.tar.gz: fdc8ac40f1d18c2bc90ae4700fd0757e55132852bbdf8700a2829a02dd3be61c
5
5
  SHA512:
6
- metadata.gz: 1685fa4d73c0bc652e3043e8686e39b8ce7571f7baa41e5c84fa5dcce01a49331fd65af7a817bdbd0b985200c9a0502565bfece80414d58b3eed2b1729be101d
7
- data.tar.gz: d20da15898e3792bb6efeb7257d0b4a21dc6c0adc5dca00b72411dd37acfd61a926427ec70264058fd276c509c24d7a5d7b7235f66b74b075d86ff1266b2163f
6
+ metadata.gz: aff1e0723cdfdc10c409697cb2c715a37382dc7dbef3da3afe3b0e45fc8c91255ffeda153d24a25aa3bdcdf67ff863cfa7bec4558f79fced3d3ff33dc720b4d1
7
+ data.tar.gz: 54aa504a25003ddf1331e39de9b68612d2fff39bedc93dfc09bc961254c6b4ba7beacadf90412af6d76f9159bffb48456b6d6e85e5c805864372221f2edfbe2e
@@ -20,8 +20,9 @@ config_init() {
20
20
  # Get a value from the config.
21
21
  # Usage: result=$(config_get hello)
22
22
  config_get() {
23
- key=$1
24
- regex="^$key *= *(.+)$"
23
+ local key=$1
24
+ local regex="^$key *= *(.+)$"
25
+ local value=""
25
26
 
26
27
  config_init
27
28
 
@@ -38,15 +39,16 @@ config_get() {
38
39
  # Add or update a key=value pair in the config.
39
40
  # Usage: config_set key value
40
41
  config_set() {
41
- key=$1
42
+ local key=$1
42
43
  shift
43
- value="$*"
44
+ local value="$*"
44
45
 
45
46
  config_init
46
47
 
47
- regex="^($key) *= *.+$"
48
- output=""
49
- found_key=""
48
+ local regex="^($key) *= *.+$"
49
+ local output=""
50
+ local found_key=""
51
+ local newline
50
52
 
51
53
  while IFS= read -r line || [ -n "$line" ]; do
52
54
  newline=$line
@@ -69,15 +71,14 @@ config_set() {
69
71
  # Delete a key from the config.
70
72
  # Usage: config_del key
71
73
  config_del() {
72
- key=$1
74
+ local key=$1
73
75
 
74
- regex="^($key) *="
75
- output=""
76
+ local regex="^($key) *="
77
+ local output=""
76
78
 
77
79
  config_init
78
80
 
79
81
  while IFS= read -r line || [ -n "$line" ]; do
80
- newline=$line
81
82
  if [[ $line ]] && [[ ! $line =~ $regex ]]; then
82
83
  output="$output$line\n"
83
84
  fi
@@ -100,11 +101,13 @@ config_show() {
100
101
  # done
101
102
  #
102
103
  config_keys() {
103
- regex="^([a-zA-Z0-9_\-\/\.]+) *="
104
+ local regex="^([a-zA-Z0-9_\-\/\.]+) *="
104
105
 
105
106
  config_init
106
107
 
107
- keys=()
108
+ local keys=()
109
+ local key
110
+
108
111
  while IFS= read -r line || [ -n "$line" ]; do
109
112
  if [[ $line =~ $regex ]]; then
110
113
  key="${BASH_REMATCH[1]}"
@@ -1,3 +1,3 @@
1
1
  module Bashly
2
- VERSION = "0.6.6"
2
+ VERSION = "0.6.7"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bashly
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.6.6
4
+ version: 0.6.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Danny Ben Shitrit
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-09-07 00:00:00.000000000 Z
11
+ date: 2021-09-27 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: colsole