Sha256: 2d6a92fda372afdce9ec5582cca3a3fc7e5ebf40ec001bb3d4d5c500dcfaf4f2

Contents?: true

Size: 691 Bytes

Versions: 6

Compression:

Stored size: 691 Bytes

Contents

module Dox
  module Printers
    class BasePrinter
      def initialize(output)
        @output = output
      end

      def print
        raise NotImplementedError
      end

      private

      def descriptions_folder_path
        Dox.config.desc_folder_path
      end

      def print_desc(desc, fullpath = false)
        return if desc.blank?

        if desc.to_s =~ /.*\.md$/
          path = if fullpath
                   desc
                 else
                   descriptions_folder_path.join(desc).to_s
                 end
          content(path)
        else
          desc
        end
      end

      def content(path)
        File.read(path)
      end
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
dox-1.3.0 lib/dox/printers/base_printer.rb
dox-1.2.0 lib/dox/printers/base_printer.rb
dox-1.1.0 lib/dox/printers/base_printer.rb
dox-1.0.2 lib/dox/printers/base_printer.rb
dox-1.0.1 lib/dox/printers/base_printer.rb
dox-1.0.0 lib/dox/printers/base_printer.rb