Module: IndentCode

Included in:
Application, Cleaner, IndentCPP
Defined in:
lib/indent_code.rb,
lib/indent_code/cleaner.rb,
lib/indent_code/version.rb,
lib/indent_code/indent_cpp.rb,
lib/indent_code/application.rb

Defined Under Namespace

Classes: Application, Cleaner, IndentCPP

Constant Summary collapse

VERSION =
"0.1.2"
@@options =

command line options.

{
  :tab => 4,
  :lang => 'cpp',
  :style => '',
  :clean => false,
  :delete => false,
}
@@context =

indent parse context.

{
  :indent => 0,
  :linenum => 1,
  :linetxt => '',
  :message => '',
}
@@files =

file descriptors.

{ :fin => nil, :fout => nil, }

Class Method Summary collapse

Class Method Details

.error(m = '') ⇒ Object

error handler, display error message.



31
32
33
34
35
36
37
38
39
40
# File 'lib/indent_code.rb', line 31

def self.error ( m = '' )
  if m == '' then
    puts "ERROR : #{@@context[:message]}."
    puts "LINE  : #{@@context[:linenum]}"
    puts "TEXT  : #{@@context[:linetxt]}"
  else
    puts "ERROR : #{m}."
  end
  exit
end