bashly 0.3.8 → 0.3.9

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: e3a38c45e77dbe9cae7c0f8949bef8727f248803cb903f2028c4069dcbbed392
4
- data.tar.gz: 6dd5bd930b3cdd217ac46c232a06c4f652afab2f3fe6ce09ff1dfae2b0e257b6
3
+ metadata.gz: 91071a35277525b61d148838ffb2d1871fa99b309dc060ba87cf3b68d12b7beb
4
+ data.tar.gz: c6840d4fea35a5eeae254ab177f745a63e0f507419a3e05ca5db77c808169a99
5
5
  SHA512:
6
- metadata.gz: 30970143ef9c35e9ee568bfd38b6e6030551e7fe38866b469570b1cb204639f5f56706002d62dd9b97149537d57b30a028620aa39fd6cbf79b9dc24adcbaa6ed
7
- data.tar.gz: 7cf260e1917e582a76138522b5d54436fe0e87dfcf62251f7c2bd89aabe742a58516927cf526cf20629747a3f09940518d3a07b603f5318603a940e2262328fe
6
+ metadata.gz: 199203d019e257014ee56d6501cc4ba31bebd61742aed461d3685d9a7768d100894794d2e276b7737ef49bd399c20d65209530a1d73db11672fe09b23cd2014a
7
+ data.tar.gz: c80c2705fc9ff0dd39311a944dc24493cbf49d2d8ca6e91d266d813cfadf90d592b98a054671a3641aa9c6c06c35f38119f87488bf45d92721aad6ad73080362
@@ -21,7 +21,7 @@ config_init() {
21
21
  # Usage: result=$(config_get hello)
22
22
  config_get() {
23
23
  key=$1
24
- regex="^$key\s*=\s*(.+)$"
24
+ regex="^$key *= *(.+)$"
25
25
 
26
26
  config_init
27
27
 
@@ -44,7 +44,7 @@ config_set() {
44
44
 
45
45
  config_init
46
46
 
47
- regex="^($key)\s*=\s*.+$"
47
+ regex="^($key) *= *.+$"
48
48
  output=""
49
49
  found_key=""
50
50
 
@@ -71,7 +71,7 @@ config_set() {
71
71
  config_del() {
72
72
  key=$1
73
73
 
74
- regex="^($key)\s*="
74
+ regex="^($key) *="
75
75
  output=""
76
76
 
77
77
  config_init
@@ -100,7 +100,7 @@ config_show() {
100
100
  # done
101
101
  #
102
102
  config_keys() {
103
- regex="^(.*)\s*="
103
+ regex="^([a-zA-Z0-9_\-]+) *="
104
104
 
105
105
  config_init
106
106
 
@@ -113,3 +113,14 @@ config_keys() {
113
113
  done < "$CONFIG_FILE"
114
114
  echo "${keys[@]}"
115
115
  }
116
+
117
+ # Returns true if the specified key exists in the config file
118
+ # Usage:
119
+ #
120
+ # if config_has_key "key" ; then
121
+ # echo "key exists"
122
+ # fi
123
+ #
124
+ config_has_key() {
125
+ [[ $(config_get "$1") ]]
126
+ }
@@ -1,3 +1,3 @@
1
1
  module Bashly
2
- VERSION = "0.3.8"
2
+ VERSION = "0.3.9"
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.3.8
4
+ version: 0.3.9
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: 2020-03-02 00:00:00.000000000 Z
11
+ date: 2020-04-01 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: colsole