Sha256: cf9ffd73c07fc6c5c28c4fe7f61e622135f053f7bf046da0da1b7d08aae9f815

Contents?: true

Size: 579 Bytes

Versions: 10

Compression:

Stored size: 579 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})
      exec(::Webby.editor, page) unless ::Webby.editor.nil?
    end
  end  # each

end  # namespace :create

# EOF

Version data entries

10 entries across 10 versions & 3 rubygems

Version Path
Shazburg-webby-0.9.0 lib/webby/tasks/create.rake
TwP-webby-0.9.0 lib/webby/tasks/create.rake
TwP-webby-0.9.1 lib/webby/tasks/create.rake
TwP-webby-0.9.2 lib/webby/tasks/create.rake
TwP-webby-0.9.3 lib/webby/tasks/create.rake
webby-0.9.1 lib/webby/tasks/create.rake
webby-0.9.2 lib/webby/tasks/create.rake
webby-0.9.0 lib/webby/tasks/create.rake
webby-0.9.3 lib/webby/tasks/create.rake
webby-0.9.3-x86-mswin32 lib/webby/tasks/create.rake