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
fixes Fixnum deprecation warning for ruby 2.4.0 #364
Conversation
Signed-off-by: Yuri Mikhaylov <me@yurijmi.ru>
Signed-off-by: Yuri Mikhaylov <me@yurijmi.ru>
@seejohnrun looks like the build failed on 2.1 and lower because it's pulling in activesupport-5-0-1 which requires ruby 2.2.2 or higher. Ruby 2.4.0 build failed because rvm couldn't find the ruby version. |
@hwhelchel hmm - I wonder if we should have a few test files that pull in specific versions? Otherwise we'd need to remove those tests and change the support matrix which I'm not sure I'm ready to do (a lot of people unfortunately still on ruby <2 last I checked) |
Hmm I can't quite get all 5 builds to pass. Do we need separate gemspecs for each ruby version? |
I don't think so as long as the Gemfiles don't specify versions. |
@@ -0,0 +1,9 @@ | |||
module IntegerUtil | |||
def self.klass | |||
if RUBY_VERSION.include?("2.4.") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this probably should be something more concrete / robust - given versions after 2.4 will also have this change. Helpful to look @ rails/rails#25056
@@ -1,6 +1,6 @@ | |||
script: "bundle exec rspec spec" | |||
before_install: | |||
- gem install bundler | |||
- gem install bundler && gem update bundler |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why this line?
@@ -127,8 +127,8 @@ def self.end_of_date(date, reference=Time.now) | |||
def self.sym_to_month(sym) | |||
MONTHS.fetch(sym) do |k| | |||
MONTHS.values.detect { |i| i.to_s == k.to_s } or | |||
raise ArgumentError, "Expecting Fixnum or Symbol value for month. " \ | |||
"No such month: #{k.inspect}" | |||
raise ArgumentError, "Expecting #{IntegerUtil.klass} or "\ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If you're going to change the indentation here, can we just move to one line?
Maybe something like I'm looking for some prior art on how others are handling this but nothing yet |
Don't try to bring in new activesupport on versions of Ruby that don't support it
FYI I'm testing this idea separately here: #369 |
Fix tests on older rubies
Also modify `Rule#from_ical` to use `Rule#from_hash` for uniformity and centralization of parsing logic.
Validate rule types while parsing
[TYPO] Fixes a couple of typos in the README.md
Add comment for ical parsing
Fix february in readme example
…le-name Fix incorrect variable name in previous_occurrences.
Add Russian locale
Add Swedish locale
German locale, testing
Raise an ArgumentError if given an empty ical string
@hwhelchel Thanks for the contribution. This has a lot of unrelated changes included, could you please rebase and resubmit a clean branch? I'm also thinking if we could make this class reference static instead of requiring a method call, something like this:
Then all references to |
@avit sounds good. I'll take a look at cleaning this up. |
@seejohnrun FWIW, it looks like I'd be happy to submit a PR if you're interested. Thanks! |
Yep I'm down for this for sure @patrickjaberg |
Merged #379 instead. Thanks for the contribution. |
@seejohnrun thanks for a great gem! Would love to add this support for ruby 2.4.0. Let me know if you need any thing else to accept this PR.
Thanks!