Module: PublicanCreatorsGet
- Defined in:
- lib/publican_creators/get.rb
Overview
This method provides methods for user inputs
Class Method Summary collapse
-
.config_revision ⇒ String
This method gets the language from the config file for using in RevisionCreator.
-
.revision ⇒ String
This method ask for revision information Description:.
-
.title ⇒ String
This method ask for the title, environment, type and optional settings.
Class Method Details
.config_revision ⇒ String
This method gets the language from the config file for using in RevisionCreator
68 69 70 71 72 73 74 75 |
# 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 ⇒ String
This method ask for revision information Description:
48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 |
# 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 ⇒ String
This method ask for the title, environment, type and optional settings. It returns the title variable.
26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 |
# 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 |