georgi-shinmun 0.3.5 → 0.3.6

Sign up to get free protection for your applications and to get access to all the features.
Files changed (2) hide show
  1. data/bin/shinmun +8 -2
  2. metadata +1 -1
data/bin/shinmun CHANGED
@@ -7,10 +7,16 @@ when 'init'
7
7
  Shinmun::Blog.init ARGV[1]
8
8
 
9
9
  when 'post'
10
- Shinmun::Blog.new.create_post(:title => ARGV[1], :date => Date.today)
10
+ post = Shinmun::Post.new(:title => ARGV[1], :date => Date.today)
11
+ FileUtils.mkpath(File.dirname(post.path))
12
+ open(post.path, 'w') { |io| io.write post.dump }
13
+ puts "created #{post.path}"
11
14
 
12
15
  when 'page'
13
- Shinmun::Blog.new.create_post(:title => ARGV[1])
16
+ post = Shinmun::Post.new(:title => ARGV[1])
17
+ FileUtils.mkpath(File.dirname(post.path))
18
+ open(post.path, 'w') { |io| io.write post.dump }
19
+ puts "created #{post.path}"
14
20
 
15
21
  else
16
22
  puts "Usage:"
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: georgi-shinmun
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.5
4
+ version: 0.3.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Matthias Georgi