class ImageParadise::Interactive

Public Class Methods

[](i = '') click to toggle source
#

[]

#
# File lib/image_paradise/shell/interactive.rb, line 139
def self.[](i = '')
  new(i)
end
new( i = nil, run_already = true ) click to toggle source
#

initialize

#
# File lib/image_paradise/shell/interactive.rb, line 22
def initialize(
    i           = nil,
    run_already = true
  )
  register_sigint
  reset
  set_input(i)
  run if run_already
end

Public Instance Methods

display_prompt() click to toggle source
#

display_prompt

#
# File lib/image_paradise/shell/interactive.rb, line 83
def display_prompt
  print '> '
end
generate_bachelor_and_master_images() click to toggle source
#

generate_bachelor_and_master_images (main tag)

#
# File lib/image_paradise/shell/interactive.rb, line 117
def generate_bachelor_and_master_images
  height_value    =  28
  width_value     =  94
  pointsize_value =  18
  # ======================================================================= #
  # Designate another store-location for our two images there.
  # ======================================================================= #
  ImageParadise.store_image_files_in_this_directory = 
    '/home/x/DATA/IMG/STUDIUM/'
  ImageParadise.write_this_text(
    'Bachelor',
      {colour: 'red', height: height_value, width: width_value, upcase_filename: true, pointsize: pointsize_value}
  )
  ImageParadise.write_this_text(
    'Master',
      {colour: 'darkblue', height: height_value, width: width_value, upcase_filename: true, pointsize: pointsize_value}
  )
end
input?() click to toggle source
#

input?

#
# File lib/image_paradise/shell/interactive.rb, line 49
def input?
  @input
end
menu( i = @input ) click to toggle source
#

menu (menu tag)

#
obtain_user_input() click to toggle source
#

obtain_user_input

#
# File lib/image_paradise/shell/interactive.rb, line 76
def obtain_user_input
  @user_input = $stdin.gets.chomp
end
reset() click to toggle source
#

reset (reset tag)

#
# File lib/image_paradise/shell/interactive.rb, line 35
def reset
end
run() click to toggle source
#

run (run tag)

#
# File lib/image_paradise/shell/interactive.rb, line 56
def run
  try_to_enter_this_directory('/Depot/j')
  loop {
    obtain_user_input
    menu(@user_input)
  }
end
set_input(i = '') click to toggle source
#

set_input

#
# File lib/image_paradise/shell/interactive.rb, line 41
def set_input(i = '')
  i = [i] unless i.is_a? Array
  @input = i # Must be an Array.
end
try_to_enter_this_directory(i = '/Depot/j') click to toggle source
#

try_to_enter_this_directory

#
# File lib/image_paradise/shell/interactive.rb, line 67
def try_to_enter_this_directory(i = '/Depot/j')
  if File.directory?(i)
    chdir(i)
  end
end