termline 1.0.0 → 1.1.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/termline/list.rb +35 -2
- data/lib/termline/msg.rb +32 -1
- data/lib/termline/space.rb +45 -10
- data/lib/termline/style.rb +50 -18
- data/lib/termline/table.rb +69 -36
- data/lib/termline/version.rb +2 -2
- data/lib/termline.rb +39 -39
- data/readme.md +11 -6
- metadata +1 -2
- data/lib/termline/banner.rb +0 -50
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: e46ef107e4a53ccd8aeddcd6ff33a0747c378455945e4876105bcb00f53b1339
|
|
4
|
+
data.tar.gz: 3cc3d602fce022b3eff07fe2fc71212d565a764fd17163403d8afd3d39784319
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 4804e49bc1dd71fd7184935079a65280c10a19d7d5c01290df933d56180ddaf932f19cd4ff1415618e3357b900e86210b934f28f49f587372ab1a4a3440945a9
|
|
7
|
+
data.tar.gz: fbcd92152d4d8b9534e9102a6523a0bf0a63b8fc81472fb007309f59e4301f05d710fa5380dd42b5f870d7e25cb6f3e8d032d60bc3f3011e83e1d6535421195d
|
data/lib/termline/list.rb
CHANGED
|
@@ -1,8 +1,41 @@
|
|
|
1
|
+
=begin
|
|
2
|
+
|
|
3
|
+
Lesli
|
|
4
|
+
|
|
5
|
+
Copyright (c) 2026, Lesli Technologies, S. A.
|
|
6
|
+
|
|
7
|
+
This program is free software: you can redistribute it and/or modify
|
|
8
|
+
it under the terms of the GNU General Public License as published by
|
|
9
|
+
the Free Software Foundation, either version 3 of the License, or
|
|
10
|
+
(at your option) any later version.
|
|
11
|
+
|
|
12
|
+
This program is distributed in the hope that it will be useful,
|
|
13
|
+
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
14
|
+
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
15
|
+
GNU General Public License for more details.
|
|
16
|
+
|
|
17
|
+
You should have received a copy of the GNU General Public License
|
|
18
|
+
along with this program. If not, see http://www.gnu.org/licenses/.
|
|
19
|
+
|
|
20
|
+
Lesli · Ruby on Rails SaaS Development Framework.
|
|
21
|
+
|
|
22
|
+
Made with ♥ by LesliTech
|
|
23
|
+
Building a better future, one line of code at a time.
|
|
24
|
+
|
|
25
|
+
@contact hello@lesli.tech
|
|
26
|
+
@website https://www.lesli.tech
|
|
27
|
+
@license GPLv3 http://www.gnu.org/licenses/gpl-3.0.en.html
|
|
28
|
+
|
|
29
|
+
// · ~·~ ~·~ ~·~ ~·~ ~·~ ~·~ ~·~ ~·~ ~·~
|
|
30
|
+
// ·
|
|
31
|
+
=end
|
|
1
32
|
|
|
2
33
|
module Termline
|
|
3
34
|
module List
|
|
4
|
-
|
|
5
|
-
|
|
35
|
+
class << self
|
|
36
|
+
def builder(items, icon:, color:)
|
|
37
|
+
items.each { |item| puts(" #{Style.colorize(Style.icon(icon), color)} #{ item }" )}
|
|
38
|
+
end
|
|
6
39
|
end
|
|
7
40
|
end
|
|
8
41
|
end
|
data/lib/termline/msg.rb
CHANGED
|
@@ -1,3 +1,34 @@
|
|
|
1
|
+
=begin
|
|
2
|
+
|
|
3
|
+
Lesli
|
|
4
|
+
|
|
5
|
+
Copyright (c) 2026, Lesli Technologies, S. A.
|
|
6
|
+
|
|
7
|
+
This program is free software: you can redistribute it and/or modify
|
|
8
|
+
it under the terms of the GNU General Public License as published by
|
|
9
|
+
the Free Software Foundation, either version 3 of the License, or
|
|
10
|
+
(at your option) any later version.
|
|
11
|
+
|
|
12
|
+
This program is distributed in the hope that it will be useful,
|
|
13
|
+
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
14
|
+
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
15
|
+
GNU General Public License for more details.
|
|
16
|
+
|
|
17
|
+
You should have received a copy of the GNU General Public License
|
|
18
|
+
along with this program. If not, see http://www.gnu.org/licenses/.
|
|
19
|
+
|
|
20
|
+
Lesli · Ruby on Rails SaaS Development Framework.
|
|
21
|
+
|
|
22
|
+
Made with ♥ by LesliTech
|
|
23
|
+
Building a better future, one line of code at a time.
|
|
24
|
+
|
|
25
|
+
@contact hello@lesli.tech
|
|
26
|
+
@website https://www.lesli.tech
|
|
27
|
+
@license GPLv3 http://www.gnu.org/licenses/gpl-3.0.en.html
|
|
28
|
+
|
|
29
|
+
// · ~·~ ~·~ ~·~ ~·~ ~·~ ~·~ ~·~ ~·~ ~·~
|
|
30
|
+
// ·
|
|
31
|
+
=end
|
|
1
32
|
|
|
2
33
|
module Termline
|
|
3
34
|
module Msg
|
|
@@ -18,7 +49,7 @@ module Termline
|
|
|
18
49
|
parts << message
|
|
19
50
|
parts << data_text(data, color) if data
|
|
20
51
|
|
|
21
|
-
|
|
52
|
+
parts.compact.map(&:to_s).reject(&:empty?).join(" ").strip
|
|
22
53
|
end
|
|
23
54
|
|
|
24
55
|
def alert message
|
data/lib/termline/space.rb
CHANGED
|
@@ -1,17 +1,52 @@
|
|
|
1
|
+
=begin
|
|
2
|
+
|
|
3
|
+
Lesli
|
|
4
|
+
|
|
5
|
+
Copyright (c) 2026, Lesli Technologies, S. A.
|
|
6
|
+
|
|
7
|
+
This program is free software: you can redistribute it and/or modify
|
|
8
|
+
it under the terms of the GNU General Public License as published by
|
|
9
|
+
the Free Software Foundation, either version 3 of the License, or
|
|
10
|
+
(at your option) any later version.
|
|
11
|
+
|
|
12
|
+
This program is distributed in the hope that it will be useful,
|
|
13
|
+
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
14
|
+
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
15
|
+
GNU General Public License for more details.
|
|
16
|
+
|
|
17
|
+
You should have received a copy of the GNU General Public License
|
|
18
|
+
along with this program. If not, see http://www.gnu.org/licenses/.
|
|
19
|
+
|
|
20
|
+
Lesli · Ruby on Rails SaaS Development Framework.
|
|
21
|
+
|
|
22
|
+
Made with ♥ by LesliTech
|
|
23
|
+
Building a better future, one line of code at a time.
|
|
24
|
+
|
|
25
|
+
@contact hello@lesli.tech
|
|
26
|
+
@website https://www.lesli.tech
|
|
27
|
+
@license GPLv3 http://www.gnu.org/licenses/gpl-3.0.en.html
|
|
28
|
+
|
|
29
|
+
// · ~·~ ~·~ ~·~ ~·~ ~·~ ~·~ ~·~ ~·~ ~·~
|
|
30
|
+
// ·
|
|
31
|
+
=end
|
|
1
32
|
|
|
2
33
|
module Termline
|
|
3
34
|
module Space
|
|
35
|
+
class << self
|
|
36
|
+
def builder(character, count)
|
|
37
|
+
character * count
|
|
38
|
+
end
|
|
39
|
+
def br count=1
|
|
40
|
+
puts("\n" * count);
|
|
41
|
+
end
|
|
42
|
+
|
|
43
|
+
def line count=8
|
|
44
|
+
puts('-·- ' * count)
|
|
45
|
+
end
|
|
4
46
|
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
def self.line count=8
|
|
10
|
-
puts('-·- ' * count)
|
|
11
|
-
end
|
|
12
|
-
|
|
13
|
-
def self.color color
|
|
14
|
-
Config.pretty("", :black, color)
|
|
47
|
+
def color color
|
|
48
|
+
Config.pretty("", :black, color)
|
|
49
|
+
end
|
|
15
50
|
end
|
|
16
51
|
end
|
|
17
52
|
end
|
data/lib/termline/style.rb
CHANGED
|
@@ -1,4 +1,34 @@
|
|
|
1
|
+
=begin
|
|
1
2
|
|
|
3
|
+
Lesli
|
|
4
|
+
|
|
5
|
+
Copyright (c) 2026, Lesli Technologies, S. A.
|
|
6
|
+
|
|
7
|
+
This program is free software: you can redistribute it and/or modify
|
|
8
|
+
it under the terms of the GNU General Public License as published by
|
|
9
|
+
the Free Software Foundation, either version 3 of the License, or
|
|
10
|
+
(at your option) any later version.
|
|
11
|
+
|
|
12
|
+
This program is distributed in the hope that it will be useful,
|
|
13
|
+
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
14
|
+
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
15
|
+
GNU General Public License for more details.
|
|
16
|
+
|
|
17
|
+
You should have received a copy of the GNU General Public License
|
|
18
|
+
along with this program. If not, see http://www.gnu.org/licenses/.
|
|
19
|
+
|
|
20
|
+
Lesli · Ruby on Rails SaaS Development Framework.
|
|
21
|
+
|
|
22
|
+
Made with ♥ by LesliTech
|
|
23
|
+
Building a better future, one line of code at a time.
|
|
24
|
+
|
|
25
|
+
@contact hello@lesli.tech
|
|
26
|
+
@website https://www.lesli.tech
|
|
27
|
+
@license GPLv3 http://www.gnu.org/licenses/gpl-3.0.en.html
|
|
28
|
+
|
|
29
|
+
// · ~·~ ~·~ ~·~ ~·~ ~·~ ~·~ ~·~ ~·~ ~·~
|
|
30
|
+
// ·
|
|
31
|
+
=end
|
|
2
32
|
|
|
3
33
|
module Termline
|
|
4
34
|
module Style
|
|
@@ -47,27 +77,29 @@ module Termline
|
|
|
47
77
|
1
|
|
48
78
|
end
|
|
49
79
|
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
80
|
+
class << self
|
|
81
|
+
def icon icon
|
|
82
|
+
ICONS[icon]
|
|
83
|
+
end
|
|
53
84
|
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
85
|
+
# Concat color to text
|
|
86
|
+
def colorize(text, colour = :default, bg_colour = :default)
|
|
87
|
+
colour_code = COLORS[colour]
|
|
88
|
+
bg_colour_code = BG_COLORS[bg_colour]
|
|
89
|
+
return "\e[#{bg_colour_code};#{colour_code}m#{text}\e[0m".squeeze(';')
|
|
90
|
+
end
|
|
91
|
+
|
|
92
|
+
# Format text
|
|
93
|
+
def pretty(message, colour = :default, bg_colour = :default)
|
|
94
|
+
width = 1
|
|
60
95
|
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
width = 1 if width.negative?
|
|
96
|
+
unless bg_colour == :default
|
|
97
|
+
width = WIDTH - message.length - 4
|
|
98
|
+
width = 1 if width.negative?
|
|
99
|
+
end
|
|
100
|
+
|
|
101
|
+
return colorize("#{ message } #{"\ " * width}", colour, bg_colour)
|
|
68
102
|
end
|
|
69
|
-
|
|
70
|
-
return colorize("#{ message } #{"\ " * width}", colour, bg_colour)
|
|
71
103
|
end
|
|
72
104
|
end
|
|
73
105
|
end
|
data/lib/termline/table.rb
CHANGED
|
@@ -1,58 +1,91 @@
|
|
|
1
|
+
=begin
|
|
2
|
+
|
|
3
|
+
Lesli
|
|
4
|
+
|
|
5
|
+
Copyright (c) 2026, Lesli Technologies, S. A.
|
|
6
|
+
|
|
7
|
+
This program is free software: you can redistribute it and/or modify
|
|
8
|
+
it under the terms of the GNU General Public License as published by
|
|
9
|
+
the Free Software Foundation, either version 3 of the License, or
|
|
10
|
+
(at your option) any later version.
|
|
11
|
+
|
|
12
|
+
This program is distributed in the hope that it will be useful,
|
|
13
|
+
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
14
|
+
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
15
|
+
GNU General Public License for more details.
|
|
16
|
+
|
|
17
|
+
You should have received a copy of the GNU General Public License
|
|
18
|
+
along with this program. If not, see http://www.gnu.org/licenses/.
|
|
19
|
+
|
|
20
|
+
Lesli · Ruby on Rails SaaS Development Framework.
|
|
21
|
+
|
|
22
|
+
Made with ♥ by LesliTech
|
|
23
|
+
Building a better future, one line of code at a time.
|
|
24
|
+
|
|
25
|
+
@contact hello@lesli.tech
|
|
26
|
+
@website https://www.lesli.tech
|
|
27
|
+
@license GPLv3 http://www.gnu.org/licenses/gpl-3.0.en.html
|
|
28
|
+
|
|
29
|
+
// · ~·~ ~·~ ~·~ ~·~ ~·~ ~·~ ~·~ ~·~ ~·~
|
|
30
|
+
// ·
|
|
31
|
+
=end
|
|
1
32
|
|
|
2
33
|
module Termline
|
|
3
34
|
module Table
|
|
4
|
-
|
|
35
|
+
class << self
|
|
36
|
+
def builder data, header:true
|
|
5
37
|
|
|
6
|
-
|
|
7
|
-
|
|
38
|
+
return if Gem.win_platform?
|
|
39
|
+
return unless data.size > 0
|
|
8
40
|
|
|
9
|
-
|
|
10
|
-
|
|
41
|
+
table_from_array = true if data.first.class == Array
|
|
42
|
+
header = false if table_from_array
|
|
11
43
|
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
44
|
+
if data.class.name == "ActiveRecord::Relation"
|
|
45
|
+
data = data.to_a.map(&:serializable_hash)
|
|
46
|
+
end
|
|
15
47
|
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
48
|
+
# get the available characters in terminal width
|
|
49
|
+
#terminal_width = `tput cols`.to_i
|
|
50
|
+
terminal_width = Style::WIDTH
|
|
19
51
|
|
|
20
|
-
|
|
21
|
-
|
|
52
|
+
# get the number of columns to print base on the data hash
|
|
53
|
+
cols = data.first.length + 1
|
|
22
54
|
|
|
23
|
-
|
|
24
|
-
|
|
55
|
+
# get the available space for every column
|
|
56
|
+
col_width = (terminal_width / cols) - 1
|
|
25
57
|
|
|
26
|
-
|
|
27
|
-
|
|
58
|
+
# validate that we have minimum space to render the table
|
|
59
|
+
return if col_width <= 0
|
|
28
60
|
|
|
29
|
-
|
|
30
|
-
|
|
61
|
+
# separator for every column and row
|
|
62
|
+
separator = ('| ' << ('- ' * (col_width / 2)))
|
|
31
63
|
|
|
32
|
-
|
|
33
|
-
|
|
64
|
+
# add extra blank spaces to adjust the col_width only if col_width not a even number
|
|
65
|
+
separator += (' ') if (col_width - separator.size).odd?
|
|
34
66
|
|
|
35
|
-
|
|
36
|
-
|
|
67
|
+
# only for table header
|
|
68
|
+
if header
|
|
37
69
|
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
70
|
+
# print table titles
|
|
71
|
+
puts '| ' << data.first.keys.map { |key| key.to_s.upcase.ljust(col_width) }.join('| ')
|
|
72
|
+
end
|
|
41
73
|
|
|
42
|
-
|
|
43
|
-
|
|
74
|
+
# print header separators, only for visible columns
|
|
75
|
+
puts separator * (cols - 1)
|
|
44
76
|
|
|
45
|
-
|
|
46
|
-
|
|
77
|
+
# print data as table :)
|
|
78
|
+
data.each_with_index do |row, index|
|
|
47
79
|
|
|
48
|
-
|
|
49
|
-
|
|
80
|
+
# join hash values as a line and justify every value to print value in its own column
|
|
81
|
+
puts '| ' << row.values.map { |value| value.to_s.ljust(col_width) }.join('| ') unless table_from_array
|
|
50
82
|
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
83
|
+
# print simple value from the array data
|
|
84
|
+
puts '| ' << row.map { |value| value.to_s.ljust(col_width) }.join('| ') if table_from_array
|
|
85
|
+
end
|
|
54
86
|
|
|
55
|
-
|
|
87
|
+
puts separator * (cols - 1) unless header
|
|
88
|
+
end
|
|
56
89
|
end
|
|
57
90
|
end
|
|
58
91
|
end
|
data/lib/termline/version.rb
CHANGED
data/lib/termline.rb
CHANGED
|
@@ -35,63 +35,63 @@ require_relative "termline/table"
|
|
|
35
35
|
require_relative "termline/space"
|
|
36
36
|
require_relative "termline/list"
|
|
37
37
|
require_relative "termline/msg"
|
|
38
|
-
require_relative "termline/banner"
|
|
39
38
|
|
|
40
39
|
|
|
41
40
|
# ·
|
|
42
41
|
module Termline
|
|
42
|
+
class << self
|
|
43
|
+
def m(*messages)
|
|
44
|
+
messages.each { |message| puts(message) }
|
|
45
|
+
end
|
|
43
46
|
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
def self.msg (*messages, **data)
|
|
49
|
-
messages.each { |message| Termline::Msg.builder(message, data:data) }
|
|
50
|
-
end
|
|
47
|
+
def msg(*messages, **data)
|
|
48
|
+
messages.each { |message| puts(Termline::Msg.builder(message, data:data)) }
|
|
49
|
+
end
|
|
51
50
|
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
51
|
+
def info(*messages, tag:'INFO:', icon: :info, **data)
|
|
52
|
+
messages.each { |message| puts(Termline::Msg.builder(message, tag:tag, icon:icon, data:data, color: :blue)) }
|
|
53
|
+
end
|
|
55
54
|
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
55
|
+
def success(*messages, tag:'SUCCESS:', icon: :success, **data)
|
|
56
|
+
messages.each { |message| puts(Termline::Msg.builder(message, tag:tag, icon:icon, data:data, color: :green)) }
|
|
57
|
+
end
|
|
59
58
|
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
59
|
+
def warning(*messages, tag:'WARNING:', icon: :warning, **data)
|
|
60
|
+
messages.each { |message| puts(Termline::Msg.builder(message, tag:tag, icon:icon, data:data, color: :yellow)) }
|
|
61
|
+
end
|
|
63
62
|
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
63
|
+
def danger(*messages, tag:'DANGER:', icon: :error, **data)
|
|
64
|
+
messages.each { |message| puts(Termline::Msg.builder(message, tag:tag, icon:icon, data:data, color: :red)) }
|
|
65
|
+
end
|
|
67
66
|
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
67
|
+
def alert(*messages)
|
|
68
|
+
messages.each { |message| puts(Termline::Msg.alert(message)) }
|
|
69
|
+
end
|
|
71
70
|
|
|
72
71
|
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
72
|
+
def list(*items, color: :default, icon: :debug)
|
|
73
|
+
Termline::List.builder(items, color:color, icon:icon)
|
|
74
|
+
end
|
|
76
75
|
|
|
77
76
|
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
77
|
+
def table(data, header:true)
|
|
78
|
+
Termline::Table.builder(data, header:header)
|
|
79
|
+
end
|
|
81
80
|
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
81
|
+
def br(count=1)
|
|
82
|
+
puts(Termline::Space.builder("\n", count))
|
|
83
|
+
end
|
|
85
84
|
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
85
|
+
def line(count=8)
|
|
86
|
+
puts(Termline::Space.builder('-·- ', count))
|
|
87
|
+
end
|
|
89
88
|
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
89
|
+
def color(color)
|
|
90
|
+
Termline::Space.color(count)
|
|
91
|
+
end
|
|
93
92
|
|
|
94
93
|
|
|
95
|
-
|
|
94
|
+
def deprecation message
|
|
95
|
+
end
|
|
96
96
|
end
|
|
97
97
|
end
|
data/readme.md
CHANGED
|
@@ -17,13 +17,18 @@ bundle add termline
|
|
|
17
17
|
|
|
18
18
|
### Usage
|
|
19
19
|
```ruby
|
|
20
|
+
Termline.msg "Hello world"
|
|
21
|
+
Termline.info "Server started"
|
|
22
|
+
Termline.success "All tests passed"
|
|
23
|
+
Termline.warning "Low disk space"
|
|
24
|
+
Termline.danger "Something failed"
|
|
25
|
+
|
|
20
26
|
Termline.br
|
|
21
|
-
|
|
22
|
-
Termline.
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
Termline.danger("Message with data:", data:{ name: "Luis", last_name: "Donis", title: "Software developer"})
|
|
27
|
+
|
|
28
|
+
Termline.table([
|
|
29
|
+
{ name: "Luis", role: "Admin", status: "Active" },
|
|
30
|
+
{ name: "Ana", role: "Developer", status: "Pending" }
|
|
31
|
+
])
|
|
27
32
|
```
|
|
28
33
|
|
|
29
34
|
**Result:**
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: termline
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 1.
|
|
4
|
+
version: 1.1.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- The Lesli Development Team
|
|
@@ -18,7 +18,6 @@ extensions: []
|
|
|
18
18
|
extra_rdoc_files: []
|
|
19
19
|
files:
|
|
20
20
|
- lib/termline.rb
|
|
21
|
-
- lib/termline/banner.rb
|
|
22
21
|
- lib/termline/list.rb
|
|
23
22
|
- lib/termline/msg.rb
|
|
24
23
|
- lib/termline/space.rb
|
data/lib/termline/banner.rb
DELETED
|
@@ -1,50 +0,0 @@
|
|
|
1
|
-
|
|
2
|
-
module Termline
|
|
3
|
-
module Banner
|
|
4
|
-
def self.title title
|
|
5
|
-
width = WIDTH - title.length - 4
|
|
6
|
-
self.line(WIDTH/8)
|
|
7
|
-
puts title.rjust(width / 2)
|
|
8
|
-
self.line(WIDTH/8)
|
|
9
|
-
end
|
|
10
|
-
|
|
11
|
-
def self.infob *messages
|
|
12
|
-
puts(separator_pretty(:blue))
|
|
13
|
-
messages.each { |message| puts(pretty("INFO: #{ message }", :white, :blue)) }
|
|
14
|
-
puts(separator_pretty(:blue))
|
|
15
|
-
end
|
|
16
|
-
|
|
17
|
-
def self.successb *messages
|
|
18
|
-
puts(separator_pretty(:green))
|
|
19
|
-
messages.each { |message| puts(pretty("SUCCESS: #{ message }", :black, :green)) }
|
|
20
|
-
puts(separator_pretty(:green))
|
|
21
|
-
end
|
|
22
|
-
|
|
23
|
-
def self.warningb *messages
|
|
24
|
-
puts(separator_pretty(:yellow))
|
|
25
|
-
messages.each { |message| puts(pretty("WARNING: #{ message }", :black, :yellow)) }
|
|
26
|
-
puts(separator_pretty(:yellow))
|
|
27
|
-
end
|
|
28
|
-
|
|
29
|
-
def self.dangerb *messages
|
|
30
|
-
puts(separator_pretty(:red))
|
|
31
|
-
messages.each { |message| puts(pretty("ERROR: #{ message }", :yellow, :red)) }
|
|
32
|
-
puts(pretty("PATH: #{ caller[0] }", :yellow, :red))
|
|
33
|
-
puts(separator_pretty(:red))
|
|
34
|
-
end
|
|
35
|
-
|
|
36
|
-
def self.fatal *messages
|
|
37
|
-
puts(separator_pretty(:red))
|
|
38
|
-
messages.each { |message| puts("\e[5m#{pretty(message, :white, :red)}\e[0m") }
|
|
39
|
-
puts(pretty("PATH: #{ caller[0] }", :white, :red))
|
|
40
|
-
puts(separator_pretty(:red))
|
|
41
|
-
end
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
def self.deprecation message
|
|
45
|
-
puts(separator_pretty(:red))
|
|
46
|
-
puts(pretty("DEPRECATED METHOD: #{ caller[0] }, #{ message }", :white, :red))
|
|
47
|
-
puts(separator_pretty(:red))
|
|
48
|
-
end
|
|
49
|
-
end
|
|
50
|
-
end
|