Class: SC::Builder::TestIndex

Inherits:
Base show all
Defined in:
lib/sproutcore/builders/test_index.rb

Overview

Builds an HTML files. This will setup an HtmlContext and then invokes the render engines for each source before finally rendering the layout.

Instance Attribute Summary

Attributes inherited from Base

#entry

Instance Method Summary collapse

Methods inherited from Base

build, #initialize, #joinlines, #read, #readlines, #replace_static_url, #sc_static_match, #static_url, #writeline, #writelinebinary, #writelines

Constructor Details

This class inherits a constructor from SC::Builder::Base

Instance Method Details

#build(dst_path) ⇒ Object



16
17
18
19
20
21
22
# File 'lib/sproutcore/builders/test_index.rb', line 16

def build(dst_path)
  require 'json'
  items = entry[:source_entries].map do |e|
    { "filename" => e[:filename].ext(''), "url" => e[:url] }
  end
  writelines dst_path, [items.to_json]
end