Class: SiSU_Zap::Source

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

Instance Method Summary collapse

Constructor Details

#initialize(opt) ⇒ Source

Returns a new instance of Source.



59
60
61
62
# File 'lib/sisu/zap.rb', line 59

def initialize(opt)
  @opt=opt
  @env=SiSU_Env::InfoEnv.new(opt.fns)
end

Instance Method Details

#readObject



63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
# File 'lib/sisu/zap.rb', line 63

def read
  zap_path="#{@env.path.output}/#{@env.fnb}"
  z=SiSU_Env::CleanOutput.new(@opt)
  if SiSU_Env::InfoSettings.new.permission?('zap')
    unless @opt.act[:quiet][:set]==:on
      tell=SiSU_Screen::Ansi.new(
        @opt.act[:color_state][:set],
        "Clean files related to processing #{@opt.selections.str} ->",
        "#{@opt.fns} -> #{zap_path}"
      )
      tell.warn
    end
    z.zap.remove_output
  else
    unless @opt.act[:quiet][:set]==:on
      tell=SiSU_Screen::Ansi.new(
        @opt.act[:color_state][:set],
        'use of -Z (zap) has not enabled in sisurc.yml'
      )
      tell.warn
    end
  end
end