Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Newer
Older
100644 26 lines (20 sloc) 0.421 kB
5445400 @sam-github example of faking out an IO to do fmt conversion
authored
1 require 'vpim/icalendar'
2 require 'open-uri'
3
4 class Convert
5 def initialize(io)
6 @io = io
7 end
8
9 def each
10 @io.each do |line|
11 line.gsub!("\r", "\\n")
12 yield line
13 end
14 end
15 end
16
17 io = open("http://upcoming.org/calendar/metro/45")
18 cvt = Convert.new(io)
19 cal = Vpim::Icalendar.decode(cvt).first
20
21 cal.components do |c|
22 puts "-------------------------------------------------"
23 puts c.description
24 end
25
Something went wrong with that request. Please try again.