Sha256: e58d848ab6570e2a986ae716d61dffdf6875207e676d856acfbf7b7ef7999326

Contents?: true

Size: 727 Bytes

Versions: 3

Compression:

Stored size: 727 Bytes

Contents

#! /usr/bin/env ruby

require 'shinmun'

ENV['RACK_ENV'] = 'production'

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

when 'post'
  blog = Shinmun::Blog.new('.')
  post = blog.create_post(:title => ARGV[1], :date => Date.today)
  path = blog.post_file(post)
  
  `git checkout master posts`
  
  exec "#{ENV['EDITOR']} #{path}"

when 'page'
  blog = Shinmun::Blog.new('.')
  post = blog.create_page(:title => ARGV[1])
  path = blog.post_file(post)

  `git checkout master pages`

  exec "#{ENV['EDITOR']} #{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

3 entries across 3 versions & 2 rubygems

Version Path
georgi-shinmun-0.5 bin/shinmun
shinmun-0.5.2 bin/shinmun
shinmun-0.5 bin/shinmun