Sha256: ce9d8a2e9750d1cad0384ea63f137aa9d546271c0f8b00f7dbc162cfacebff40
Contents?: true
Size: 750 Bytes
Versions: 3
Compression:
Stored size: 750 Bytes
Contents
require "burstfm/version" require "colorize" module Burstfm class << self def front_matter(options = {}) return [ {label: "layout", content: "post"}, {label: "status", content: "publish"}, {label: "published", content: "true"}, {label: "title", content: options[:title] || "This is a title"}, {label: "date", content: Time.now.to_s}, {label: "categories", content: "\n- Category"}, {label: "tags", content: "\n- first_tag\n- second_tag"} ] end def print_line(line) puts("#{line[:label].yellow}: #{line[:content].cyan}") end def print(options = {}) front_matter(options).each do |line| print_line(line) end end end end
Version data entries
3 entries across 3 versions & 1 rubygems
Version | Path |
---|---|
burstfm-0.3.1 | lib/burstfm.rb |
burstfm-0.3.0 | lib/burstfm.rb |
burstfm-0.2.0 | lib/burstfm.rb |