Sha256: 8b9e698b9c60ac870dc0f36f87feceba9107c4e630b313077f37f4cedd977083

Contents?: true

Size: 672 Bytes

Versions: 1

Compression:

Stored size: 672 Bytes

Contents

module Booky::Textile
  module Precompiler
    
    def self.included(base)
      base.extend ClassMethods
    end
    
    module ClassMethods
      
      def apply(textile)
        
        @output = ""
        @precompiler = self.new
        
        textile.each_line do |line|
          if options = @precompiler.matches(line)
            @output += "\n\n" unless @output.empty?
            @output += self.apply(@precompiler.compile_to(options))
          else
            @output += line
          end
        end
        
        @output
      end
      
    end
    
    def matches line
      false
    end
    
    def compile_to options
    end
    
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
booky-0.0.4 lib/booky/textile/precompiler.rb