Method: JsDuck::AppData#write
- Defined in:
- lib/jsduck/app_data.rb
#write(filename) ⇒ Object
Writes classes, guides, videos, and search data to one big .js file
17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 |
# File 'lib/jsduck/app_data.rb', line 17 def write(filename) js = "Docs = " + Util::Json.generate({ :data => { :classes => Icons.new.create(@relations.classes), :guides => @assets.guides.to_array, :videos => @assets.videos.to_array, :examples => @assets.examples.to_array, :search => SearchData.new.create(@relations.classes, @assets, @opts), :guideSearch => @opts.search, :tests => @opts.tests, :signatures => MetaTagRegistry.instance.signatures, :localStorageDb => @opts.local_storage_db, :showPrintButton => @opts.seo, :touchExamplesUi => @opts.touch_examples_ui, :source => @opts.source, :commentsUrl => @opts.comments_url, :commentsDomain => @opts.comments_domain, :message => @opts., } }) + ";\n" File.open(filename, 'w') {|f| f.write(js) } end |