-
Notifications
You must be signed in to change notification settings - Fork 9
/
Copy pathRakefile
45 lines (33 loc) · 886 Bytes
/
Rakefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
task :meetup do
info = get_info(yyyy: 'Year (YYYY)', mm: 'Month (mm)', dd: 'Day (dd)', venue: 'Venue')
date = Time.new(info[:yyyy], info[:mm], info[:dd], 14, 0, 0)
month_name = date.strftime('%B').downcase
text = "---
layout: post
title: \"Kochi Ruby Meetup - #{date.strftime('%d %B, %Y')}\"
date: #{date.strftime('%Y-%m-%d %k:%M:%S')}
categories: meetups
---
**RSVP**:
# Agenda
* 2:00 - Introductions
* 2:30 - Talk 1
* 3:15 - Talk 2
* 4:00 - Tea break and networking
* 4:30 - Flash talks
**Date**: 2-5pm, #{date.strftime('%d %B, %Y')}
**Venue**: #{info[:venue]}
"
filename = "#{date.strftime '%Y-%m-%d'}-kochi-meetup-#{month_name}-#{info[:yyyy]}.md"
path = File.join('_posts', filename)
File.open(path, 'w') { |f| f << text }
end
def get_info(qns)
qns.map { |k, qn|
[k, ask("#{qn}: ")]
}.to_h
end
def ask(qn)
STDOUT.print qn
STDIN.gets.chomp
end