confrb 1.5 → 1.6
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 +10 -3
- 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: 057e6c72fa7f625ee6856c4a8146a002c78318a9cf0e7658c5e58bf548763b25
|
4
|
+
data.tar.gz: ae506af9f374b7d125307f39e0557c38001c4e08cadecbb9df09fae9518b7f0e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 53aba1502fea37f17a3cdeb933b79ccc0b2661219217fdcf32ca6ac07bef8f8f749bad12cc3a7352ece86e52c12177bec79acff71d61d7660748e3eb3b144dfa
|
7
|
+
data.tar.gz: 59d2762f9d990829e6fc66d2b69560ea9348992646e887a19241cd45b72b7228e1ab33bcc6479329df1204e666af9623e09ef812203e5995de889f394d1e00ce
|
data/lib/confrb.rb
CHANGED
@@ -5,10 +5,9 @@ require "yaml"
|
|
5
5
|
##
|
6
6
|
# Main class for Conf.rb
|
7
7
|
# @author gsbhasin84
|
8
|
-
class
|
9
|
-
|
8
|
+
class Confrb
|
10
9
|
##
|
11
|
-
# Auto-create config storage directory,
|
10
|
+
# Auto-create config storage directory, prepending '.' to
|
12
11
|
# given name. Use .new() on this class to run this! Can create subdirs recursively, but only
|
13
12
|
# root directory gets '.' prepended
|
14
13
|
# @param [String] db The name of the configuration directory to create.
|
@@ -18,6 +17,14 @@ class BasicCfrb
|
|
18
17
|
FileUtils.mkdir_p(dotname)
|
19
18
|
end
|
20
19
|
|
20
|
+
##
|
21
|
+
# Access the given database, prepending '.' to given name. Auto-create if doesn't exist.
|
22
|
+
# @param [String] db The name of the configuration directory to access
|
23
|
+
def self.access(db)
|
24
|
+
@db = db
|
25
|
+
Confrb.new(db)
|
26
|
+
end
|
27
|
+
|
21
28
|
##
|
22
29
|
# Create/overwrite a config file and write data to it. Can
|
23
30
|
# serialize a hash as yaml or json, or write a string
|