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

add DAY_NAMES constant instead of ::Time::RFC2822_DAY_NAME #212

Merged
merged 1 commit into from
Nov 23, 2021

Conversation

mpg-yuya-tani
Copy link
Contributor

Fixes #211

before

$ ruby -v
ruby 3.1.0preview1 (2021-11-09 master 5a3b2e6141) [x86_64-darwin20]
$ bundle exec rake
EEEEEEEEEEEEEEEEEE.E.E..E..EEEEEEEEEEEEEEEEEEE...EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEE......EEEEEEEEEEEEEEEEEEEEEEEEEEEEEE.......EEEEEEEEEEEEEEEEEEEEEEEE........EEEEEEEEEEEEEEEE.E......EEEEEEEEEEEEEEEEEEEEEEEE.EEEEEEEEEE...

  1) Error:
time extensions#test_0007_calculate business time between different times on the same date (counter clockwise):
NameError: uninitialized constant Time::RFC2822_DAY_NAME

        ::Time::RFC2822_DAY_NAME.map(&:downcase).map(&:to_sym)[num]
              ^^^^^^^^^^^^^^^^^^
    /Users/yuya.tani/Work/8.oss/business_time/lib/business_time/config.rb:195:in `int_to_wday'
    /Users/yuya.tani/Work/8.oss/business_time/lib/business_time/config.rb:124:in `beginning_of_workday'
    /Users/yuya.tani/Work/8.oss/business_time/lib/business_time/time_extensions.rb:29:in `beginning_of_workday'
    /Users/yuya.tani/Work/8.oss/business_time/lib/business_time/time_extensions.rb:47:in `before_business_hours?'
    /Users/yuya.tani/Work/8.oss/business_time/lib/business_time/time_extensions.rb:58:in `roll_forward'
    /Users/yuya.tani/Work/8.oss/business_time/lib/business_time/time_extensions.rb:152:in `business_time_until'
    /Users/yuya.tani/Work/8.oss/business_time/test/test_time_extensions.rb:51:in `block (2 levels) in <top (required)>'



247 runs, 130 assertions, 0 failures, 206 errors, 0 skips

after

$ ruby -v
ruby 3.1.0preview1 (2021-11-09 master 5a3b2e6141) [x86_64-darwin20]
$ bundle exec rake
............................................................................................................................................................................................................
...........................................

Finished in 0.247837s, 996.6228 runs/s, 1557.4753 assertions/s.

247 runs, 386 assertions, 0 failures, 0 errors, 0 skips

Time::RFC2822_DAY_NAME will be removed by ruby 3.1.0
@rmm5t rmm5t merged commit b920253 into bokmann:develop Nov 23, 2021
@rmm5t
Copy link
Collaborator

rmm5t commented Nov 23, 2021

Thank you very much!

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

Successfully merging this pull request may close these issues.

Support Time gem version >= 0.2.0
2 participants