confrb 2.0 → 2.1
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 +4 -4
- data/lib/confrb.rb +6 -2
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 23ae9b30b92b94f21906c85cf2bccbb58bef6f3289dbdb5f9212fa8c19dd01d6
|
4
|
+
data.tar.gz: 33fa8a6bb48cfe4fbedb51602f182ead37f5cef515424a80eefdddc1a957adae
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: fb192c07ce9dd687763d885ade44f7e3eb57f6398d3e94c9007328fe55511ef52f715db29b1cc89323088cc4ef73cd093a2a5a89ef5944723e6b686e848da27c
|
7
|
+
data.tar.gz: 32bdf5578741eedf943297b82b0ebb4f82895234e78ad22e7b76ddce2411116ab7c4ee44861d7d94f2dfbffe90c4a38bf182cecf37bf2eb2878e71744ed3ca52
|
data/lib/confrb.rb
CHANGED
@@ -44,7 +44,9 @@ class Confrb
|
|
44
44
|
as_json = opts.fetch(:json, false)
|
45
45
|
as_yaml = opts.fetch(:yaml, false)
|
46
46
|
newline = opts.fetch(:newline, false)
|
47
|
-
|
47
|
+
if newline == true
|
48
|
+
content = "\n" + content
|
49
|
+
end
|
48
50
|
dotdir = "." + @db
|
49
51
|
cfgpath = File.join(dotdir, cfgname)
|
50
52
|
FileUtils.touch(cfgpath)
|
@@ -141,7 +143,9 @@ class Confrb
|
|
141
143
|
dotdir = "." + @db
|
142
144
|
cfgpath = File.join(dotdir, cfgname)
|
143
145
|
FileUtils.touch(cfgpath)
|
144
|
-
|
146
|
+
if newline == true
|
147
|
+
content = content + "\n"
|
148
|
+
end
|
145
149
|
if as_json == true
|
146
150
|
content = content.to_json
|
147
151
|
IO.write(cfgpath, content, mode: "a")
|