Module: Fylla

Defined in:
lib/fylla/completion_extension.rb,
lib/fylla/version.rb,
lib/fylla/parsed_option.rb,
lib/fylla/parsed_command.rb,
lib/fylla/parsed_subcommand.rb,
lib/fylla/completion_generator.rb,
lib/fylla/thor/extensions/comma_array_extension.rb,
lib/fylla.rb

Overview

Top level module for the Fylla project. Contains one method for initializing Fylla

Defined Under Namespace

Modules: Thor Classes: ParsedCommand, ParsedOption, ParsedSubcommand

Constant Summary collapse

VERSION =
"0.5.2".freeze

Class Method Summary collapse

Class Method Details

.bash_completion(binding, executable_name = @executable_name) ⇒ String

Method to generate bash completions for the current [Thor] application

Parameters:

  • binding (Binding)

    _must always be self_

  • executable_name (String) (defaults to: @executable_name)

    name of your thor executable, must either be provided through #self.load or here.

Returns:

  • (String)

    containing the entire bash completion script.



44
45
46
# File 'lib/fylla.rb', line 44

def self.bash_completion(binding, executable_name = @executable_name)
  binding.class.bash_completion(executable_name)
end

.load(executable_name = nil) ⇒ Object

this method initializes [Fylla] Call this before #Thor.start is called. here or through #self.zsh_completion or #self.bash_completion

Parameters:

  • executable_name (String) (defaults to: nil)

    name of your thor executable, must be provided



23
24
25
26
# File 'lib/fylla.rb', line 23

def self.load(executable_name = nil)
  @executable_name = executable_name || nil
  ::Thor.prepend Fylla::Thor::CompletionGenerator
end

.zsh_completion(binding, executable_name = @executable_name) ⇒ String

Method to generate bash completions for the current [Thor] application

Parameters:

  • binding (Binding)

    _must always be self_

  • executable_name (String) (defaults to: @executable_name)

    name of your thor executable, must either be provided through #self.load or here.

Returns:

  • (String)

    containing the entire zsh completion script.



34
35
36
# File 'lib/fylla.rb', line 34

def self.zsh_completion(binding, executable_name = @executable_name)
  binding.class.zsh_completion(executable_name)
end