Module: Msg
- Defined in:
- lib/spior/msg.rb
Overview
Used to display various message
Class Method Summary collapse
- .banner ⇒ Object
- .err(text) ⇒ Object
- .head ⇒ Object
- .info(text) ⇒ Object
- .p(text) ⇒ Object
- .report(text) ⇒ Object
Class Method Details
.banner ⇒ Object
9 10 11 12 13 14 15 16 |
# File 'lib/spior/msg.rb', line 9 def puts puts '┏━┓┏━┓╻┏━┓┏━┓' puts '┗━┓┣━┛┃┃ ┃┣┳┛' puts '┗━┛╹ ╹┗━┛╹┗╸' puts # generated with toilet -F crop -f future spior end |
.err(text) ⇒ Object
29 30 31 32 33 34 |
# File 'lib/spior/msg.rb', line 29 def err(text) opn = Rainbow('[').red msg = Rainbow('-').white cls = Rainbow(']').red puts "#{opn}#{msg}#{cls} #{text}" end |
.head ⇒ Object
18 19 20 |
# File 'lib/spior/msg.rb', line 18 def head puts Rainbow('------------------------------------------------').cyan end |
.info(text) ⇒ Object
36 37 38 39 40 41 |
# File 'lib/spior/msg.rb', line 36 def info(text) one = Rainbow('_').blue two = Rainbow('-').white thr = Rainbow('_').blue puts "#{one}#{two}#{thr} #{text} #{one}#{two}#{thr}" end |
.p(text) ⇒ Object
22 23 24 25 26 27 |
# File 'lib/spior/msg.rb', line 22 def p(text) opn = Rainbow('[').cyan msg = Rainbow('+').white cls = Rainbow(']').cyan puts "#{opn}#{msg}#{cls} #{text}" end |
.report(text) ⇒ Object
43 44 45 46 47 48 49 |
# File 'lib/spior/msg.rb', line 43 def report(text) puts info text puts 'Please, report this issue at https://github.com/szorfein/spior/issues' puts exit 1 end |