Sha256: c8db7111f4196a63170979f8aace63f70576e2f807642513177be0f1d6045a37

Contents?: true

Size: 613 Bytes

Versions: 1

Compression:

Stored size: 613 Bytes

Contents

module DOWL

  class Generator
    
    def initialize(schema, template=Generator.default_template())
      @template = ERB.new(File.read(template))
      @schema = schema
      if schema.introduction
        @introduction = File.read(schema.introduction)
      end      
    end
    
    def Generator.default_template()
       dir = File.dirname( __FILE__ )
       return default_template_file = File.join(dir, "default.erb")
    end
    
    def run()      
      b = binding
      schema = @schema
      introduction = @introduction
      return @template.result(b)               
    end
    
  end  
  
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
dowl-0.2 lib/dowl/generator.rb