module PublicanCreatorsGet

This method provides methods for user inputs

Public Class Methods

config_revision() click to toggle source

This method gets the language from the config file for using in RevisionCreator @return [String] language

# File lib/publican_creators/get.rb, line 68
def self.config_revision
  include ParseConfig
  xdg = XDG::Environment.new
  sys_xdg = xdg.config_home
  config = ParseConfig.new("#{sys_xdg}/publican_creators/publicancreators.cfg")
  language = config['language']
  puts language
end
revision() click to toggle source

This method ask for revision information Description: @return [String] revision

# File lib/publican_creators/get.rb, line 48
  def self.revision
    # @note Put the yad input as variable revhistin
    revhistin = `yad --title="Create Revision" --center --on-top --form \
--item-separator=, --separator="|" --field="Choose the directory where your \
project publican.cfg is:LBL" --field="Projectdir:DIR" --field="Enter your \
first revision text:TEXT" --field="Enter your second revision text:TEXT" \
--field="Enter your third revision text:TEXT" --field="Enter your fourth \
revision text:TEXT" --field="Enter your fifth revision text:TEXT" \
--field="Enter Revision number:TEXT" --field="You can use backslashes for \
entering Revision textes with blanks.:LBL" --button="Go!"`
    # @note Format: Directory|One|Two|Three|Four|Five|Revision
    # @note Cleanup the array
    revision = revhistin.chomp.split('|')
    # @note Split the variable to array revision[*]
    puts revision
  end
title() click to toggle source

This method ask for the title, environment, type and optional settings. It returns the title variable. @return [String] environment, type, opt, title

# File lib/publican_creators/get.rb, line 26
  def self.title
    # @note Put the yad input as variable titlein
    titlein = `yad --title="Create documentation" --center --on-top --form \
--item-separator=, --separator="|"  --field="Environment:CBE" \
--field="Type:CBE" --field="Optional:CBE" --field="Enter a title name \
(with underscores instead of blanks and without umlauts):TEXT" \
--field="Please file bugs or feature requests \
on https://bugs.launchpad.net/publicancreators:LBL" --button="Go!" "Work,Private" \
"Article,Book" "Normal,Report,Homework"`
    # @note Format: Work/Private Article/Book title!Normal Report Homework
    # @note Cleanup the array
    environment, type, opt, titlefix = titlein.chomp.split('|')

    # @note replace blanks with underscores
    title = titlefix.tr(' ', '_')

    [environment, type, opt, title]
  end