lib/view.rb in runeblog-0.1.1 vs lib/view.rb in runeblog-0.1.2
- old
+ new
@@ -9,12 +9,16 @@
def initialize(name)
raise NoBlogAccessor if RuneBlog.blog.nil?
@blog = RuneBlog.blog
@name = name
- dep_file = @blog.root + "/views/#@name/publish"
- @publisher = read_config(dep_file)
+ @can_publish = false
+ pub_file = @blog.root + "/views/#@name/publish"
+ unless File.size(pub_file) == 0
+ @publisher = RuneBlog::Publishing.new(read_config(pub_file))
+ @can_publish = true
+ end
end
def dir
@blog.root + "/views/#@name/"
end
@@ -32,9 +36,13 @@
files = [index()]
others = Dir.entries(vdir).grep(/^\d\d\d\d/)
files += others.map {|x| "#{vdir}/#{x}" }
files.reject! {|f| recent?(f) } if recent
files
+ end
+
+ def can_publish?
+ @can_publish
end
def publish
# ?? @blog.view.publisher.publish
# output "Files:"