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

Full Timezone support when parsing ical #408

Open
wants to merge 16 commits into
base: master
Choose a base branch
from
Open

Full Timezone support when parsing ical #408

wants to merge 16 commits into from

Conversation

seejohnrun
Copy link
Collaborator

@seejohnrun seejohnrun commented Aug 4, 2017

This PR builds on the great work from #335 (thanks @dcosson)

I'll be removing the need for ActiveSupport here.

Also, added support for parsing RDATE while I'm in here.

Closes #335

@seejohnrun
Copy link
Collaborator Author

@avit do you think we should move ical parsing out of ice_cube proper as part of this? Then we could avoid having to wrap with active_support conditionals.

ice_cube.gemspec Outdated Show resolved Hide resolved
def parse_in_tzid(value, tzid)
time_parser = Time
if tzid
time_parser = ActiveSupport::TimeZone.new(tzid.split('=')[1]) || Time
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use rescue Time here if ActiveSupport is not loaded? Maybe something like IcalParser.time_parser can be determined statically for performance.

@avit
Copy link
Collaborator

avit commented Aug 4, 2017

I like the idea... are you thinking of a separate gem, or maybe just an optional require?

@seejohnrun
Copy link
Collaborator Author

I think the optional require makes sense, but separate gem also sounds like a decent idea to me. I just dislike that we're potentially having two different behaviors in the ical parser dependending if AS is loaded or not

@avit
Copy link
Collaborator

avit commented Aug 14, 2017

We have a dependency on ActiveSupport here. Maybe this can work with TimeUtil.deserialize_time by passing a hash to it.

@seejohnrun
Copy link
Collaborator Author

@avit Ah I like that idea - will update this soon

@dcosson
Copy link

dcosson commented Jun 20, 2018

Any update on this?

It's really a bummer that this has been roadblocked for years at this point, even though the current behavior which is completely broken w.r.t. daylight savings time, just to avoid the dependency on ActiveSupport. With all due respect, what's more important - having a library that works and solves people's problems, or keeping the dependencies down?

@seejohnrun
Copy link
Collaborator Author

What do people think of the compromise of just making this method raise if ActiveSupport hasn't been required and we're attempting to parse a time with zone? I'm not 100% against the idea of the added dependency anymore, but want to make sure we're doing it for a reason that is required. I'm sorry this has held you up @dcosson and hopefully this branch has been useful to you.

@dcosson
Copy link

dcosson commented Jun 20, 2018

No worries, thanks for your continuing work maintaining this library. Hopefully it's close now!

+1 from me on raising if ActiveSupport isn't available.

@jorroll
Copy link
Contributor

jorroll commented Jun 20, 2018

Seems like a good idea.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants