Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: replace ri_cal with icalendar #1048

Merged
merged 1 commit into from
Sep 16, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down
14 changes: 4 additions & 10 deletions Gemfile.lock
Original file line number Diff line number Diff line change
@@ -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:
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -459,6 +453,7 @@ DEPENDENCIES
faker
font-awesome-rails
geocoder
icalendar
kaminari
kgio
letter_opener
Expand All @@ -480,7 +475,6 @@ DEPENDENCIES
rails-controller-testing
rails_12factor
redcarpet
ri_cal!
rspec-collection_matchers
rspec-rails
rubocop
Expand Down
22 changes: 11 additions & 11 deletions app/helpers/ical_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Loading