Class: Booky::Textile::Load

Inherits:
Object
  • Object
show all
Includes:
Precompiler
Defined in:
lib/booky/textile/load.rb

Instance Method Summary collapse

Methods included from Precompiler

included

Instance Method Details

#compile_to(options) ⇒ Object

Replace the path with the contents of the file



12
13
14
15
16
17
18
# File 'lib/booky/textile/load.rb', line 12

def compile_to options
  begin
    File.open("#{File.dirname(Booky.source)}/#{options}", 'rb:UTF-8') { |f| f.read }
  rescue
    raise Booky::LoadError.new "#{File.dirname(Booky.source)}/#{options}"
  end
end

#matches(line) ⇒ Object

Does the current line need to be precompiled?



6
7
8
9
# File 'lib/booky/textile/load.rb', line 6

def matches line
  return false unless line.match /^load./
  line.gsub("load.", "").strip
end