Loading lib/jsduck/class_writer.rb +10 −7 Original line number Diff line number Diff line Loading @@ -24,7 +24,7 @@ module JsDuck private def write_stdout json = @parallel.map(@relations.classes) {|cls| @exporter.export(cls) } json = @parallel.map(@relations.classes) {|cls| @exporter.export(cls) }.compact puts JsonDuck.generate(json) end Loading @@ -34,6 +34,8 @@ module JsDuck filename = dir + "/" + cls[:name] + extension Logger.instance.log("Writing docs", filename) json = @exporter.export(cls) # skip file if exporter returned nil if json if extension == ".json" JsonDuck.write_json(filename, json) elsif extension == ".js" Loading @@ -43,6 +45,7 @@ module JsDuck end end end end end Loading lib/jsduck/examples_exporter.rb +9 −4 Original line number Diff line number Diff line Loading @@ -24,10 +24,15 @@ module JsDuck # Returns hash of class name and inline examples def export(cls) examples = @inline_examples.extract(cls[:doc]) if examples.length > 0 { :name => cls[:name], :examples => @inline_examples.extract(cls[:doc]), } else nil end end end Loading Loading
lib/jsduck/class_writer.rb +10 −7 Original line number Diff line number Diff line Loading @@ -24,7 +24,7 @@ module JsDuck private def write_stdout json = @parallel.map(@relations.classes) {|cls| @exporter.export(cls) } json = @parallel.map(@relations.classes) {|cls| @exporter.export(cls) }.compact puts JsonDuck.generate(json) end Loading @@ -34,6 +34,8 @@ module JsDuck filename = dir + "/" + cls[:name] + extension Logger.instance.log("Writing docs", filename) json = @exporter.export(cls) # skip file if exporter returned nil if json if extension == ".json" JsonDuck.write_json(filename, json) elsif extension == ".js" Loading @@ -43,6 +45,7 @@ module JsDuck end end end end end Loading
lib/jsduck/examples_exporter.rb +9 −4 Original line number Diff line number Diff line Loading @@ -24,10 +24,15 @@ module JsDuck # Returns hash of class name and inline examples def export(cls) examples = @inline_examples.extract(cls[:doc]) if examples.length > 0 { :name => cls[:name], :examples => @inline_examples.extract(cls[:doc]), } else nil end end end Loading