Sha256: ed3041298702c1e7649cc0d7ab847df57bd6d1e0111d9729a0e59e34ed57ce57

Contents?: true

Size: 1.06 KB

Versions: 7

Compression:

Stored size: 1.06 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 :document_path_from_example do
    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

7 entries across 7 versions & 1 rubygems

Version Path
autodoc-0.6.2 lib/autodoc/configuration.rb
autodoc-0.6.1 lib/autodoc/configuration.rb
autodoc-0.6.0 lib/autodoc/configuration.rb
autodoc-0.5.3 lib/autodoc/configuration.rb
autodoc-0.5.2 lib/autodoc/configuration.rb
autodoc-0.5.1 lib/autodoc/configuration.rb
autodoc-0.5.0 lib/autodoc/configuration.rb