confrb 0.5alpha
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 +7 -0
- data/lib/confrb.rb +35 -0
- metadata +44 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 21648e0a11d5e1bbf7184cd5f98c87590fa7c461e0f40a6d65dc3a630d79af06
|
4
|
+
data.tar.gz: a9d17a0d1b06e4826fe0f4f20db4baadccc8942ab82df85b16f59d6def4e3661
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 12786e9165f7c73b9acce3f9225620910b1b70e6ea5f93acce7ecdcd3475d1f4ca5160b866ec6ab328ce72132f5b85b4bee03f3ca5d77ede02754721c0ca1e5e
|
7
|
+
data.tar.gz: c8f64cf2795942e24e4564b126c0aadeaec0fe18a30671202d2c5938093968daea9c6adab3d6ba21faa14450ad87704610847e9dacf0cd7279ff46179b610c4e
|
data/lib/confrb.rb
ADDED
@@ -0,0 +1,35 @@
|
|
1
|
+
require 'fileutils'
|
2
|
+
def setup(name)
|
3
|
+
dotname = "." + name
|
4
|
+
FileUtils.mkdir_p(dotname)
|
5
|
+
end
|
6
|
+
def mkcfg(dir, cfgname, content)
|
7
|
+
dotdir = "." + dir
|
8
|
+
begin
|
9
|
+
cfgpath = dotdir + "/" + cfgname
|
10
|
+
FileUtils.touch(cfgpath)
|
11
|
+
File.write(cfgpath, content)
|
12
|
+
rescue
|
13
|
+
cfgpath = dotdir + "\\" + cfgname
|
14
|
+
FileUtils.touch(cfgpath)
|
15
|
+
File.write(cfgpath, content)
|
16
|
+
end
|
17
|
+
end
|
18
|
+
def mknested(dir, nesteddir)
|
19
|
+
dotdir = "." + dir
|
20
|
+
begin
|
21
|
+
FileUtils.mkdir_p(dotdir + '/' + nesteddir)
|
22
|
+
rescue
|
23
|
+
FileUtils.mkdir_p(dotdir + '\\' + nesteddir)
|
24
|
+
end
|
25
|
+
end
|
26
|
+
def readcfg(dir, cfgname)
|
27
|
+
dotdir = "." + dir
|
28
|
+
begin
|
29
|
+
output = File.read(dotdir + '/' + cfgname)
|
30
|
+
return output
|
31
|
+
rescue
|
32
|
+
output = File.read(dotdir + '\\' + cfgname)
|
33
|
+
return output
|
34
|
+
end
|
35
|
+
end
|
metadata
ADDED
@@ -0,0 +1,44 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: confrb
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.5alpha
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Gurjus Bhasin
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
date: 2019-12-18 00:00:00.000000000 Z
|
12
|
+
dependencies: []
|
13
|
+
description: A Ruby Gem which allows you to store configuration files using hidden
|
14
|
+
directories. Plaintext, unencrypted. Useful for simple text adventure games, etc.
|
15
|
+
email: gsbhasin84@gmail.com
|
16
|
+
executables: []
|
17
|
+
extensions: []
|
18
|
+
extra_rdoc_files: []
|
19
|
+
files:
|
20
|
+
- lib/confrb.rb
|
21
|
+
homepage: https://gitlab.com/Gsbhasin84/confrb
|
22
|
+
licenses:
|
23
|
+
- MIT
|
24
|
+
metadata: {}
|
25
|
+
post_install_message:
|
26
|
+
rdoc_options: []
|
27
|
+
require_paths:
|
28
|
+
- lib
|
29
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - ">="
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '0'
|
34
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
35
|
+
requirements:
|
36
|
+
- - ">"
|
37
|
+
- !ruby/object:Gem::Version
|
38
|
+
version: 1.3.1
|
39
|
+
requirements: []
|
40
|
+
rubygems_version: 3.0.6
|
41
|
+
signing_key:
|
42
|
+
specification_version: 4
|
43
|
+
summary: Plaintext configuration library for Ruby
|
44
|
+
test_files: []
|