Sha256: 396cdce23c0a5579a7c311177ef4d63855176097c638d680fae8da9ebd00e6e3

Contents?: true

Size: 817 Bytes

Versions: 2

Compression:

Stored size: 817 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.document)
      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

2 entries across 2 versions & 1 rubygems

Version Path
xing-backend-specdoc-1.0.0.pre.beta lib/xing/specdoc/module.rb
xing-backend-specdoc-0.0.2 lib/xing/specdoc/module.rb