Sha256: 66f222e87e2ce75fe78213d0cf2b62c4654bc3e97d310527660242334ed9a3aa

Contents?: true

Size: 1 KB

Versions: 4

Compression:

Stored size: 1 KB

Contents

module Autodoc
  class Configuration
    class << self
      def property(name, &default)
        define_method(name) do
          if instance_variable_defined?("@#{name}")
            instance_variable_get("@#{name}")
          else
            instance_variable_set("@#{name}", instance_exec(&default))
          end
        end

        attr_writer name
      end
    end

    property :path do
      "doc"
    end

    property :suppressed_request_header do
      []
    end

    property :suppressed_response_header do
      []
    end

    property :template do
      File.read(File.expand_path("../templates/document.md.erb", __FILE__))
    end

    property :toc_template do
      File.read(File.expand_path("../templates/toc.md.erb", __FILE__))
    end

    property :toc_html do
      false
    end

    property :toc_html_template do
      File.read(File.expand_path("../templates/toc.html.erb", __FILE__))
    end

    property :toc do
      false
    end

    def pathname
      Pathname.new(path)
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
autodoc-0.4.5 lib/autodoc/configuration.rb
autodoc-0.4.4 lib/autodoc/configuration.rb
autodoc-0.4.3 lib/autodoc/configuration.rb
autodoc-0.4.2 lib/autodoc/configuration.rb