glib 1.0.0 → 1.0.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/glib-array.rb +0 -8
- data/lib/glib-main.rb +29 -16
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c1c036a0a7d188edad4081265b41083b581fe4c4
|
4
|
+
data.tar.gz: deca010286e8dc7ccd885e3a685ab600572be27d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: adb1ba2e0a38366a729df02e36f6015f9a94479615c64ce6f9008504a739dc34b5521ff6271cd789a9bff06b202b37f43eff85b54d53fe1b4e9278f81753de39
|
7
|
+
data.tar.gz: 5e56be0839182b75479bff4123cd9b37324c6eb14e8190e6f4594d77f379234ec9585940d424a1aa9f718832f0520cd69c005df6b88d56bcaffea3b21ee5b67f
|
data/lib/glib-array.rb
CHANGED
@@ -21,14 +21,6 @@ class Array
|
|
21
21
|
end
|
22
22
|
end
|
23
23
|
|
24
|
-
def normalize(char = ",")
|
25
|
-
concat = ""
|
26
|
-
for i in 0..self.length - 1
|
27
|
-
concat = concat + self[i] + char
|
28
|
-
end
|
29
|
-
return concat[0..-2]
|
30
|
-
end
|
31
|
-
|
32
24
|
def smallest()
|
33
25
|
smallest_index = 0
|
34
26
|
for i in 1..self.length - 1
|
data/lib/glib-main.rb
CHANGED
@@ -32,24 +32,15 @@ module Glib
|
|
32
32
|
return smallest_index
|
33
33
|
end
|
34
34
|
|
35
|
-
|
36
|
-
def self.normalize(array, char = ",")
|
37
|
-
if not array.kind_of?(Array) then raise TypeError end
|
38
|
-
concat = ""
|
39
|
-
for i in 0..array.length - 1
|
40
|
-
concat = concat + array[i] + char
|
41
|
-
end
|
42
|
-
return concat[0..-2]
|
43
|
-
end
|
44
|
-
|
45
|
-
def self.readconfig(path)
|
35
|
+
def self.readconfig(path, separator = ": ")
|
46
36
|
if not File.exist?(path) then raise NoMethodError end
|
47
37
|
lines = File.readlines(path)
|
48
38
|
config = {}
|
49
39
|
lines.each do |line|
|
50
|
-
key, value = line.split(
|
51
|
-
config.merge({key => value})
|
40
|
+
key, value = line.split(separator)
|
41
|
+
config = config.merge({key => value})
|
52
42
|
end
|
43
|
+
return config
|
53
44
|
end
|
54
45
|
|
55
46
|
def self.tableprint(array)
|
@@ -77,10 +68,32 @@ module Glib
|
|
77
68
|
|
78
69
|
def self.uniform(array)
|
79
70
|
if not array.kind_of?(Array) then raise TypeError end
|
80
|
-
|
71
|
+
check = array.length
|
81
72
|
for i in 1..array.length - 1
|
82
|
-
if array[i] == array[0]
|
73
|
+
if array[i] == array[0]
|
74
|
+
check-=1
|
75
|
+
end
|
83
76
|
end
|
84
|
-
return
|
77
|
+
return check == 0
|
85
78
|
end
|
79
|
+
|
80
|
+
def self.encode(pwd)
|
81
|
+
key = ""
|
82
|
+
|
83
|
+
for i in 0...pwd.length
|
84
|
+
key = key + pwd[i].ord.to_s
|
85
|
+
end
|
86
|
+
|
87
|
+
while key.to_s.length < 30
|
88
|
+
key = key + key.split("").shuffle.join
|
89
|
+
end
|
90
|
+
|
91
|
+
while key.to_s.length > 30
|
92
|
+
key1 = key.to_s.slice(30..-1)
|
93
|
+
key = key.to_s.slice(0..29).to_i + key1.to_i
|
94
|
+
end
|
95
|
+
|
96
|
+
return key
|
97
|
+
end
|
98
|
+
|
86
99
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: glib
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Gabriel Vian
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-
|
11
|
+
date: 2018-05-08 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: Testing gem
|
14
14
|
email: casa@gabrielvian.it
|
@@ -39,7 +39,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
39
39
|
version: '0'
|
40
40
|
requirements: []
|
41
41
|
rubyforge_project:
|
42
|
-
rubygems_version: 2.6.
|
42
|
+
rubygems_version: 2.6.11
|
43
43
|
signing_key:
|
44
44
|
specification_version: 4
|
45
45
|
summary: This is a test
|