Sha256: c6368904bc9c56a9f319d9f17a01f34f4f42759f5f8e44b6c2caae9aa13821e5

Contents?: true

Size: 549 Bytes

Versions: 4

Compression:

Stored size: 549 Bytes

Contents

namespace :create do

  FileList["#{Webby.site.template_dir}/*"].each do |template|
    next unless test(?f, template)
    name = template.pathmap '%n'

    # if the file is a partial template
    name = $1 if name =~ %r/^_(.*)/

    desc "Create a new #{name}"
    task name do |t|
      page, title, dir = Webby::Builder.new_page_info
      page = Webby::Builder.create(page, :from => template,
                 :locals => {:title => title, :directory => dir})
      Webby.exec_editor(page)
    end
  end  # each

end  # namespace :create

# EOF

Version data entries

4 entries across 4 versions & 3 rubygems

Version Path
TwP-webby-0.9.4.1 lib/webby/tasks/create.rake
mikker-webby-0.9.4 lib/webby/tasks/create.rake
webby-0.9.4 lib/webby/tasks/create.rake
webby-0.9.4-x86-mswin32 lib/webby/tasks/create.rake