glib 0.0.7 → 0.0.8

Sign up to get free protection for your applications and to get access to all the features.
Files changed (3) hide show
  1. checksums.yaml +4 -4
  2. data/lib/glib.rb +2 -86
  3. metadata +1 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: ff540d005751a6deb53d2ca49c914704c9f7a9bf
4
- data.tar.gz: 393de213f32ee042756a8ceeb32b8d4c9cbff120
3
+ metadata.gz: b077e0812e4842f9d98b58770561d78492617156
4
+ data.tar.gz: 45b1e631e5e3cc35c5407b184fbc36ca2d909d51
5
5
  SHA512:
6
- metadata.gz: be19a98ce6b7437452e5a16f1f1d4858dc196cf058ebd81eb2433cdfc4b5755cf2c1f3f32681232f45ecb8c99e668aa64457edaf5965fb2a653c73c1720a015c
7
- data.tar.gz: 21789dede14cda6473bceda2ef8f3ae39e94cf879c75b8e6457a1decd4ca67bd897956b51aa6281778a96cbb602fa774bc5e30c2cf1687a02a2c48cc8591987a
6
+ metadata.gz: a347dee040ca8a0eeb6438ad5de94b7ff4252b8902fcb529b8e4490b37af5c8748bce246d1459dacf49f773663d279c4f904e2ce4695d77fbe4bd298a96540eb
7
+ data.tar.gz: 8eee8fbb7b224f327a9daef0641fea0af50332aa473166c656a45095799951b1a8fd9e5aeba56ad5fa5bd1a03384563ec9ffcf8282fddf496371c213a10378b9
data/lib/glib.rb CHANGED
@@ -1,86 +1,2 @@
1
- module Glib
2
- def self.isodd?(input)
3
- return input % 2 != 0
4
- end
5
-
6
-
7
- def self.iseven?(input)
8
- return input % 2 == 0
9
- end
10
-
11
-
12
- def self.greatest(array)
13
- if not array.kind_of?(Array) then raise TypeError end
14
- greatest_index = 0
15
- for i in 0..array.length - 1
16
- if array[i] > array[greatest_index]
17
- greatest_index = i
18
- end
19
- end
20
- return greatest_index
21
- end
22
-
23
-
24
- def self.smallest(array)
25
- if not array.kind_of?(Array) then raise TypeError end
26
- smallest_index = 0
27
- for i in 1..array.length - 1
28
- if array[i] < array[smallest_index]
29
- smallest_index = i
30
- end
31
- end
32
- return smallest_index
33
- end
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)
46
- if not File.exist?(path) then raise NoMethodError end
47
- lines = File.readlines(path)
48
- config = {}
49
- lines.each do |line|
50
- key, value = line.split(": ")
51
- config.merge({key => value})
52
- end
53
- end
54
-
55
- def self.tableprint(array)
56
- if not array.kind_of?(Array) then raise TypeError end
57
- long = 0
58
- for i in 0..array.length - 1
59
- for j in 0..array[i].length - 1
60
- if array[i][j].to_s.length > long
61
- long = array[i][j].to_s.length
62
- end
63
- end
64
- end
65
-
66
- for i in 0..array.length - 1
67
- for j in 0..array[i].length - 1
68
- spaces = " "
69
- for k in 1..long - array[i][j].to_s.length
70
- spaces = spaces + " "
71
- end
72
- print array[i][j].to_s + spaces
73
- end
74
- puts ""
75
- end
76
- end
77
-
78
- def self.uniform(array)
79
- if not array.kind_of?(Array) then raise TypeError end
80
- tot = array.length
81
- for i in 1..array.length - 1
82
- if array[i] == array[0] then tot-=1 end
83
- end
84
- return tot == 0
85
- end
86
- end
1
+ require "glib-main"
2
+ require "glib-array"
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: glib
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.7
4
+ version: 0.0.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - Gabriel Vian