Sha256: a7c87738b04380ab92ff5973eb04638b56103b94194efdf2bea6e710d9506eee

Contents?: true

Size: 465 Bytes

Versions: 2

Compression:

Stored size: 465 Bytes

Contents

# skeleton

class RuneBlog
  module Helpers
  end

  class Default
  end

  class View
  end

  class Deployment
  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

2 entries across 2 versions & 1 rubygems

Version Path
runeblog-0.0.95 lib/global.rb
runeblog-0.0.94 lib/global.rb