class CLI

Command Line User Interface

Public Instance Methods

check(filename) click to toggle source

Check input file syntax @param filename (String) Path to input file

# File lib/asker/cli.rb, line 51
def check(filename)
  # Enable/disable color output
  Rainbow.enabled = false if options['color'] == false
  # Asker start processing input file
  Asker.check(filename)
end
create_input(dirname) click to toggle source

Create Asker demo input files @param dirname (String) Path to folder

# File lib/asker/cli.rb, line 71
def create_input(dirname)
  Asker.create_input(dirname)
end
file(filename) click to toggle source

Create questions from input file @param filename (String) Path to input file

# File lib/asker/cli.rb, line 41
def file(filename)
  # Asker start processing input file
  Asker.start(filename)
end
init() click to toggle source

Create default INI config file

# File lib/asker/cli.rb, line 62
def init
  Asker.create_configuration
end
method_missing(method, *_args, &_block) click to toggle source

This actions are equals:

  • asker demo/foo.haml

  • asker file demo/fool.haml

# File lib/asker/cli.rb, line 79
def method_missing(method, *_args, &_block)
  file(method.to_s)
end
version() click to toggle source

Show current version

# File lib/asker/cli.rb, line 17
def version
  print Rainbow(Application::NAME).bright.blue
  puts  " (version #{Rainbow(Application::VERSION).green})"
end