Loading lib/jsduck/app.rb +2 −2 Original line number Diff line number Diff line Loading @@ -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' Loading Loading @@ -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 Loading lib/jsduck/app_exporter.rb +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) Loading lib/jsduck/json_exporter.rb→lib/jsduck/full_exporter.rb +2 −2 Original line number Diff line number Diff line Loading @@ -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 Loading lib/jsduck/options.rb +5 −5 Original line number Diff line number Diff line Loading @@ -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 Loading Loading @@ -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 Loading Loading
lib/jsduck/app.rb +2 −2 Original line number Diff line number Diff line Loading @@ -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' Loading Loading @@ -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 Loading
lib/jsduck/app_exporter.rb +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) Loading
lib/jsduck/json_exporter.rb→lib/jsduck/full_exporter.rb +2 −2 Original line number Diff line number Diff line Loading @@ -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 Loading
lib/jsduck/options.rb +5 −5 Original line number Diff line number Diff line Loading @@ -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 Loading Loading @@ -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 Loading