Sha256: 2b9eea4783fc5d809549dbc1dfff24e7afdf483b70c9c51007c3a8a9ba51c027
Contents?: true
Size: 465 Bytes
Versions: 6
Compression:
Stored size: 465 Bytes
Contents
# skeleton class RuneBlog module Helpers end class Default end class View end class Publishing end class Post end end def make_exception(sym, str) return if Object.constants.include?(sym) Object.const_set(sym, StandardError.dup) define_method(sym) do |*args| msg = str args.each.with_index {|arg, i| msg.sub!("$#{i+1}", arg) } Object.class_eval(sym.to_s).new(msg) end end def prefix(num) "#{'%04d' % num.to_i}" end
Version data entries
6 entries across 6 versions & 1 rubygems
Version | Path |
---|---|
runeblog-0.1.12 | lib/global.rb |
runeblog-0.1.1 | lib/global.rb |
runeblog-0.0.99 | lib/global.rb |
runeblog-0.0.98 | lib/global.rb |
runeblog-0.0.97 | lib/global.rb |
runeblog-0.0.96 | lib/global.rb |