Class: Rubbr::Spell

Inherits:
Object
  • Object
show all
Includes:
Cli
Defined in:
lib/rubbr/spell.rb

Instance Method Summary collapse

Methods included from Cli

#color?, #disable_stderr, #disable_stdinn, #disable_stdout, #error, #executable?, #notice, #valid_executable, #warning

Instance Method Details

#checkObject



5
6
7
8
9
10
11
12
13
14
15
16
17
18
# File 'lib/rubbr/spell.rb', line 5

def check
  base_file_path = File.join(Rubbr.options[:source_dir],
                             Rubbr.options[:base_latex_file])
  source_files = Dir["#{Rubbr.options[:source_dir]}/*.tex"]
  source_files.delete base_file_path

  dictionary_path = File.join(Rubbr.options[:spell_dir],
                              Rubbr.options[:spell_file])
  executable = valid_executable(:ispell)

  source_files.each do |file|
    system "#{executable} -t -x -p #{dictionary_path} #{file}"
  end
end