Sha256: 24d9a1a85a4bef2d18089f62ff6286f5eab89736c0e1a69c8e9b0a6eb4a46a27

Contents?: true

Size: 687 Bytes

Versions: 7

Compression:

Stored size: 687 Bytes

Contents

#! /usr/bin/env ruby

require 'shinmun'

case ARGV[0]
when 'init'
  Shinmun::Blog.init ARGV[1]

when 'post'
  post = Shinmun::Post.new(:title => ARGV[1], :date => Date.today)
  FileUtils.mkpath(File.dirname(post.path))
  open(post.path, 'w') { |io| io.write post.dump }
  puts "created #{post.path}"

when 'page'
  post = Shinmun::Post.new(:title => ARGV[1])
  FileUtils.mkpath(File.dirname(post.path))
  open(post.path, 'w') { |io| io.write post.dump }
  puts "created #{post.path}"

else
  puts "Usage:"
  puts "  shinmun init dir - creates a new blog"
  puts "  shinmun post 'Title of the post' - create a new post"
  puts "  shinmun page 'Title of the page' - create a new page"
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
georgi-shinmun-0.3.10 bin/shinmun
georgi-shinmun-0.3.6 bin/shinmun
georgi-shinmun-0.3.7 bin/shinmun
georgi-shinmun-0.3.8 bin/shinmun
georgi-shinmun-0.3.9 bin/shinmun
georgi-shinmun-0.4.1 bin/shinmun
georgi-shinmun-0.4 bin/shinmun