Class: SimpleTemplater::Builder

Inherits:
Object
  • Object
show all
Defined in:
lib/simple-templater/builder.rb

Overview

Since:

  • 0.0.3

Direct Known Subclasses

FlatBuilder

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(content_dir, context = Hash.new) ⇒ Builder

Returns a new instance of Builder.

Since:

  • 0.0.3


29
30
31
# File 'lib/simple-templater/builder.rb', line 29

def initialize(content_dir, context = Hash.new)
  @content_dir, @context = content_dir, context
end

Instance Attribute Details

#contextObject

Since:

  • 0.0.3


28
29
30
# File 'lib/simple-templater/builder.rb', line 28

def context
  @context
end

Class Method Details

.create(*args) ⇒ Object

Since:

  • 0.0.3


22
23
24
25
26
# File 'lib/simple-templater/builder.rb', line 22

def self.create(*args)
  templater = self.new(*args)
  puts "Context: #{templater.context.inspect}"
  templater.create
end

Instance Method Details

#createObject

Since:

  • 0.0.3


33
34
35
36
37
38
39
# File 'lib/simple-templater/builder.rb', line 33

def create
  Find.find(@content_dir) do |template|
    file = self.expand_path(template)
    next if template == @content_dir
    proceed(template, file)
  end
end