Sha256: 712effd70c4d7031d05385e3a93cf4ef9aedf541567cc1503adec375d6c2613f

Contents?: true

Size: 1.57 KB

Versions: 16

Compression:

Stored size: 1.57 KB

Contents

require 'jsduck/img/dir_set'
require 'jsduck/img/writer'
require 'jsduck/welcome'
require 'jsduck/guides'
require 'jsduck/videos'
require 'jsduck/examples'
require 'jsduck/categories/factory'
require 'jsduck/format/doc'
require 'jsduck/news'

module JsDuck

  # Binds together: Welcome page, Categories, Images, Guides, Videos,
  # Examples.
  #
  # Often we need to pass guides/videos/examples/... to several
  # classes. Having all these assets together in here, means we just
  # need to pass one value instead of 3 or more.
  class Assets
    attr_reader :images
    attr_reader :welcome
    attr_reader :guides
    attr_reader :videos
    attr_reader :examples
    attr_reader :categories
    attr_reader :news

    def initialize(relations, opts)
      @relations = relations
      @opts = opts

      doc_formatter = Format::Doc.new(@relations, @opts)

      @images = Img::DirSet.new(@opts.images, "images")
      @welcome = Welcome.create(@opts.welcome, doc_formatter)
      @guides = Guides.create(@opts.guides, doc_formatter, @opts)
      @videos = Videos.create(@opts.videos)
      @examples = Examples.create(@opts.examples, @opts)
      @categories = Categories::Factory.create(@opts.categories, doc_formatter, @relations)
      @news = News.create(@relations, doc_formatter, @opts)
    end

    # Writes out the assets that can be written out separately:
    # guides, images.
    #
    # Welcome page and categories are written in JsDuck::IndexHtml
    def write
      @guides.write(@opts.output+"/guides")
      Img::Writer.copy(@images.all_used, @opts.output+"/images")
    end

  end

end

Version data entries

16 entries across 16 versions & 3 rubygems

Version Path
solvas-jsduck-6.0.0.30539 lib/jsduck/assets.rb
solvas-jsduck-6.0.0.9571 lib/jsduck/assets.rb
solvas-jsduck-6.0.0.6154 lib/jsduck/assets.rb
solvas-jsduck-6.0.0.4021 lib/jsduck/assets.rb
solvas-jsduck-6.0.0.2554 lib/jsduck/assets.rb
solvas-jsduck-6.0.0.1891 lib/jsduck/assets.rb
solvas-jsduck-6.0.0.beta.1888 lib/jsduck/assets.rb
jsduck-troopjs-0.0.10 lib/jsduck/assets.rb
jsduck-troopjs-0.0.9 lib/jsduck/assets.rb
jsduck-troopjs-0.0.8 lib/jsduck/assets.rb
jsduck-troopjs-0.0.7 lib/jsduck/assets.rb
jsduck-troopjs-0.0.5 lib/jsduck/assets.rb
jsduck-troopjs-0.0.4 lib/jsduck/assets.rb
jsduck-troopjs-0.0.3 lib/jsduck/assets.rb
jsduck-troopjs-0.0.1 lib/jsduck/assets.rb
jsduck-6.0.0beta lib/jsduck/assets.rb