Sha256: 142cae3bac6ec21facaa2e70cf88dcf61608b0c1d54a34a83b5cd060994895e3

Contents?: true

Size: 1.1 KB

Versions: 9

Compression:

Stored size: 1.1 KB

Contents

require 'shellwords'
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(Shellwords.shellescape(path))
    end
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
autodoc-0.8.0 lib/autodoc/configuration.rb
autodoc-0.7.7 lib/autodoc/configuration.rb
autodoc-0.7.6 lib/autodoc/configuration.rb
autodoc-0.7.5 lib/autodoc/configuration.rb
autodoc-0.7.4 lib/autodoc/configuration.rb
autodoc-0.7.3 lib/autodoc/configuration.rb
autodoc-0.7.2 lib/autodoc/configuration.rb
autodoc-0.7.1 lib/autodoc/configuration.rb
autodoc-0.7.0 lib/autodoc/configuration.rb