diff --git a/Gemfile b/Gemfile index 821f4d53e..0aa1c5c19 100644 --- a/Gemfile +++ b/Gemfile @@ -22,7 +22,7 @@ gem 'public_suffix' gem 'puma' gem 'rack-cache' gem 'redcarpet' -gem 'ri_cal', github: 'phoet/ri_cal', branch: 'master' +gem 'icalendar' gem 'simple_form' gem 'slim-rails' gem 'sprockets', '~> 3.7' diff --git a/Gemfile.lock b/Gemfile.lock index 136197993..757347da5 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,12 +1,3 @@ -GIT - remote: https://github.com/phoet/ri_cal.git - revision: 0c607408f931ebbbed1c5e4dd6e4eb22572f268f - branch: master - specs: - ri_cal (0.8.8) - activesupport (> 2.2) - tzinfo (> 2.0) - GEM remote: http://rubygems.org/ specs: @@ -135,6 +126,9 @@ GEM hashie (5.0.0) i18n (1.14.4) concurrent-ruby (~> 1.0) + icalendar (2.10.2) + ice_cube (~> 0.16) + ice_cube (0.17.0) image_info (1.2.2) addressable (~> 2.0) image_size (~> 2.0) @@ -459,6 +453,7 @@ DEPENDENCIES faker font-awesome-rails geocoder + icalendar kaminari kgio letter_opener @@ -480,7 +475,6 @@ DEPENDENCIES rails-controller-testing rails_12factor redcarpet - ri_cal! rspec-collection_matchers rspec-rails rubocop diff --git a/app/helpers/ical_helper.rb b/app/helpers/ical_helper.rb index d54708599..7f7481526 100644 --- a/app/helpers/ical_helper.rb +++ b/app/helpers/ical_helper.rb @@ -2,18 +2,18 @@ module IcalHelper def icalendar(*events) - RiCal.Calendar do |cal| - events.each do |event| - cal.event do |item| - item.summary = event.name - item.description = "#{event.description} #{event_url(event)}" - item.dtstart = event.date - item.dtend = event.end_date - item.url = event_url(event) - item.location = event.location.name if event.location - end + cal = Icalendar::Calendar.new + events.map do |event| + cal.event do |item| + item.summary = event.name + item.description = "#{event.description} #{event_url(event)}" + item.dtstart = event.date + item.dtend = event.end_date + item.url = event_url(event) + item.location = event.location.name if event.location end - end.to_s + end + cal.to_ical end def calendar_link