class JsonExportTasks

Public Instance Methods

export() click to toggle source
# File lib/tasks/thorfile.rb, line 10
def export
  require 'config/environment'

  # The options we'll end up passing to the Processor class
  opts = {}

  STDOUT.sync = true
  logger = Logger.new(STDOUT)
  logger.level = Logger::DEBUG
  opts[:logger] = logger
  content_service = nil

  detect_and_set_project_scope

  json = Dradis::Plugins::Json::Exporter.new.export({
    content_service: content_service_for(Dradis::Plugins::Json),
  })

  File.open(report_path, 'w') do |f|
    f << json
  end

  logger.info{ "Report file created at:\n\t#{report_path}" }
  logger.close

end