Sha256: d1257324556c595686306d710d0cdcdd7dd9d6a3893ea3dd3c268314d8c4bee8

Contents?: true

Size: 419 Bytes

Versions: 2

Compression:

Stored size: 419 Bytes

Contents

require 'pathname'
require 'mime/types'

module Markout

  class Document

    attr_reader :path, :base_path, :content

    def initialize(path)
      @path      = File.expand_path(path)
      @base_path = Pathname.new( File.dirname(@path) )
      raise FileNotFound, "File #{@path} not found" unless File.exist?(@path)
      # TODO: Raise error for non-text file
      @content   = File.read(path)
    end

  end

end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
karmi-markout-0.0.0 lib/markout/document.rb
karmi-markout-0.1.0 lib/markout/document.rb