Module: Lingvo::Console

Defined in:
lib/lingvo/console/command.rb

Defined Under Namespace

Classes: Command

Constant Summary collapse

HELP =
"""
Lingvo #{VERSION}

Options:
  --parse file  - parse lingovleo HTML file with words
  --rand count  - show 'n' random records
  --nitify      - send show word - translation with your notification
  --gui         - show words in simpe window
                  key:  n - show next word
                        q - close window

  --size        - show words count
  -h            - show this help

"""

Class Method Summary collapse

Class Method Details

.no_wordObject



31
32
33
34
# File 'lib/lingvo/console/command.rb', line 31

def no_word
  puts "You don't have any words"
  exit
end

.which(cmd) ⇒ Object



20
21
22
23
24
25
26
27
28
29
# File 'lib/lingvo/console/command.rb', line 20

def which(cmd)
  exts = ENV['PATHEXT'] ? ENV['PATHEXT'].split(';') : ['']
  ENV['PATH'].split(File::PATH_SEPARATOR).each do |path|
    exts.each do |ext|
      exe = File.join(path, "#{cmd}#{ext}")
      return exe if File.executable? exe
    end
  end
  nil
end