gembase 0.5.3 → 1.0.0
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/main.rb +590 -174
- data/lib/services.rb +202 -0
- metadata +47 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: fc21c6acc25e4f96ef0b7e5f94b18b689c16cfa27b75deedad20ce55815f6696
|
4
|
+
data.tar.gz: f79a22783d36cace7031a42ad71ebd322c1255fd1e95526f9f297f1fdd2f95a9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4894e0f8dc727e31d12c9812e44e93e7a133993def365b683f5b34d519ce0cdf22c831c478878cdc483ce35eb6dc332f1bdae130e4c4a4aa043c49a2165efc62
|
7
|
+
data.tar.gz: 8d40a370ae3103df17ed23439b746f273cdeff8b7f9f3c9dba4c9a4352d59e3dc240fd8851427bf8ea6df15e3b4145406a987d1f9401b235da5682223d1889a0
|
data/lib/main.rb
CHANGED
@@ -1,232 +1,648 @@
|
|
1
1
|
#!usr/bin/env ruby
|
2
|
-
# NTBBloodbath | Gembase - Ruby DataBase
|
2
|
+
# NTBBloodbath | Gembase - Ruby YAML DataBase Manager
|
3
3
|
|
4
4
|
require 'yaml'
|
5
5
|
require 'fileutils'
|
6
|
+
require 'colorize'
|
7
|
+
|
8
|
+
require_relative 'services'
|
6
9
|
|
7
10
|
# @author NTBBloodbath
|
8
11
|
module Gembase
|
9
12
|
|
10
|
-
#
|
11
|
-
#
|
13
|
+
# @!method settings(db, protect_db, path)
|
14
|
+
# Settings for your database manager
|
15
|
+
# @param db [String] name of your DataBase file
|
16
|
+
# @param protect_db [Boolean] protect your db. Crypt and more.
|
17
|
+
# @param path [String] path to your database files
|
18
|
+
#
|
19
|
+
# @example Enable the db protection
|
20
|
+
# settings('example' true, 'root')
|
21
|
+
#
|
22
|
+
# @example Changing to a custom path
|
23
|
+
# settings('example, true, './res')
|
12
24
|
#
|
13
|
-
#
|
14
|
-
|
15
|
-
|
16
|
-
|
25
|
+
# @note You must need to put "root" if you don't want to use custom directories instead of the root directory of your project.
|
26
|
+
# @note You must need to write a password in your terminal when you start the file if you protected your db. It'll be required to encrypt and decrypt your db, save this!.
|
27
|
+
# @note You must use this method at the beginning of your code for your db to work. Obligatory method.
|
28
|
+
#
|
29
|
+
# @since 1.0.0
|
30
|
+
def self.settings(db, protect_db, path)
|
31
|
+
begin
|
32
|
+
raise Errors::invalid_param('db', 'String', 'Gembase.settings') until db.is_a?(String)
|
33
|
+
rescue => e
|
34
|
+
e
|
35
|
+
end
|
36
|
+
|
37
|
+
begin
|
38
|
+
raise Errors::invalid_param('protect_db', 'Boolean', 'Gembase.settings') until protect_db.is_a?(Boolean)
|
39
|
+
rescue => e
|
40
|
+
e
|
41
|
+
end
|
42
|
+
|
43
|
+
begin
|
44
|
+
raise Errors::invalid_param('path', 'String', 'Gembase.settings') until path.is_a?(String)
|
45
|
+
rescue => e
|
46
|
+
e
|
47
|
+
end
|
48
|
+
|
49
|
+
@path = path
|
50
|
+
@protect_db = protect_db.to_s
|
51
|
+
if @protect_db == 'true'
|
52
|
+
system('clear')
|
53
|
+
Errors::no_dependency('package', 'figlet', '-c Logger')
|
54
|
+
puts(%x(figlet -c Logger).colorize(:red), '====================================================================================='.colorize(:light_black), "\n", ">> [SecurityEnabled] | Now you can remove, modify, encrypt and rename your db.".colorize(:light_red))
|
55
|
+
elsif @protect_db == 'false'
|
56
|
+
system('clear')
|
57
|
+
Errors::no_dependency('package', 'figlet', '-c Logger')
|
58
|
+
puts(%x(figlet -c Logger).colorize(:red), '====================================================================================='.colorize(:light_black))
|
59
|
+
puts "\n>> [SecurityBreach] | If you don't protect your db, it'll be vulnerable to hackers. \n You must need to enable protection and use Gembase.encrypt".colorize(:light_red)
|
60
|
+
end
|
61
|
+
end
|
62
|
+
|
63
|
+
# @!method create_db(db)
|
64
|
+
# Create a new DataBase file with the given name
|
65
|
+
# @param db [String] the name for your DataBase file
|
66
|
+
#
|
67
|
+
# @example Create a DB called example
|
68
|
+
# create_db('example') #=> 'example.rudb'
|
69
|
+
def self.create_db(db)
|
70
|
+
begin
|
71
|
+
raise Errors::invalid_param('db', 'String', 'Gembase.create_db') until db.is_a?(String)
|
72
|
+
rescue => e
|
73
|
+
e
|
74
|
+
end
|
75
|
+
|
76
|
+
if @path.eql?('root')
|
77
|
+
@dbf = %x(find #{db}.erudb 2>/dev/null | wc -l).to_i # Identify if there's an encrypted db file
|
78
|
+
else
|
79
|
+
@dbf = %x(find #{@path}/#{db}.erudb 2>/dev/null | wc -l).to_i
|
80
|
+
end
|
81
|
+
|
82
|
+
if @dbf == 0
|
83
|
+
if @path.eql?('root')
|
84
|
+
FileUtils.touch("#{db}.rudb")
|
85
|
+
else
|
86
|
+
FileUtils.touch("#{@path}/#{db}.rudb")
|
87
|
+
end
|
88
|
+
end
|
17
89
|
end
|
18
90
|
|
19
|
-
#
|
20
|
-
#
|
21
|
-
#
|
91
|
+
# @!method create_category(db, category)
|
92
|
+
# Create a new Category inside our DataBase
|
93
|
+
# @param db [String] the name of your DataBase file
|
94
|
+
# @param category [String] the name of your category
|
22
95
|
#
|
23
|
-
#
|
24
|
-
|
25
|
-
|
26
|
-
|
96
|
+
# @example Creating the users category
|
97
|
+
# create_category('example', 'users')
|
98
|
+
def self.create_category(db, category)
|
99
|
+
begin
|
100
|
+
raise Errors::invalid_param('db', 'String', 'Gembase.create_category') until db.is_a?(String)
|
101
|
+
rescue => e
|
102
|
+
e
|
103
|
+
end
|
104
|
+
|
105
|
+
begin
|
106
|
+
raise Errors::invalid_param('category', 'String', 'Gembase.create_category') until category.is_a?(String)
|
107
|
+
rescue => e
|
108
|
+
e
|
109
|
+
end
|
27
110
|
|
28
111
|
category_name = {
|
29
|
-
|
112
|
+
category.to_s => {}
|
30
113
|
}
|
31
114
|
|
32
|
-
|
33
|
-
|
115
|
+
if @dbf == 0
|
116
|
+
if @path.eql?('root')
|
117
|
+
File.open("#{db}.rudb", 'a+') do |f|
|
118
|
+
f.write(category_name.to_yaml)
|
119
|
+
end
|
120
|
+
else
|
121
|
+
File.open("#{@path}/#{db}.rudb", 'a+') do |f|
|
122
|
+
f.write(category_name.to_yaml)
|
123
|
+
end
|
124
|
+
end
|
34
125
|
end
|
35
126
|
end
|
36
127
|
|
37
|
-
#
|
38
|
-
#
|
39
|
-
#
|
40
|
-
#
|
128
|
+
# @!method nested_category(db, parent_category, nested_category)
|
129
|
+
# Create a new nested category
|
130
|
+
# @param db [String] the nme of your DataBase file
|
131
|
+
# @param parent_category [String] the name of your parent category
|
132
|
+
# @param nested_category [String] the name of the nested category
|
133
|
+
#
|
134
|
+
# @example Creating a premium nested category
|
135
|
+
# nested_category('example', 'users', 'premium')
|
41
136
|
#
|
42
|
-
#
|
43
|
-
def
|
44
|
-
|
45
|
-
|
46
|
-
|
137
|
+
# @since 0.5.0
|
138
|
+
def self.nested_category(db, parent_category, nested_category)
|
139
|
+
begin
|
140
|
+
raise Errors::invalid_param('db', 'String', 'Gembase.nested_category') until db.is_a?(String)
|
141
|
+
rescue => e
|
142
|
+
e
|
143
|
+
end
|
144
|
+
|
145
|
+
begin
|
146
|
+
raise Errors::invalid_param('parent_category', 'String', 'Gembase.nested_category') until parent_category.is_a?(String)
|
147
|
+
rescue => e
|
148
|
+
e
|
149
|
+
end
|
150
|
+
|
151
|
+
begin
|
152
|
+
raise Errors::invalid_param('nested_category', 'String', 'Gembase.nested_category') until nested_category.is_a?(String)
|
153
|
+
rescue => e
|
154
|
+
e
|
155
|
+
end
|
47
156
|
|
48
|
-
@
|
49
|
-
|
50
|
-
|
51
|
-
|
157
|
+
if @dbf == 0
|
158
|
+
if @path.eql?('root')
|
159
|
+
@@database = File.open("#{db}.rudb")
|
160
|
+
else
|
161
|
+
@@database = File.open("#{@path}/#{db}.rudb")
|
162
|
+
end
|
163
|
+
|
164
|
+
@@data = YAML.load(@@database)
|
165
|
+
@@data[parent_category.to_s].store(nested_category.to_s, {})
|
166
|
+
File.write(@@database, @@data.to_yaml)
|
167
|
+
end
|
52
168
|
end
|
53
169
|
|
54
|
-
#
|
55
|
-
#
|
56
|
-
#
|
57
|
-
#
|
58
|
-
#
|
170
|
+
# @!method add_object(db, category, key, value)
|
171
|
+
# Create an object inside a category
|
172
|
+
# @param db [String] the name of your DataBase file
|
173
|
+
# @param category [String] the name of your category
|
174
|
+
# @param key [String] the key name of your object
|
175
|
+
# @param value [String, Integer, Boolean] the value of your key
|
59
176
|
#
|
60
|
-
#
|
177
|
+
# @example Add object 'bloodbath' with value 'premium'
|
178
|
+
# add_object('example', 'users', 'bloodbath', 'premium')
|
61
179
|
#
|
62
|
-
#
|
63
|
-
def
|
64
|
-
|
65
|
-
|
66
|
-
|
180
|
+
# @deprecated Use {#create_object} instead.
|
181
|
+
def self.add_object(db, category, key, value)
|
182
|
+
begin
|
183
|
+
raise Errors::invalid_param('db', 'String', 'Gembase.add_object') until db.is_a?(String)
|
184
|
+
rescue => e
|
185
|
+
e
|
186
|
+
end
|
67
187
|
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
188
|
+
begin
|
189
|
+
raise Errors::invalid_param('category', 'String', 'Gembase.add_object') until category.is_a?(String)
|
190
|
+
rescue => e
|
191
|
+
e
|
192
|
+
end
|
193
|
+
|
194
|
+
begin
|
195
|
+
raise Errors::invalid_param('key', 'String', 'Gembase.add_object') until key.is_a?(String)
|
196
|
+
rescue => e
|
197
|
+
e
|
198
|
+
end
|
199
|
+
|
200
|
+
puts "\n>> [WARNING] | add_object Method is deprecated. Please use create_object Method instead.".colorize(:red)
|
201
|
+
if @dbf == 0
|
202
|
+
@@database
|
203
|
+
@@data
|
204
|
+
@@data[category.to_s].store(key.to_s, value)
|
205
|
+
end
|
72
206
|
end
|
73
207
|
|
74
|
-
#
|
75
|
-
#
|
76
|
-
#
|
77
|
-
#
|
78
|
-
#
|
79
|
-
#
|
80
|
-
#
|
81
|
-
#
|
82
|
-
#
|
83
|
-
#
|
84
|
-
#
|
85
|
-
#
|
86
|
-
#
|
87
|
-
#
|
88
|
-
#
|
89
|
-
|
90
|
-
|
91
|
-
|
208
|
+
# @!method create_object(db, key, value, category=nil, subcategory=nil)
|
209
|
+
# Create an object outside a category
|
210
|
+
# @param db [String] the name of your DataBase file
|
211
|
+
# @param key [String] the key name of your object
|
212
|
+
# @param value [String, Integer, Boolean] the value of your key
|
213
|
+
# @param category [String] the name of your category
|
214
|
+
# @param subcategory [String] the name of your subcategory
|
215
|
+
#
|
216
|
+
# @example Create object 'server' with value 'localhost:8080'. Without categories.
|
217
|
+
# create_object('example', 'server', 'localhost:8080')
|
218
|
+
#
|
219
|
+
# @example Create object 'users-limit' with value 5 in 'users' category.
|
220
|
+
# create_object('example', 'users-limit', 5, 'users')
|
221
|
+
#
|
222
|
+
# @example Create object 'bloodbath' with value true in 'premium' subcategory.
|
223
|
+
# create_object('example', 'bloodbath', true, 'users', 'premium')
|
224
|
+
def self.create_object(db, key, value, category=nil, subcategory=nil)
|
225
|
+
begin
|
226
|
+
raise Errors::invalid_param('db', 'String', 'Gembase.create_object') until db.is_a?(String)
|
227
|
+
rescue => e
|
228
|
+
e
|
229
|
+
end
|
230
|
+
|
231
|
+
begin
|
232
|
+
raise Errors::invalid_param('key', 'String', 'Gembase.create_object') until key.is_a?(String)
|
233
|
+
rescue => e
|
234
|
+
e
|
235
|
+
end
|
92
236
|
|
93
|
-
if
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
raise "category must be an String" until category.is_a?(String)
|
100
|
-
if subcategory.to_s.length == 0
|
101
|
-
@database
|
102
|
-
@data
|
103
|
-
@data["#{category}"].store("#{key}", "#{value}")
|
104
|
-
@save
|
237
|
+
if @dbf == 0
|
238
|
+
if category.to_s.length.zero?
|
239
|
+
@@database
|
240
|
+
@@data
|
241
|
+
@@data.store(key.to_s, value)
|
242
|
+
File.write(@@database, @@data.to_yaml)
|
105
243
|
else
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
244
|
+
begin
|
245
|
+
raise Errors::invalid_param('category', 'String', 'Gembase.create_object') until category.is_a?(String)
|
246
|
+
rescue => e
|
247
|
+
e
|
248
|
+
end
|
249
|
+
if subcategory.to_s.length.zero?
|
250
|
+
@@database
|
251
|
+
@@data
|
252
|
+
@@data
|
253
|
+
@@data[category.to_s].store(key.to_s, value)
|
254
|
+
File.write(@@database, @@data.to_yaml)
|
255
|
+
else
|
256
|
+
begin
|
257
|
+
raise Errors::invalid_param('subcategory', 'String', 'Gembase.create_object') until subcategory.is_a?(String)
|
258
|
+
rescue => e
|
259
|
+
e
|
260
|
+
end
|
261
|
+
@@database
|
262
|
+
@@data
|
263
|
+
@@data[category.to_s][subcategory.to_s].store(key.to_s, value)
|
264
|
+
File.write(@@database, @@data.to_yaml)
|
265
|
+
end
|
111
266
|
end
|
112
267
|
end
|
113
268
|
end
|
114
269
|
|
115
270
|
# @!method delete_object(db, key, category=nil, subcategory=nil)
|
116
|
-
# Delete an object inside/outside a category
|
117
|
-
# db
|
118
|
-
# key
|
119
|
-
# category
|
120
|
-
# subcategory
|
121
|
-
#
|
122
|
-
# Deleting object inside a category
|
123
|
-
# delete_object(
|
124
|
-
#
|
125
|
-
# Deleting object inside a subcategory
|
126
|
-
# delete_object(
|
127
|
-
#
|
128
|
-
# Deleting object outside a category
|
129
|
-
# delete_object(
|
130
|
-
#
|
131
|
-
#
|
132
|
-
def
|
133
|
-
|
134
|
-
|
135
|
-
|
136
|
-
|
137
|
-
|
138
|
-
|
139
|
-
|
140
|
-
|
141
|
-
|
142
|
-
|
143
|
-
|
144
|
-
|
145
|
-
|
146
|
-
|
147
|
-
|
148
|
-
|
149
|
-
|
150
|
-
|
271
|
+
# Delete an object inside/outside a category.
|
272
|
+
# @param db [String] the name of your DataBase file
|
273
|
+
# @param key [String] the key name of your object
|
274
|
+
# @param category [String] the name of your category
|
275
|
+
# @param subcategory [String] the name of your subcategory
|
276
|
+
#
|
277
|
+
# @example Deleting object inside a category
|
278
|
+
# delete_object('example', 'users-limit', 'users')
|
279
|
+
#
|
280
|
+
# @example Deleting object inside a subcategory
|
281
|
+
# delete_object('example', 'bloodbath', 'users', 'premium')
|
282
|
+
#
|
283
|
+
# @example Deleting object outside a category
|
284
|
+
# delete_object('example', 'server')
|
285
|
+
#
|
286
|
+
# @note Category is an optional parameter. Use this only when you want to delete an object inside a category.
|
287
|
+
def self.delete_object(db, key, category=nil, subcategory=nil)
|
288
|
+
begin
|
289
|
+
raise Errors::invalid_param('db', 'String', 'Gembase.delete_object') until db.is_a?(String)
|
290
|
+
rescue => e
|
291
|
+
e
|
292
|
+
end
|
293
|
+
|
294
|
+
begin
|
295
|
+
raise Errors::invalid_param('key', 'String', 'Gembase.delete_object') until key.is_a?(String)
|
296
|
+
rescue => e
|
297
|
+
e
|
298
|
+
end
|
299
|
+
|
300
|
+
if @dbf == 0
|
301
|
+
if category.to_s.length.zero?
|
302
|
+
@@database
|
303
|
+
@@data
|
304
|
+
@@data.delete(key.to_s)
|
305
|
+
if @path.eql?('root')
|
306
|
+
File.open("#{db}.rudb", 'w+') do |f|
|
307
|
+
f.write(@@data.to_yaml)
|
308
|
+
end
|
309
|
+
else
|
310
|
+
File.open("#{@path}/#{db}.rudb", 'w+') do |f|
|
311
|
+
f.write(@@data.to_yaml)
|
312
|
+
end
|
151
313
|
end
|
152
314
|
else
|
153
|
-
|
154
|
-
|
155
|
-
|
156
|
-
|
157
|
-
|
158
|
-
|
315
|
+
if subcategory.to_s.length.zero?
|
316
|
+
begin
|
317
|
+
raise Errors::invalid_param('category', 'String', 'Gembase.delete_object') until category.is_a?(String)
|
318
|
+
rescue => e
|
319
|
+
e
|
320
|
+
end
|
321
|
+
@@database
|
322
|
+
@@data
|
323
|
+
@@data[category.to_s].delete(key.to_s)
|
324
|
+
File.open("#{db}.rudb", 'w+') do |f|
|
325
|
+
f.write(@@data.to_yaml)
|
326
|
+
end
|
327
|
+
else
|
328
|
+
begin
|
329
|
+
raise Errors::invalid_param('subcategory', 'String', 'Gembase.delete_object') until subcategory.is_a?(String)
|
330
|
+
rescue => e
|
331
|
+
e
|
332
|
+
end
|
333
|
+
@@database
|
334
|
+
@@data
|
335
|
+
@@data[category.to_s][subcategory.to_s].delete(key.to_s)
|
336
|
+
if @path.eql?('root')
|
337
|
+
File.open("#{db}.rudb", 'w+') do |f|
|
338
|
+
f.write(@@data.to_yaml)
|
339
|
+
end
|
340
|
+
else
|
341
|
+
File.open("#{@path}/#{db}.rudb", 'w+') do |f|
|
342
|
+
f.write(@@data.to_yaml)
|
343
|
+
end
|
344
|
+
end
|
159
345
|
end
|
160
346
|
end
|
161
347
|
end
|
162
348
|
end
|
163
349
|
|
164
|
-
#
|
165
|
-
#
|
166
|
-
#
|
167
|
-
#
|
168
|
-
#
|
169
|
-
#
|
350
|
+
# @!method change_object(db, key, new_value, category=nil, subcategory=nil)
|
351
|
+
# Change the value of an existing object
|
352
|
+
# @param db [String] the name of your DataBase file
|
353
|
+
# @param key [String] the key name of your object
|
354
|
+
# @param new_value [String, Integer, Boolean] the new value of your key
|
355
|
+
# @param category [String] the name of your category
|
356
|
+
# @param subcategory [String] the name of your subcategory
|
170
357
|
#
|
171
|
-
# Change key server value from localhost:8080 to example_host.com outside categories
|
172
|
-
# change_object(
|
358
|
+
# @example Change key server value from localhost:8080 to example_host.com outside categories
|
359
|
+
# change_object('example', 'server', 'example_host.com')
|
173
360
|
#
|
174
|
-
# Change key users-limit value from 5 to 10 into users category
|
175
|
-
# change_object(
|
176
|
-
#
|
177
|
-
# Change key bloodbath value from true to false into premium subcategory
|
178
|
-
# change_object(
|
179
|
-
#
|
180
|
-
#
|
181
|
-
def
|
182
|
-
|
183
|
-
|
184
|
-
|
185
|
-
|
186
|
-
|
187
|
-
|
188
|
-
|
189
|
-
|
190
|
-
|
191
|
-
|
192
|
-
|
193
|
-
|
194
|
-
|
195
|
-
|
196
|
-
|
361
|
+
# @example Change key users-limit value from 5 to 10 into users category
|
362
|
+
# change_object('example', 'users-limit', '10', 'users')
|
363
|
+
#
|
364
|
+
# @example Change key bloodbath value from true to false into premium subcategory
|
365
|
+
# change_object('example', 'bloodbath", false, 'users', 'category')
|
366
|
+
#
|
367
|
+
# @since 0.5.0
|
368
|
+
def self.change_object(db, key, new_value, category=nil, subcategory=nil)
|
369
|
+
begin
|
370
|
+
raise Errors::invalid_param('db', 'String', 'Gembase.change_object') until db.is_a?(String)
|
371
|
+
rescue => e
|
372
|
+
e
|
373
|
+
end
|
374
|
+
|
375
|
+
begin
|
376
|
+
raise Errors::invalid_param('key', 'String', 'Gembase.change_object') until key.is_a?(String)
|
377
|
+
rescue => e
|
378
|
+
e
|
379
|
+
end
|
380
|
+
|
381
|
+
if @dbf == 0
|
382
|
+
if category.to_s.length.zero?
|
383
|
+
@@database
|
384
|
+
@@data
|
385
|
+
@@data[key.to_s] = new_value
|
386
|
+
File.write(@@database, @@data.to_yaml)
|
197
387
|
else
|
198
|
-
|
199
|
-
|
200
|
-
|
201
|
-
|
202
|
-
|
388
|
+
begin
|
389
|
+
raise Errors::invalid_param('category', 'String', 'Gembase.change_object') until category.is_a?(String)
|
390
|
+
rescue => e
|
391
|
+
e
|
392
|
+
end
|
393
|
+
if subcategory.to_s.length.zero?
|
394
|
+
@@database
|
395
|
+
@@data
|
396
|
+
@@data[category.to_s][key.to_s] = new_value
|
397
|
+
File.write(@@database, @@data.to_yaml)
|
398
|
+
else
|
399
|
+
begin
|
400
|
+
raise Errors::invalid_param('subcategory', 'String', 'Gembase.change_object') until subcategory.is_a?(String)
|
401
|
+
rescue => e
|
402
|
+
e
|
403
|
+
end
|
404
|
+
@@database
|
405
|
+
@@data
|
406
|
+
@@data[category.to_s][subcategory.to_s][key.to_s] = new_value
|
407
|
+
File.write(@@database, @@data.to_yaml)
|
408
|
+
end
|
203
409
|
end
|
204
410
|
end
|
205
411
|
end
|
206
412
|
|
207
|
-
#
|
208
|
-
#
|
413
|
+
# @!method parse(db)
|
414
|
+
# Parse the DataBase structure to modify it
|
415
|
+
# @param db [String] the name of your DataBase file
|
416
|
+
#
|
417
|
+
# @example Parsing the DB called 'example'
|
418
|
+
# parse('example')
|
419
|
+
#
|
420
|
+
# @note You can use these two methods (parse and generate) instead of YAML vanilla methods (load and to_yaml).
|
421
|
+
def self.parse(db)
|
422
|
+
begin
|
423
|
+
raise Errors::invalid_param('db', 'String', 'Gembase.parse') until db.is_a?(String)
|
424
|
+
rescue => e
|
425
|
+
e
|
426
|
+
end
|
427
|
+
|
428
|
+
if @dbf == 0
|
429
|
+
@@database
|
430
|
+
@@data
|
431
|
+
end
|
432
|
+
end
|
433
|
+
|
434
|
+
# @!method regenerate(db)
|
435
|
+
# Regenerate the DataBase stucture to YAML structure
|
436
|
+
# @param db [String] the name of your DataBase file
|
437
|
+
#
|
438
|
+
# @example Regenerating the DB called 'example'
|
439
|
+
# regenerate('example')
|
440
|
+
def self.regenerate(db)
|
441
|
+
begin
|
442
|
+
raise Errors::invalid_param('db', 'String', 'Gembase.regenerate') until db.is_a?(String)
|
443
|
+
rescue => e
|
444
|
+
e
|
445
|
+
end
|
446
|
+
|
447
|
+
if @dbf == 0
|
448
|
+
@@database
|
449
|
+
@@data.to_yaml
|
450
|
+
end
|
451
|
+
end
|
452
|
+
|
453
|
+
# @!method encrypt_db(db)
|
454
|
+
# Encrypt your database.
|
455
|
+
# @param db [String] the name of your DataBase file
|
456
|
+
#
|
457
|
+
# @example Encrypting example db
|
458
|
+
# encrypt_db('example') #=> example.erudb
|
209
459
|
#
|
210
|
-
#
|
211
|
-
# parse("example")
|
460
|
+
# @note You'll need to establish a passphrase to encrypt/decrypt.
|
212
461
|
#
|
213
|
-
#
|
214
|
-
def
|
215
|
-
|
462
|
+
# @since 1.0.0
|
463
|
+
def self.encrypt_db(db)
|
464
|
+
begin
|
465
|
+
raise Errors::invalid_param('db', 'String', 'Gembase.encrypt_db') until db.is_a?(String)
|
466
|
+
rescue => e
|
467
|
+
e
|
468
|
+
end
|
216
469
|
|
217
|
-
@
|
218
|
-
|
470
|
+
@encrypted = @dbf
|
471
|
+
|
472
|
+
if @protect_db.eql?('true')
|
473
|
+
if @encrypted == 0
|
474
|
+
puts("\n>> Encrypting your database...".colorize(:light_black), "\n>> Recomendations: set a secure password with more than 8 characters and save\n it in a secure site".colorize(:light_black), "\n")
|
475
|
+
if @path.eql?('root')
|
476
|
+
Errors::no_dependency('gem', 'yaml_vault', "encrypt #{db}.rudb -o #{db}.erudb")
|
477
|
+
system("yaml_vault encrypt #{db}.rudb -o #{db}.erudb")
|
478
|
+
system("rm #{db}.rudb")
|
479
|
+
else
|
480
|
+
Errors::no_dependency('gem', 'yaml_vault', "encrypt #{@path}/#{db}.rudb -o #{@path}/#{db}.erudb")
|
481
|
+
system("yaml_vault encrypt #{@path}/#{db}.rudb -o #{@path}/#{db}.erudb")
|
482
|
+
system("rm #{@path}/#{db}.rudb")
|
483
|
+
end
|
484
|
+
elsif @encrypted != 0
|
485
|
+
puts("\n>> Your database #{db} is already encrypted. If you want to decrypt it\n use decrypt_db method.".colorize(:light_black))
|
486
|
+
end
|
487
|
+
elsif @protect_db.eql?('false')
|
488
|
+
Errors::protected_db(db, 'encrypt')
|
489
|
+
end
|
219
490
|
end
|
220
491
|
|
221
|
-
#
|
222
|
-
#
|
492
|
+
# @!method decrypt_db(db)
|
493
|
+
# Decrypt your database.
|
494
|
+
# @param db [String] the name of your DataBase file
|
495
|
+
#
|
496
|
+
# @example Decrypting example db
|
497
|
+
# decrypt_db('example')
|
498
|
+
#
|
499
|
+
# @note You'll need to decrypt your db to modify it.
|
223
500
|
#
|
224
|
-
#
|
225
|
-
|
226
|
-
|
227
|
-
|
501
|
+
# @since 1.0.0
|
502
|
+
def self.decrypt_db(db)
|
503
|
+
begin
|
504
|
+
raise Errors::invalid_param('db', 'String', 'Gembase.decrypt_db') until db.is_a?(String)
|
505
|
+
rescue => e
|
506
|
+
e
|
507
|
+
end
|
508
|
+
|
509
|
+
if @encrypted != 0
|
510
|
+
puts "\n>> Decrypting your database...".colorize(:light_black)
|
511
|
+
if @path.eql('root')
|
512
|
+
Errors::no_dependency('gem', 'yaml_vault', "decrypt #{db}.erudb -o #{db}.rudb")
|
513
|
+
system("yaml_vault decrypt #{db}.erudb -o #{db}.rudb")
|
514
|
+
else
|
515
|
+
Errors::no_dependency('gem', 'yaml_vault', "decrypt #{db}.erudb -o #{db}.rudb")
|
516
|
+
system("yaml_vault encrypt #{@path}/#{db}.erudb -o #{@path}/#{db}.rudb")
|
517
|
+
end
|
518
|
+
elsif @encrypted == 0
|
519
|
+
puts('Your database isn\'t encrypted. If you want to encrypt it, use encrypt_db method.'.colorize(:light_black))
|
520
|
+
end
|
521
|
+
end
|
228
522
|
|
229
|
-
|
230
|
-
|
523
|
+
# @!method rename_db(old_name, new_name)
|
524
|
+
# Rename your database file.
|
525
|
+
# @param old_name [String] the old name of your DataBase file
|
526
|
+
# @param new_name [String] the new name of your DataBase file
|
527
|
+
#
|
528
|
+
# @example Renaming the example database
|
529
|
+
# rename_db('example', 'example-new')
|
530
|
+
#
|
531
|
+
# @since 1.0.0
|
532
|
+
def self.rename_db(old_name, new_name)
|
533
|
+
begin
|
534
|
+
raise Errors::invalid_param('old_name', 'String', 'Gembase.rename_db') until old_name.is_a?(String)
|
535
|
+
rescue => e
|
536
|
+
e
|
537
|
+
end
|
538
|
+
|
539
|
+
begin
|
540
|
+
raise Errors::invalid_param('new_name', 'String', 'Gembase.rename_db') until new_name.is_a?(String)
|
541
|
+
rescue => e
|
542
|
+
e
|
543
|
+
end
|
544
|
+
|
545
|
+
if %x(find "#{old_name}.rudb" | wc -l).to_i == 0
|
546
|
+
Errors::custom_error(">> [RuntimeError] | The database file #{old_name} doesn't exist or\n has been already renamed.")
|
547
|
+
else
|
548
|
+
if @protect_db.eql?('true')
|
549
|
+
Errors::protected_db(old_name, 'rename')
|
550
|
+
elsif @protect_db.eql?('false')
|
551
|
+
if @path.eql?('root')
|
552
|
+
system("mv #{old_name}.rudb #{new_name}.rudb")
|
553
|
+
else
|
554
|
+
system("mv #{@path}/#{old_name}.rudb #{@path}/#{new_name}.rudb")
|
555
|
+
end
|
556
|
+
end
|
557
|
+
end
|
558
|
+
end
|
559
|
+
|
560
|
+
# @!method delete_db(db)
|
561
|
+
# Delete your database file.
|
562
|
+
# @param db [String] the name of your DataBase file
|
563
|
+
#
|
564
|
+
# @example Deleting example db
|
565
|
+
# delete_rb('example')
|
566
|
+
#
|
567
|
+
# @since 1.0.0
|
568
|
+
def self.delete_db(db)
|
569
|
+
begin
|
570
|
+
raise Errors::invalid_param('db', 'String', 'Gembase.delete_db') until db.is_a?(String)
|
571
|
+
rescue => e
|
572
|
+
e
|
573
|
+
end
|
574
|
+
|
575
|
+
if @protect_db.eql?('true')
|
576
|
+
Errors::protected_db(db, 'delete')
|
577
|
+
elsif @protect_db.eql?('false')
|
578
|
+
if @path.eql?('root')
|
579
|
+
system("rm #{db}.rudb")
|
580
|
+
else
|
581
|
+
system("rm #{@path}/#{db}.rudb")
|
582
|
+
end
|
583
|
+
end
|
584
|
+
end
|
585
|
+
|
586
|
+
# @!method restart_db(db)
|
587
|
+
# Restart your database file.
|
588
|
+
# @param db [String] the name of your DataBase file
|
589
|
+
#
|
590
|
+
# @example Restarting example db
|
591
|
+
# restart_db('example')
|
592
|
+
#
|
593
|
+
# @since 1.0.0
|
594
|
+
def self.restart_db(db)
|
595
|
+
begin
|
596
|
+
raise Errors::invalid_param('db', 'String', 'Gembase.delete_db') until db.is_a?(String)
|
597
|
+
rescue => e
|
598
|
+
e
|
599
|
+
end
|
600
|
+
|
601
|
+
if @protect_db.eql?('true')
|
602
|
+
Errors::protected_db(db, 'restart')
|
603
|
+
elsif @protect_db.eql?('false')
|
604
|
+
if @path.eql?('root')
|
605
|
+
system("rm #{db}.rudb")
|
606
|
+
system("touch #{db}.rudb")
|
607
|
+
else
|
608
|
+
system("rm #{@path}/#{db}.rudb")
|
609
|
+
system("touch #{@path}/#{db}.rudb")
|
610
|
+
end
|
611
|
+
end
|
612
|
+
end
|
613
|
+
|
614
|
+
# @!method working_db
|
615
|
+
# Lists your working/active database files and display her names.
|
616
|
+
#
|
617
|
+
# @example List your working databases
|
618
|
+
# working_db
|
619
|
+
#
|
620
|
+
# @note It only works in your terminal. That's an db monitor and doesn't affect your databases.
|
621
|
+
# Warning: don't use this if you don't have any db file in your work directory to avoid errors.
|
622
|
+
#
|
623
|
+
# @since 1.0.0
|
624
|
+
def self.working_db
|
625
|
+
Errors::no_dependency('package', 'figlet', '-c Viewer')
|
626
|
+
puts("\n", '====================================================================================='.colorize(:light_black), "\n\n", %x(figlet -c Viewer).colorize(:red), '====================================================================================='.colorize(:light_black))
|
627
|
+
files = 'find . -wholename "*.rudb" && find . -wholename "*.erudb"'
|
628
|
+
count = 'find . -wholename "*.rudb" | wc -l && find . -wholename "*.erudb" | wc -l'
|
629
|
+
@working_file = %x(#{files}).sub("\n", ', ').delete_suffix("\n").sub(',', '')
|
630
|
+
@arr_files = Array(@working_file.split(' '))
|
631
|
+
@working_number = %x(#{count}).sub("\n", ', ').delete_suffix("\n").sub(',', '')
|
632
|
+
@arr_count = Array(@working_number.split(' '))
|
633
|
+
@working_numberf = @arr_count[0].to_i + @arr_count[1].to_i
|
634
|
+
puts "\n> Working databases: ".colorize(:light_red) + "#{@working_numberf.to_s.colorize(:light_black)}" + "\n • Unencrypted databases: ".colorize(:light_red) + "#{@arr_count[0].colorize(:light_black)}" + "\n • Encrypted databases: ".colorize(:light_red) + "#{@arr_count[1].colorize(:light_black)}\n\n"
|
635
|
+
@min = 0
|
636
|
+
@max = @working_numberf.to_i
|
637
|
+
loop do
|
638
|
+
@protected = @arr_files[@min].end_with?('.erudb')
|
639
|
+
puts "• #{@arr_files[@min].colorize(:light_black)} \n Protected? #{@protected.to_s.colorize(:red)} \n Size: #{%x(ls -sh #{@arr_files[@min]}).delete_suffix("\n").sub(' ', '').delete_suffix("#{@arr_files[@min]}").colorize(:red)} \n\n"
|
640
|
+
@min += 1
|
641
|
+
if @min >= @max
|
642
|
+
@min = 0
|
643
|
+
break
|
644
|
+
end
|
645
|
+
end
|
646
|
+
Services::closing
|
231
647
|
end
|
232
648
|
end
|
data/lib/services.rb
ADDED
@@ -0,0 +1,202 @@
|
|
1
|
+
#!usr/bin/env ruby
|
2
|
+
# NTBBloodbath | Gembase - Ruby YAML DataBase Manager
|
3
|
+
|
4
|
+
require 'colorize'
|
5
|
+
require_relative 'main'
|
6
|
+
|
7
|
+
# @author NTBBloodbath
|
8
|
+
|
9
|
+
# Boolean Class for Ruby
|
10
|
+
module Boolean; end
|
11
|
+
|
12
|
+
class TrueClass
|
13
|
+
include Boolean
|
14
|
+
end
|
15
|
+
|
16
|
+
class FalseClass
|
17
|
+
include Boolean
|
18
|
+
end
|
19
|
+
|
20
|
+
class Errors < StandardError
|
21
|
+
attr_reader :dependency, :argument, :param, :type, :method, :db
|
22
|
+
|
23
|
+
def self.no_dependency(type, dependency, argument=nil)
|
24
|
+
begin
|
25
|
+
raise Errors.invalid_param('type', 'String', 'Errors.invalid_param') until type.is_a?(String)
|
26
|
+
rescue => e
|
27
|
+
e
|
28
|
+
end
|
29
|
+
|
30
|
+
begin
|
31
|
+
raise Errors.invalid_param('dependency', 'String', 'Errors.invalid_param') until dependency.is_a?(String)
|
32
|
+
rescue => e
|
33
|
+
e
|
34
|
+
end
|
35
|
+
|
36
|
+
if argument.to_s.length == 0
|
37
|
+
if !system("#{dependency}") then
|
38
|
+
puts "\n>> [RuntimeError] | The package #{dependency} isn't installed. \n Do you want to install it? [y/n]".colorize(:light_red)
|
39
|
+
installation = gets.chomp
|
40
|
+
|
41
|
+
case installation
|
42
|
+
when "y"
|
43
|
+
if Dir.home == "/data/data/com.termux/files/home" # Termux installation
|
44
|
+
if type.eql?('package')
|
45
|
+
system("apt install #{dependency}")
|
46
|
+
elsif type.eql?('gem')
|
47
|
+
system("gem install #{dependency}")
|
48
|
+
end
|
49
|
+
else # Linux installation
|
50
|
+
if File.exist?("/usr/bin/apt-get") then # Debian-based OS
|
51
|
+
if type.eql?('package')
|
52
|
+
system("sudo apt-get install #{dependency}")
|
53
|
+
elsif type.eql?('gem')
|
54
|
+
system("sudo gem install #{dependency}")
|
55
|
+
end
|
56
|
+
elsif File.exist?("/usr/bin/pacman") then # Arch OS
|
57
|
+
if type.eql?('package')
|
58
|
+
system("sudo pacman -S #{dependency}")
|
59
|
+
elsif type.eql?('gem')
|
60
|
+
system("sudo gem install #{dependency}")
|
61
|
+
end
|
62
|
+
end
|
63
|
+
end
|
64
|
+
when "n"
|
65
|
+
puts "\n>> [RuntimeError] | You must install the dependencies so that the \n administrator has a good functioning".colorize(:light_red)
|
66
|
+
end
|
67
|
+
end
|
68
|
+
else
|
69
|
+
begin
|
70
|
+
raise Errors.invalid_param('argument', 'String', 'Errors.invalid_param') until argument.is_a?(String)
|
71
|
+
rescue => e
|
72
|
+
e
|
73
|
+
end
|
74
|
+
|
75
|
+
if !system("#{dependency}", "#{argument}") then
|
76
|
+
puts "\n>> [RuntimeError] | The package #{dependency} isn't installed. \n Do you want to install it? [y/n]".colorize(:light_red)
|
77
|
+
installation = gets.chomp
|
78
|
+
|
79
|
+
case installation
|
80
|
+
when "y"
|
81
|
+
if Dir.home == "/data/data/com.termux/files/home" # Termux installation
|
82
|
+
if type.eql?('package')
|
83
|
+
system("apt install #{dependency}")
|
84
|
+
elsif type.eql?('gem')
|
85
|
+
system("gem install #{dependency}")
|
86
|
+
end
|
87
|
+
else # Linux installation
|
88
|
+
if File.exist?("/usr/bin/apt-get") then # Debian-based OS
|
89
|
+
if type.eql?('package')
|
90
|
+
system("sudo apt-get install #{dependency}")
|
91
|
+
elsif type.eql?('gem')
|
92
|
+
system("sudo gem install #{dependency}")
|
93
|
+
end
|
94
|
+
elsif File.exist?("/usr/bin/pacman") then # Arch OS
|
95
|
+
if type.eql?('package')
|
96
|
+
system("sudo pacman -S #{dependency}")
|
97
|
+
elsif type.eql?('gem')
|
98
|
+
system("sudo gem install #{dependency}")
|
99
|
+
end
|
100
|
+
end
|
101
|
+
end
|
102
|
+
when "n"
|
103
|
+
puts "\n>> [RuntimeError] | You must install the dependencies so that the \n administrator has a good functioning".colorize(:light_red)
|
104
|
+
end
|
105
|
+
end
|
106
|
+
end
|
107
|
+
end
|
108
|
+
|
109
|
+
def self.custom_error(message)
|
110
|
+
begin
|
111
|
+
raise Errors.invalid_param('message', 'String', 'Errors.custom_error') until message.is_a?(String)
|
112
|
+
rescue => e
|
113
|
+
e
|
114
|
+
end
|
115
|
+
|
116
|
+
puts("\n#{message}".colorize(:light_red))
|
117
|
+
end
|
118
|
+
|
119
|
+
def self.invalid_param(param, type, method)
|
120
|
+
begin
|
121
|
+
raise Errors.invalid_param('param', 'String', 'Errors.invalid_param') until param.is_a?(String)
|
122
|
+
rescue => e
|
123
|
+
e
|
124
|
+
end
|
125
|
+
|
126
|
+
begin
|
127
|
+
raise Errors.invalid_param('type', 'String', 'Errors.invalid_param') until type.is_a?(String)
|
128
|
+
rescue => e
|
129
|
+
e
|
130
|
+
end
|
131
|
+
|
132
|
+
begin
|
133
|
+
raise Errors.invalid_param('method', 'String', 'Errors.invalid_param') until method.is_a?(String)
|
134
|
+
rescue => e
|
135
|
+
e
|
136
|
+
end
|
137
|
+
|
138
|
+
case type
|
139
|
+
when 'String'
|
140
|
+
puts "\n>> [RuntimeError] | #{param} must be an String on #{method}! \n Your code won't work properly. Please rewrite your code and restart it.".colorize(:light_red)
|
141
|
+
when 'Integer'
|
142
|
+
puts "\n>> [RuntimeError] | #{param} must be an Integer on #{method}! \n Your code won't work properly. Please rewrite your code and restart it.".colorize(:light_red)
|
143
|
+
when 'Boolean'
|
144
|
+
puts "\n>> [RuntimeError] | #{param} must be an Boolean on #{method}! \n Your code won't work properly. Please rewrite your code and restart it.".colorize(:light_red)
|
145
|
+
end
|
146
|
+
end
|
147
|
+
|
148
|
+
def self.protected_db(db, method)
|
149
|
+
begin
|
150
|
+
raise Errors.invalid_param('db', 'String', 'Errors.protected_db') until db.is_a?(String)
|
151
|
+
rescue => e
|
152
|
+
e
|
153
|
+
end
|
154
|
+
|
155
|
+
begin
|
156
|
+
raise Errors.invalid_param('method', 'String', 'Errors.protected_db') until method.is_a?(String)
|
157
|
+
rescue => e
|
158
|
+
e
|
159
|
+
end
|
160
|
+
|
161
|
+
case method
|
162
|
+
when 'rename'
|
163
|
+
puts "\n>> [SecurityError] | #{db}.rudb is protected! \n If you want to rename it, you'll need to disable the Gembase protection.".colorize(:light_red)
|
164
|
+
when 'delete'
|
165
|
+
puts "\n>> [SecurityError] | #{db}.rudb is protected! \n If you want to delete it, you'll need to disable the Gembase protection.".colorize(:light_red)
|
166
|
+
when 'restart'
|
167
|
+
puts "\n>> [SecurityError] | #{db}.rudb is protected! \n If you want to restart it, you'll need to disable the Gembase protection.".colorize(:light_red)
|
168
|
+
when 'encrypt'
|
169
|
+
puts "\n>> [SecurityError] | #{db}.rudb isn't protected! \n If you want to encrypt it, you'll need to enable the Gembase protection.".colorize(:light_red)
|
170
|
+
end
|
171
|
+
end
|
172
|
+
end
|
173
|
+
|
174
|
+
class Services
|
175
|
+
def self.closing
|
176
|
+
begin
|
177
|
+
puts("\n", '====================================================================================='.colorize(:light_black), "\n>> [Note] | Put exit to close the Manager and clear your screen".colorize(:light_red))
|
178
|
+
print ">> ".colorize(:light_black)
|
179
|
+
close = gets.chomp
|
180
|
+
puts ' '
|
181
|
+
|
182
|
+
if close.eql?('exit')
|
183
|
+
0.step(limit=100, step=20) do |i|
|
184
|
+
printf("\rClosing the Gembase Manager... ".colorize(:red) + "[%-20s]", "=" * (i/5))
|
185
|
+
%x(sleep 0.5)
|
186
|
+
end
|
187
|
+
%x(sleep 1)
|
188
|
+
system('clear')
|
189
|
+
else
|
190
|
+
puts "Unknown option, restarting the Viewer..."
|
191
|
+
%x(sleep 1)
|
192
|
+
system('clear')
|
193
|
+
%x(sleep 1)
|
194
|
+
Gembase.working_db
|
195
|
+
end
|
196
|
+
rescue Interrupt
|
197
|
+
puts 'Closing the Gembase Manager...'.colorize(:red)
|
198
|
+
%x(sleep 0.5)
|
199
|
+
system('clear')
|
200
|
+
end
|
201
|
+
end
|
202
|
+
end
|
metadata
CHANGED
@@ -1,17 +1,57 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: gembase
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 1.0.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- NTB Bloodbath
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-02-
|
12
|
-
dependencies:
|
13
|
-
|
14
|
-
|
11
|
+
date: 2020-02-24 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: colorize
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - "~>"
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '0.8'
|
20
|
+
- - ">="
|
21
|
+
- !ruby/object:Gem::Version
|
22
|
+
version: 0.8.1
|
23
|
+
type: :runtime
|
24
|
+
prerelease: false
|
25
|
+
version_requirements: !ruby/object:Gem::Requirement
|
26
|
+
requirements:
|
27
|
+
- - "~>"
|
28
|
+
- !ruby/object:Gem::Version
|
29
|
+
version: '0.8'
|
30
|
+
- - ">="
|
31
|
+
- !ruby/object:Gem::Version
|
32
|
+
version: 0.8.1
|
33
|
+
- !ruby/object:Gem::Dependency
|
34
|
+
name: yaml_vault
|
35
|
+
requirement: !ruby/object:Gem::Requirement
|
36
|
+
requirements:
|
37
|
+
- - "~>"
|
38
|
+
- !ruby/object:Gem::Version
|
39
|
+
version: 1.0.0
|
40
|
+
- - ">="
|
41
|
+
- !ruby/object:Gem::Version
|
42
|
+
version: 1.1.3
|
43
|
+
type: :runtime
|
44
|
+
prerelease: false
|
45
|
+
version_requirements: !ruby/object:Gem::Requirement
|
46
|
+
requirements:
|
47
|
+
- - "~>"
|
48
|
+
- !ruby/object:Gem::Version
|
49
|
+
version: 1.0.0
|
50
|
+
- - ">="
|
51
|
+
- !ruby/object:Gem::Version
|
52
|
+
version: 1.1.3
|
53
|
+
description: Gembase is a YAML database manager gem for Ruby. Very powerful, simple
|
54
|
+
and effective.
|
15
55
|
email:
|
16
56
|
- bloodbathalchemist@protonmail.com
|
17
57
|
executables: []
|
@@ -19,6 +59,7 @@ extensions: []
|
|
19
59
|
extra_rdoc_files: []
|
20
60
|
files:
|
21
61
|
- lib/main.rb
|
62
|
+
- lib/services.rb
|
22
63
|
homepage: https://rubygems.org/gems/gembase
|
23
64
|
licenses:
|
24
65
|
- MIT
|
@@ -43,5 +84,5 @@ requirements: []
|
|
43
84
|
rubygems_version: 3.0.3
|
44
85
|
signing_key:
|
45
86
|
specification_version: 4
|
46
|
-
summary: Gembase is a database gem
|
87
|
+
summary: Gembase is a YAML database manager gem for Ruby.
|
47
88
|
test_files: []
|