Sha256: 2b21567be9e562310beab81251a863c80fa5e6d4c9bf8356b2b3bd65fd360e39

Contents?: true

Size: 1.11 KB

Versions: 20

Compression:

Stored size: 1.11 KB

Contents

require 'uri'

require 'jazzy/config'
require 'jazzy/source_declaration'

module Jazzy
  class SourceModule
    attr_accessor :name
    attr_accessor :docs
    attr_accessor :doc_coverage
    attr_accessor :doc_structure
    attr_accessor :author_name
    attr_accessor :github_url
    attr_accessor :github_file_prefix
    attr_accessor :author_url
    attr_accessor :dash_url

    def initialize(options, docs, doc_structure, doc_coverage)
      self.docs = docs
      self.doc_structure = doc_structure
      self.doc_coverage = doc_coverage
      self.name = options.module_name
      self.author_name = options.author_name
      self.github_url = options.github_url
      self.github_file_prefix = options.github_file_prefix
      self.author_url = options.author_url
      return unless options.dash_url
      self.dash_url = "dash-feed://#{URI.encode(options.dash_url.to_s, /\W/)}"
    end

    def all_declarations
      all_declarations = []
      visitor = lambda do |d|
        all_declarations.unshift(*d)
        d.map(&:children).each { |c| visitor[c] }
      end
      visitor[docs]
      all_declarations
    end
  end
end

Version data entries

20 entries across 20 versions & 1 rubygems

Version Path
jazzy-0.4.0 lib/jazzy/source_module.rb
jazzy-0.3.2 lib/jazzy/source_module.rb
jazzy-0.3.1 lib/jazzy/source_module.rb
jazzy-0.3.0 lib/jazzy/source_module.rb
jazzy-0.2.4 lib/jazzy/source_module.rb
jazzy-0.2.3 lib/jazzy/source_module.rb
jazzy-0.2.2 lib/jazzy/source_module.rb
jazzy-0.2.1 lib/jazzy/source_module.rb
jazzy-0.2.0 lib/jazzy/source_module.rb
jazzy-0.1.6 lib/jazzy/source_module.rb
jazzy-0.1.5 lib/jazzy/source_module.rb
jazzy-0.1.4 lib/jazzy/source_module.rb
jazzy-0.1.3 lib/jazzy/source_module.rb
jazzy-0.1.2 lib/jazzy/source_module.rb
jazzy-0.1.1 lib/jazzy/source_module.rb
jazzy-0.1.0 lib/jazzy/source_module.rb
jazzy-0.0.20 lib/jazzy/source_module.rb
jazzy-0.0.19 lib/jazzy/source_module.rb
jazzy-0.0.18 lib/jazzy/source_module.rb
jazzy-0.0.17 lib/jazzy/source_module.rb