Commit a252127e authored by Rene Saarsoo's avatar Rene Saarsoo
Browse files

Rename --export=json to --export=full.

As all exports are in JSON format, it doesn't make sense to have
one export type called "json". The name "full" describes it better.

Renamed JsonExporter to FullExporter accordingly.
parent 840e725f
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -22,7 +22,7 @@ require 'jsduck/source_writer'
require 'jsduck/app_data'
require 'jsduck/index_html'
require 'jsduck/api_exporter'
require 'jsduck/json_exporter'
require 'jsduck/full_exporter'
require 'jsduck/app_exporter'
require 'fileutils'

@@ -58,7 +58,7 @@ module JsDuck
      if @opts.export
        format_classes
        FileUtils.rm_rf(@opts.output_dir) unless @opts.output_dir == :stdout
        exporters = {:json => JsonExporter, :api => ApiExporter}
        exporters = {:full => FullExporter, :api => ApiExporter}
        cw = ClassWriter.new(exporters[@opts.export], @relations, @opts)
        cw.write(@opts.output_dir, ".json")
      else
+2 −2
Original line number Diff line number Diff line
require 'jsduck/json_exporter'
require 'jsduck/full_exporter'
require 'jsduck/renderer'
require 'jsduck/doc_formatter'

module JsDuck

  # Exports data for Docs app.
  class AppExporter < JsonExporter
  class AppExporter < FullExporter
    def initialize(relations, opts)
      super(relations, opts)

+2 −2
Original line number Diff line number Diff line
@@ -2,8 +2,8 @@ require 'jsduck/class'

module JsDuck

  # Exporter for json format
  class JsonExporter
  # Exporter for all the class docs.
  class FullExporter
    def initialize(relations, opts)
      @relations = relations
    end
+5 −5
Original line number Diff line number Diff line
@@ -254,10 +254,10 @@ module JsDuck
          @img_tpl = tpl
        end

        opts.on('--export=FORMAT',
          "Instead of HTML docs, exports docs in FORMAT:",
          "* json - JSON export of all docs.",
          "* api  - JSON of only class- and member names.", " ") do |format|
        opts.on('--export=TYPE',
          "Exports docs in JSON.  TYPE is one of:",
          "* full - full class docs.",
          "* api  - only class- and member names.", " ") do |format|
          @export = format.to_sym
        end

@@ -409,7 +409,7 @@ module JsDuck
      elsif @output_dir == :stdout && !@export
        puts "Output to STDOUT only works when using --export option."
        exit(1)
      elsif ![nil, :json, :api].include?(@export)
      elsif ![nil, :full, :api].include?(@export)
        puts "Unknown export format: #{@export}"
        exit(1)
      elsif @output_dir != :stdout