putsplus 0.0.2 → 0.0.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/putsplus/version.rb +1 -1
- data/lib/putsplus.rb +17 -6
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4ff886c390af45994820bd5862f3f6642d7f4c09
|
4
|
+
data.tar.gz: 6f1faae6baeb1149fafbf30b5bbe8b0c3c06f3f7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ae1c43b7026bb9986b20b080d70c625578f3506743774333ca83e6059605dff34a7fedb9550319da4b033dd38b3da43c6cf827f21a080edcea387b5d513fa6b4
|
7
|
+
data.tar.gz: 2efa288b6f06c60ccdc9da6d436a2902f7cb87d6682b050058be96ca98c7154d5dc8eaf75815165b7e4c97938c2eb0010ccd9564d4315c9c52d97d258d941af3
|
data/lib/putsplus/version.rb
CHANGED
data/lib/putsplus.rb
CHANGED
@@ -1,16 +1,21 @@
|
|
1
1
|
require "putsplus/version"
|
2
2
|
|
3
3
|
module Putsplus
|
4
|
-
|
5
|
-
#
|
4
|
+
#
|
5
|
+
#Puts only if obj is not null
|
6
6
|
#
|
7
7
|
# Arguments:
|
8
|
-
#
|
9
|
-
#
|
8
|
+
# obj: the obj that will be puts if it isn't null
|
9
|
+
# prefix: obj to append to the puts if obj isn't null
|
10
|
+
#
|
10
11
|
def nputs obj, prefix = nil
|
11
12
|
puts prefix.to_s + obj.to_s unless obj.nil?
|
12
13
|
end
|
13
14
|
|
15
|
+
|
16
|
+
#
|
17
|
+
#Puts each parameter with a tab inbetween each
|
18
|
+
#
|
14
19
|
def tputs *obj
|
15
20
|
out = ""
|
16
21
|
obj.each_with_index do |o, index|
|
@@ -21,6 +26,13 @@ module Putsplus
|
|
21
26
|
puts out
|
22
27
|
end
|
23
28
|
|
29
|
+
#
|
30
|
+
#Puts a line break with given character and length
|
31
|
+
#
|
32
|
+
#Arguments:
|
33
|
+
# num: number of times to repeat the given character. Default is 6.
|
34
|
+
# char: the character or string to repeat. Default is '-'
|
35
|
+
#
|
24
36
|
def linebr num = 6, char = '-'
|
25
37
|
raise Exeception, "num must be an Integer" unless is_int?(num)
|
26
38
|
raise Exeception, "char must be an Character or String" unless (is_string? char)
|
@@ -28,8 +40,7 @@ module Putsplus
|
|
28
40
|
puts char * num
|
29
41
|
end
|
30
42
|
|
31
|
-
|
32
|
-
|
43
|
+
#PRIVATE VARS
|
33
44
|
private
|
34
45
|
|
35
46
|
def is_int? obj
|