Module: Termline

Defined in:
lib/termline.rb,
lib/termline/msg.rb,
lib/termline/list.rb,
lib/termline/space.rb,
lib/termline/style.rb,
lib/termline/table.rb,
lib/termline/version.rb

Overview

Lesli

Copyright © 2026, Lesli Technologies, S. A.

This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program. If not, see www.gnu.org/licenses/.

Lesli · Ruby on Rails SaaS Development Framework.

Made with ♥ by LesliTech Building a better future, one line of code at a time.

// · ~·~ ~·~ ~·~ ~·~ ~·~ ~·~ ~·~ ~·~ ~·~ // ·

Defined Under Namespace

Modules: List, Msg, Space, Style, Table

Constant Summary collapse

VERSION =
"1.1.2"
BUILD =
"1777771350"

Class Method Summary collapse

Class Method Details

.alert(*messages) ⇒ Object



69
70
71
# File 'lib/termline.rb', line 69

def alert(*messages)
    messages.each { |message| puts(Termline::Msg.alert(message)) }
end

.br(count = 1) ⇒ Object



83
84
85
# File 'lib/termline.rb', line 83

def br(count=1)
    puts(Termline::Space.builder("\n", count))
end

.color(color) ⇒ Object



91
92
93
# File 'lib/termline.rb', line 91

def color(color)
    Termline::Space.color(count)
end

.danger(*messages, tag: 'DANGER:', icon: :error, time: true, **data) ⇒ Object



65
66
67
# File 'lib/termline.rb', line 65

def danger(*messages, tag:'DANGER:', icon: :error, time:true, **data)
    messages.each { |message| puts(Termline::Msg.builder(message, tag:tag, icon:icon,  data:data, color: :red, time:time)) }
end

.deprecation(message) ⇒ Object



96
97
# File 'lib/termline.rb', line 96

def deprecation message
end

.info(*messages, tag: 'INFO:', icon: :info, time: true, **data) ⇒ Object



53
54
55
# File 'lib/termline.rb', line 53

def info(*messages, tag:'INFO:', icon: :info, time:true, **data)
    messages.each { |message| puts(Termline::Msg.builder(message, tag:tag, icon:icon,  data:data, color: :blue, time:time)) }
end

.line(count = 8) ⇒ Object



87
88
89
# File 'lib/termline.rb', line 87

def line(count=8)
    puts(Termline::Space.builder('-·-     ', count))
end

.list(*items, color: :default, icon: :debug) ⇒ Object



74
75
76
# File 'lib/termline.rb', line 74

def list(*items, color: :default, icon: :debug)
    Termline::List.builder(items, color:color, icon:icon)
end

.m(*messages) ⇒ Object



45
46
47
# File 'lib/termline.rb', line 45

def m(*messages)
    messages.each { |message| puts(message) }
end

.msg(*messages, **data) ⇒ Object



49
50
51
# File 'lib/termline.rb', line 49

def msg(*messages, **data)
    messages.each { |message| puts(Termline::Msg.builder(message, data:data)) }
end

.success(*messages, tag: 'SUCCESS:', icon: :success, time: true, **data) ⇒ Object



57
58
59
# File 'lib/termline.rb', line 57

def success(*messages, tag:'SUCCESS:', icon: :success, time:true, **data)
    messages.each { |message| puts(Termline::Msg.builder(message, tag:tag, icon:icon, data:data, color: :green, time:time)) }
end

.table(data, header: true) ⇒ Object



79
80
81
# File 'lib/termline.rb', line 79

def table(data, header:true)
    Termline::Table.builder(data, header:header)
end

.warning(*messages, tag: 'WARNING:', icon: :warning, time: true, **data) ⇒ Object



61
62
63
# File 'lib/termline.rb', line 61

def warning(*messages, tag:'WARNING:', icon: :warning, time:true, **data)
    messages.each { |message| puts(Termline::Msg.builder(message, tag:tag, icon:icon,  data:data, color: :yellow, time:time)) }
end