lib/webby/builder.rb in TwP-webby-0.9.3 vs lib/webby/builder.rb in TwP-webby-0.9.4
- old
+ new
@@ -72,14 +72,12 @@
# Builder.new_page_info => [page, title, directory]
#
def new_page_info
args = Webby.site.args
- if args.raw.empty?
- task_name = Rake.application.top_level_tasks.first
- raise "Usage: webby #{task_name} path"
- end
+ # TODO: maybe even get rid of this method altogether
+ raise "Usage: webby #{args.rake.first} 'path'" if args.raw.empty?
[args.page, args.title, args.dir]
end
private
@@ -129,11 +127,11 @@
unless test(?d, output_dir)
journal.create output_dir
FileUtils.mkdir output_dir
end
- load_files if opts[:load_files]
+ ::Webby.load_files if opts[:load_files]
Resources.pages.each do |page|
unless page.dirty? or opts[:rebuild]
journal.identical(page.destination) if verbose
next
@@ -155,18 +153,12 @@
FileUtils.touch ::Webby.cairn
nil
end
- # Scan the <code>layouts/</code> folder and the <code>content/</code>
- # folder and create a new Resource object for each file found there.
- #
def load_files
- ::Find.find(layout_dir, content_dir) do |path|
- next unless test ?f, path
- next if path =~ ::Webby.exclude
- Resources.new path
- end
+ ::Webby.deprecated "load_files", "it is being replaced by the Webby#load() method"
+ ::Webby.load_files
end
%w(output_dir layout_dir content_dir).each do |key|
self.class_eval <<-CODE
def #{key}( ) ::Webby.site.#{key} end