Skip to content

Commit d7ea51e

Browse files
committed
dont require the wrapped line to be the last the ical string
1 parent 6a50aad commit d7ea51e

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

lib/ice_cube/parsers/ical_parser.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ def self.schedule_from_ical(ical_string, options = {})
66
# First join lines that are wrapped
77
lines = []
88
ical_string.each_line do |line|
9-
if lines[-1] && line =~ /\A[ \t].+\z/
9+
if lines[-1] && line =~ /\A[ \t].+/
1010
lines[-1] = lines[-1].strip + line.sub(/\A[ \t]+/, "")
1111
else
1212
lines << line

spec/examples/from_ical_spec.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -451,7 +451,7 @@ def sorted_ical(ical)
451451

452452
describe "ical data with wrapping" do
453453
it "matches simple daily" do
454-
ical_string = "DTSTART:20130314T201500Z\nDTEND:20130314T201545Z\nRRULE:FREQ=WEEKLY;BYDAY=TH;UNT\n IL=20130531T100000Z"
454+
ical_string = "DTSTART:20130314T201500Z\nDTEND:20130314T201545Z\nRRULE:FREQ=WEEKLY;BYDAY=TH;UNT\n IL=20130531T100000Z\nDESCRIPTION:This is a test event\nSUMMARY:Test Event\n"
455455
schedule = IceCube::Schedule.from_ical(ical_string)
456456
expect(schedule.to_ical.split(/\n/).select {|x| x =~ /RRULE/}.first).to eq("RRULE:FREQ=WEEKLY;UNTIL=20130531T100000Z;BYDAY=TH")
457457
end

0 commit comments

Comments
 (0)