Now using the icalendar gem, to generate ical files

This commit is contained in:
echarp 2018-07-14 00:49:52 +02:00
parent 3714c614c8
commit 32a5eb605b
4 changed files with 9 additions and 37 deletions

View File

@ -10,6 +10,9 @@ gem 'mini_portile2'
# The central piece of this application: the month calendar view
gem 'simple_calendar'
gem 'icalendar'
# The recurrence management library
gem 'ice_cube'

View File

@ -99,7 +99,7 @@ GEM
railties (>= 4.1.0, < 6.0)
responders
warden (~> 1.2.3)
devise-i18n (1.6.2)
devise-i18n (1.6.4)
devise (>= 4.4)
differ (0.1.2)
domain_name (0.5.20180417)
@ -199,6 +199,7 @@ GEM
concurrent-ruby (~> 1.0)
i18n-active_record (0.2.2)
i18n (>= 0.5.0)
icalendar (2.4.1)
ice_cube (0.16.2)
inherited_resources (1.8.0)
actionpack (>= 4.2, <= 5.2)
@ -269,7 +270,7 @@ GEM
request_store (~> 1.1)
paper_trail-association_tracking (1.0.0)
parallel (1.12.1)
parser (2.5.1.0)
parser (2.5.1.2)
ast (~> 2.4.0)
piwik_analytics (1.0.2)
actionpack
@ -341,10 +342,10 @@ GEM
responders (2.4.0)
actionpack (>= 4.2.0, < 5.3)
railties (>= 4.2.0, < 5.3)
rubocop (0.58.0)
rubocop (0.58.1)
jaro_winkler (~> 1.5.1)
parallel (~> 1.10)
parser (>= 2.5)
parser (>= 2.5, != 2.5.1.1)
powerpack (~> 0.1)
rainbow (>= 2.2.2, < 4.0)
ruby-progressbar (~> 1.7)
@ -474,6 +475,7 @@ DEPENDENCIES
high_voltage
http_accept_language
i18n-active_record
icalendar
ice_cube
jbuilder (~> 2.5)
jquery-ui-rails

View File

@ -1,17 +0,0 @@
BEGIN:VCALENDAR
VERSION:2.0
PRODID:-//AgendaDuLibre.org
X-WR-CALNAME:<%= t('title', scope: [:layouts, :application]).gsub(/'/, '') %>
X-WR-CALDESC:<%= t 'subtitle', scope: [:layouts, :application] %>
<% @events.find_each do |event| %>
BEGIN:VEVENT
DTSTART:<%= event.start_time.strftime '%Y%m%dT%H%M%S' %>
DTEND:<%= event.end_time.strftime '%Y%m%dT%H%M%S' %>
UID:<%= event.id %>@agendadulibre.org
SUMMARY:<%= event.title.gsub(',', '\,').gsub(';', '\;') %>
URL:<%= event_url event %>
DESCRIPTION:<%= strip_tags(event.description).gsub(/'/, '').gsub(',', '\,').gsub(';', '\;').gsub(/^/, ' ') %>
LOCATION:<%= event.full_address.gsub(/,/, '\,') %>
END:VEVENT
<% end %>
END:VCALENDAR

View File

@ -1,16 +0,0 @@
BEGIN:VCALENDAR
VERSION:2.0
PRODID:-//AgendaDuLibre.org
X-WR-CALNAME:<%= t('title', scope: [:layouts, :application]).gsub(/'/, '') %>
X-WR-CALDESC:<%= t 'subtitle', scope: [:layouts, :application] %>
<% event = @event %>
BEGIN:VEVENT
DTSTART:<%= event.start_time.strftime '%Y%m%dT%H%M%S' %>
DTEND:<%= event.end_time.strftime '%Y%m%dT%H%M%S' %>
UID:<%= event.id %>@agendadulibre.org
SUMMARY:<%= event.title %>
URL:<%= event_url event %>
DESCRIPTION:<%= strip_tags(event.description).gsub(/'/, '').gsub(/,/, '\,').gsub(/;/, '\;').gsub /^/, ' ' %>
LOCATION:<%= event.full_address %>
END:VEVENT
END:VCALENDAR