class Asker
Asker
main class
Public Class Methods
check(filepath)
click to toggle source
Checking input file syntax @param filepath (String)
# File lib/asker.rb, line 33 def self.check(filepath) Checker.check(filepath) end
create_configuration()
click to toggle source
Create asker configuration files
# File lib/asker.rb, line 26 def self.create_configuration Skeleton.create_configuration end
create_input(dirpath)
click to toggle source
Create asker input demo files @param dirpath (String)
# File lib/asker.rb, line 20 def self.create_input(dirpath) Skeleton.create_input(dirpath) end
start(filepath)
click to toggle source
Start working @param filepath (String) HAML or XML filepath
# File lib/asker.rb, line 40 def self.start(filepath) project, data = load_input(filepath) ConceptDisplayer.show(data[:concepts]) create_output(project, data) end
Private Class Methods
create_output(project, data)
click to toggle source
Create output files: Gift, YAML, TXT Doc rubocop:disable Metrics/AbcSize
# File lib/asker.rb, line 59 def self.create_output(project, data) Logger.verbose "\n[INFO] Creating output files" Logger.verbose ' ├── Gift questions file => ' + Rainbow(project.get(:outputpath)).bright Logger.verbose ' ├── YAML questions file => ' + Rainbow(project.get(:yamlpath)).bright Logger.verbose ' └── Lesson file => ' + Rainbow(project.get(:lessonpath)).bright OutputFileExporter.export(data, project) StatsDisplayer.show(data) project.close # Logger use Project.get(:logfile) until the end end
load_input(args)
click to toggle source
Load input data @param args (Hash)
# File lib/asker.rb, line 49 def self.load_input(args) project = ProjectLoader.load(args) project.open # Open output files data = InputLoader.load(project.get(:inputdirs).split(',')) [project, data] end