lib/post.rb in runeblog-0.3.18 vs lib/post.rb in runeblog-0.3.19
- old
+ new
@@ -9,11 +9,11 @@
include RuneBlog::Helpers
def self.load(post)
log!(enter: __method__, args: [post], level: 3)
- raise "Doesn't work right now"
+ raise NotImplemented
raise NoBlogAccessor if RuneBlog.blog.nil?
# "post" is a slug?
pdir = RuneBlog.blog.root/:drafts/post
meta = nil
Dir.chdir(pdir) do
@@ -85,11 +85,11 @@
class RuneBlog::ViewPost
attr_accessor :nslug, :aslug, :num, :view, :blog
attr_accessor :path, :title, :date, :teaser_text
def self.make(blog:, view:, nslug:)
- raise "No numeric prefix on #{nslug}" unless nslug =~ /^\d{4}-/
- raise "Not expecting an extension" if nslug.end_with?(".lt3") || nslug.end_with?(".html")
+ raise NoNumericPrefix(nslug) unless nslug =~ /^\d{4}-/
+ raise NoExtensionExpected(nslug) if nslug.end_with?(".lt3") || nslug.end_with?(".html")
view = view.to_s
view.define_singleton_method :path do |subdir = ""|
str = blog.root/:views/view
str << "/#{subdir}" unless subdir.empty?
str