#! /usr/bin/env ruby require 'shinmun' ENV['RACK_ENV'] = 'production' case ARGV[0] when 'init' Shinmun::Blog.init ARGV[1] when 'post' post = Shinmun::Post.new(:title => ARGV[1], :date => Date.today) post.save puts "Created post '#{post.path}'" when 'page' post = Shinmun::Post.new(:title => ARGV[1]) post.save puts "Created page '#{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" exit end