Sha256: 377b45fcf6600e6a21a88c3b845f83d026124094e93c35341b4008770de4c6df

Contents?: true

Size: 808 Bytes

Versions: 1

Compression:

Stored size: 808 Bytes

Contents

require 'xing/specdoc/api-doccer'
require 'xing/specdoc/doc-family'

module Xing
  module SpecDoc
    class << self
      def target_dir
        RSpec.configuration.specdoc_target_directory
      end

      def response_target_dir
        File.join(target_dir,  "responses")
      end

      def request_target_dir
        File.join(target_dir,  "requests")
      end

      def doc_hash
        @doc_hash ||= Hash.new{|h,k| h[k]= DocFamily.new(k)}
      end

      def store(doc)
        doc_hash[doc.base_filename].add(doc)
      end

      def record_docs
        doc_hash.each_pair do |_, docs|
          docs.record
        end
      end

      def included(group)
        group.after(:each) do |example|
          ApiDoccer.new(example, request, response).store
        end
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
xing-backend-specdoc-0.0.1 lib/xing/specdoc/module.rb