class Nasl::CommandParse

Public Class Methods

analyze(cfg, path, args) click to toggle source
# File lib/nasl/commands/parse.rb, line 33
def self.analyze(cfg, path, args)
  begin
    contents = File.open(path, "rb").read
  rescue
    puts "Failed to read in the contents of the file."
    return
  end

  begin
    Parser.new.parse(contents, path)
  rescue Exception => e
    puts "Failed to parse the contents of the file."
    puts e.message
    puts e.backtrace
    return
  end

  puts "Successfully parsed the contents of the file."
end
binding() click to toggle source
# File lib/nasl/commands/parse.rb, line 29
def self.binding
  'parse'
end