Module: ShowText

Defined in:
lib/show_text.rb

Instance Method Summary collapse

Instance Method Details

#auto_textObject


3
4
5
6
7
# File 'lib/show_text.rb', line 3

def auto_text
  puts #format
  puts "Auto provision".yellow + " means provisioning is done immediately with no"
  puts "confirmation dialogue."
end

#bar_bothObject


9
10
11
12
13
14
# File 'lib/show_text.rb', line 9

def bar_both
  puts # format
  puts bar_top.yellow
  puts bar_low.yellow
  puts # format
end

#bar_lowObject


16
17
18
# File 'lib/show_text.rb', line 16

def bar_low
  "-"*78
end

#bar_topObject


20
21
22
# File 'lib/show_text.rb', line 20

def bar_top
  "_"*34 + " " + "Printsly" + " " + "_"*34
end

#batchy_textObject


24
25
26
27
# File 'lib/show_text.rb', line 24

def batchy_text
  puts #format
  puts "Batch mode".yellow + " means all spreadsheets in the " + "working directory".yellow + " will be processed."
end

#help_textObject


29
30
31
32
33
34
35
36
# File 'lib/show_text.rb', line 29

def help_text
  puts # format
  puts "Please pass the FULL PATH for two directories separated by a space!".red
  puts "Pending files in the first directory and done in the second.".red
  puts # format
  puts "EXAMPLE: printsly /u01/app/cups/pending /u01/app/cups/done".green
  puts # format
end

#lpadmin_puts(printerdata) ⇒ Object


38
39
40
# File 'lib/show_text.rb', line 38

def lpadmin_puts printerdata
  '/usr/sbin/lpadmin -p ' + printerdata[0] + " -L \"" + printerdata[3] + "\" -D \"" + printerdata[2] + "\" -E -v socket://" + printerdata[1] + ":9100 -m raw"
end

#printer_puts(printerdata) ⇒ Object


46
47
48
# File 'lib/show_text.rb', line 46

def printer_puts printerdata
  "Name: ".yellow + printerdata[0] + " " + "Type: ".yellow + printerdata[2] + " " + "IP: ".yellow + printerdata[1] + " " + "Desc: ".yellow + printerdata[3]
end

#prov_text(store) ⇒ Object


42
43
44
# File 'lib/show_text.rb', line 42

def prov_text store
  "This is what I am planning on provisioning for store " + store + ":"
end

#welcome_textObject


50
51
52
53
54
# File 'lib/show_text.rb', line 50

def welcome_text
  puts "If this is the first time to run Printsly, please choose " + "[3]".yellow + " and configure."
  puts #format
  puts "The configuration file is stored in your home directory by default."
end

#work_dir_textObject


56
57
58
59
60
# File 'lib/show_text.rb', line 56

def work_dir_text
  puts #format
  puts "The " + "working directory".yellow + " is the location " + "Printsly".yellow + " will look for"
  puts "spreadsheets containing printers to add to " + "CUPS".yellow + "."
end