Class: SiSU_XML_SAX::Source::Tidy

Inherits:
Object
  • Object
show all
Defined in:
lib/sisu/xml_sax.rb

Instance Method Summary collapse

Constructor Details

#initialize(md, file) ⇒ Tidy

Returns a new instance of Tidy.



486
487
488
489
# File 'lib/sisu/xml_sax.rb', line 486

def initialize(md,file)
  @md,@file=md,file
  @prog=SiSU_Env::InfoProgram.new
end

Instance Method Details

#xmlObject



490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
# File 'lib/sisu/xml_sax.rb', line 490

def xml
  if @prog.tidy !=false #note values can be other than true
    if (@md.opt.act[:verbose_plus][:set]==:on \
    || @md.opt.act[:maintenance][:set]==:on)
      unless @md.opt.act[:quiet][:set]==:on
        SiSU_Screen::Ansi.new(
          @md.opt.act[:color_state][:set],
          'invert',
          'Using XML Tidy',
          'check document structure'
        ).colorize
        tell=SiSU_Screen::Ansi.new(
          @md.opt.act[:color_state][:set],
          'invert',
          '',
          ''
        )
        tell.grey_open
      end
      tidyfile='/dev/null' #don't want one or screen output, check for alternative flags
      tidy=SiSU_Env::SystemCall.new(@file,tidyfile)
      tidy.well_formed?
      tell.p_off unless @md.opt.act[:quiet][:set]==:on
    end
  end
end