Skip to content
Browse files

added Rakefile, for common tasks, and renamed server.ru to config, fo…

…r portability
  • Loading branch information...
1 parent ee4f6b8 commit f19c1867f6976db95dd3618baac77b6369453f9d cloudhead committed
Showing with 36 additions and 0 deletions.
  1. +36 −0 Rakefile
  2. 0 server.ru → config.ru
View
36 Rakefile
@@ -0,0 +1,36 @@
+require '../toto/lib/toto'
+
+@config = Toto::Config::Defaults
+
+task :default => :init
+
+task :init do
+
+end
+
+task :new do
+ article = {'title' => nil, 'date' => Time.now.strftime("%d/%m/%Y"), 'author' => @config[:author]}.to_yaml
+ article << "\n"
+ article << "Once upon a time...\n\n"
+
+ path = "#{Toto::Paths[:articles]}/#{Time.now.strftime("%Y-%m-%d")}.#{@config[:ext]}"
+
+ unless File.exist? path
+ File.open(path, "w") do |file|
+ file.write article
+ end
+ toto "an article was created for you at #{path}."
+ else
+ toto "I can't create the article, #{path} already exists."
+ end
+end
+
+task :publish do
+ toto "publishing your article(s)..."
+ `git push origin master`
+end
+
+def toto msg
+ puts "\n toto ~ #{msg}\n\n"
+end
+
View
0 server.ru → config.ru
File renamed without changes.

0 comments on commit f19c186

Please sign in to comment.
Something went wrong with that request. Please try again.