Sha256: e58ccd3e93be4a6d8935fac299a8210fa5ed9258483df5d9908a32e718adb54c

Contents?: true

Size: 1.05 KB

Versions: 25

Compression:

Stored size: 1.05 KB

Contents

class JsonExportTasks < Thor
  include Rails.application.config.dradis.thor_helper_module

  namespace     "dradis:plugins:json"

  desc 'export', 'export the current repository structure as a JSON document'
  method_option :output, type: :string, desc: "the report file to create (if ends in .json), or directory to create it in"
  method_option :template, type: :string, desc: "the template file to use. If not provided the value of the 'advanced_word_export:docx' setting will be used."

  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


end

Version data entries

25 entries across 25 versions & 1 rubygems

Version Path
dradis-json-4.14.0 lib/tasks/thorfile.rb
dradis-json-4.13.0 lib/tasks/thorfile.rb
dradis-json-4.11.0 lib/tasks/thorfile.rb
dradis-json-4.10.0 lib/tasks/thorfile.rb
dradis-json-4.9.0 lib/tasks/thorfile.rb
dradis-json-4.8.0 lib/tasks/thorfile.rb
dradis-json-4.7.0 lib/tasks/thorfile.rb
dradis-json-4.6.0 lib/tasks/thorfile.rb
dradis-json-4.5.0 lib/tasks/thorfile.rb
dradis-json-4.4.0 lib/tasks/thorfile.rb
dradis-json-4.3.0 lib/tasks/thorfile.rb
dradis-json-4.2.0 lib/tasks/thorfile.rb
dradis-json-4.1.1 lib/tasks/thorfile.rb
dradis-json-4.0.0 lib/tasks/thorfile.rb
dradis-json-3.22.0 lib/tasks/thorfile.rb
dradis-json-3.21.0 lib/tasks/thorfile.rb
dradis-json-3.20.0 lib/tasks/thorfile.rb
dradis-json-3.19.0 lib/tasks/thorfile.rb
dradis-json-3.18.0 lib/tasks/thorfile.rb
dradis-json-3.17.0 lib/tasks/thorfile.rb