Sha256: 45205a4c20b19941f3cea1ce303c6fab86a86c81202837a5f0cf9bb74053874f

Contents?: true

Size: 622 Bytes

Versions: 15

Compression:

Stored size: 622 Bytes

Contents

module RspecApiDocs
  module Renderer
    class SlateRenderer
      attr_reader :resources

      def initialize(resources)
        @resources = resources
      end

      def render
        FileUtils.mkdir_p output_file.dirname

        File.open(output_file, 'w') do |f|
          f.write ERB.new(File.read(template), nil, '-').result(binding)
        end
      end

      private

      def output_file
        Pathname.new(RspecApiDocs.configuration.output_dir) + 'index.html.md'
      end

      def template
        File.expand_path('../slate_renderer/slate_index.html.md.erb', __FILE__)
      end
    end
  end
end

Version data entries

15 entries across 15 versions & 1 rubygems

Version Path
rspec-api-docs-1.1.0 lib/rspec_api_docs/formatter/renderer/slate_renderer.rb
rspec-api-docs-1.0.0 lib/rspec_api_docs/formatter/renderer/slate_renderer.rb
rspec-api-docs-0.14.0 lib/rspec_api_docs/formatter/renderer/slate_renderer.rb
rspec-api-docs-0.13.0 lib/rspec_api_docs/formatter/renderer/slate_renderer.rb
rspec-api-docs-0.12.0 lib/rspec_api_docs/formatter/renderer/slate_renderer.rb
rspec-api-docs-0.11.0 lib/rspec_api_docs/formatter/renderer/slate_renderer.rb
rspec-api-docs-0.10.0 lib/rspec_api_docs/formatter/renderer/slate_renderer.rb
rspec-api-docs-0.9.0 lib/rspec_api_docs/formatter/renderer/slate_renderer.rb
rspec-api-docs-0.8.0 lib/rspec_api_docs/formatter/renderer/slate_renderer.rb
rspec-api-docs-0.7.0 lib/rspec_api_docs/formatter/renderer/slate_renderer.rb
rspec-api-docs-0.6.0 lib/rspec_api_docs/formatter/renderer/slate_renderer.rb
rspec-api-docs-0.5.0 lib/rspec_api_docs/formatter/renderer/slate_renderer.rb
rspec-api-docs-0.4.0 lib/rspec_api_docs/formatter/renderer/slate_renderer.rb
rspec-api-docs-0.3.0 lib/rspec_api_docs/formatter/renderer/slate_renderer.rb
rspec-api-docs-0.2.0 lib/rspec_api_docs/formatter/renderer/slate_renderer.rb