A summary of data about the Ruby ecosystem.

https://github.com/floraison/et-orbi

Time zones for fugit and rufus-scheduler. Urbi et Orbi.
https://github.com/floraison/et-orbi

Keywords

ruby time timezone

Keywords from Contributors

crash-reporting rubygems feature-flag scheduler activerecord sinatra gem oauth2-server oauth2-provider oauth2

Last synced: about 11 hours ago
JSON representation

Repository metadata

Time zones for fugit and rufus-scheduler. Urbi et Orbi.

README.md

et-orbi

tests
Gem Version

Time zones for fugit and for rufus-scheduler. Urbi et Orbi.

EtOrbi::EoTime instances quack like Ruby Time instances, but their #zone returns a TZInfo::TimeZone instance.

Getting EoTime instances:

require 'et-orbi'

EtOrbi.now
  # => #<EtOrbi::EoTime:0x007f94d94 ...>
EtOrbi.now('Asia/Singapore')
  # => #<EtOrbi::EoTime:0x39c96e48 @time=nil, @zone=#<TZInfo::DataTimezone: Asia/Singapore>...>
EtOrbi.parse('2017-12-13 13:00:00 America/Jamaica')
  # => #<EtOrbi::EoTime:0x007f94d90 @zone=#<TZInfo::DataTimezone: America/Jamaica>...>
EtOrbi.make_time(Time.now)
  # => #<EtOrbi::EoTime:0x007f94d91 ...>

EtOrbi.make_time(2017, 1, 31, 12, 'Europe/Moscow').to_debug_s
  # => 'ot 2017-01-31 12:00:00 +03:00 dst:false'

EtOrbi::EoTime.new(0, 'UTC').to_s
  # => "1970-01-01 00:00:00 +0000"
EtOrbi::EoTime.new(0, 'Europe/Moscow').to_s
  # => "1970-01-01 03:00:00 +0300"
EtOrbi::EoTime.new(0, 'Europe/Moscow').to_zs
  # => "1970-01-01 03:00:00 Europe/Moscow" # "be precise in your speech"

EtOrbi.parse('1970-01-01 03:00:00 Europe/Moscow')
  # => #<EtOrbi::EoTime:0x00007fa4bc83fcd0
  #  @seconds=0.0, @zone=#<TZInfo::DataTimezone: Europe/Moscow>, @time=nil>

More about EtOrbi::EoTime instances:

eot = EtOrbi::EoTime.new(0, 'Europe/Moscow')

eot.to_local_time.class  # => Time
eot.to_local_time.to_s   # => "1970-01-01 09:00:00 +0900" (at least on my system)

# For the rest, EtOrbi::EoTime mimics ::Time

Helper methods:

require 'et-orbi'

EtOrbi.get_tzone('Europe/Vilnius')
  # => #<TZInfo::DataTimezone: Europe/Vilnius>
EtOrbi.local_tzone
  # => #<TZInfo::TimezoneProxy: Asia/Tokyo>

EtOrbi.platform_info
  # => "(etz:nil,tnz:\"JST\",tzid:nil,rv:\"2.2.6\",rp:\"x86_64-darwin14\",eov:\"1.0.1\",
  #      rorv:nil,astz:nil,debian:nil,centos:nil,osx:\"Asia/Tokyo\")"
    #
    # etz: ENV['TZ']
    # tnz: Time.now.zone
    # tzid: defined?(TZInfo::Data)
    # rv: RUBY_VERSION
    # rp: RUBY_PLATFORM
    # eov: EtOrbi::VERSION
    # rorv: Rails::VERSION::STRING
    # astz: ActiveSupport provided Time.zone

#rweek and #rday (clarification et-orbi 1.4.0)

EoTime#rweek and #rday are mostly used in fugit for its modulo extension.

By default (since et-orbi 1.4.0), the "reference week" for et-orbi
starts on Monday 2018-12-31, its #rweek 0 and #rday 0

class EtOrbi::EoTime;
  def rr; [ strftime('%A'), rweek, rday ]; end
end

EtOrbi.rweek_ref # => '2018-12-31'

                               #                  rw  rd
EtOrbi.parse('2018-12-29').rr  # => [ "Saturday", -1, -2 ]
EtOrbi.parse('2018-12-30').rr  # => [ "Sunday",   -1, -1 ]
EtOrbi.parse('2018-12-31').rr  # => [ "Monday",    0,  0 ]

Users living in the US, in Canada, or in the Philippines where the week start on Sunday can tune their et-orbi:

class EtOrbi::EoTime;
  def rr; [ strftime('%A'), rweek, rday ]; end
end

EtOrbi.rweek_ref = :sunday
EtOrbi.rweek_ref # => '2018-12-30'

                               #                  rw  rd
EtOrbi.parse('2018-12-29').rr  # => [ "Saturday", -1, -1 ]
EtOrbi.parse('2018-12-30').rr  # => [ "Sunday",    0,  0 ]
EtOrbi.parse('2018-12-31').rr  # => [ "Monday",    0,  1 ]

You can set the rweek_ref to :sunday, :saturday, :monday, or :iso, :us, or :default.

:sunday and :us are equivalent. :monday, :iso, and :default are equivalent.

If you feel like it, you can choose your own reference:

class EtOrbi::EoTime;
  def rr; [ strftime('%A'), rweek, rday ]; end
end

EtOrbi.rweek_ref = '2025-09-28'

                               #                    rw     rd
EtOrbi.parse('2018-12-29').rr  # => [ "Saturday", -353, -2465 ]
EtOrbi.parse('2018-12-30').rr  # => [ "Sunday",   -352, -2464 ]
EtOrbi.parse('2018-12-31').rr  # => [ "Monday",   -352, -2463 ]

Before et-orbi 1.4.0, the computation was a bit different, yielding:

class EtOrbi::EoTime;
  def rr; [ strftime('%A'), rweek, rday ]; end
end

                               #                 rw  rd
EtOrbi.parse('2018-12-29').rr  # => [ "Saturday", 0, -2 ]
EtOrbi.parse('2018-12-30').rr  # => [ "Sunday",   0, -1 ]
EtOrbi.parse('2018-12-31').rr  # => [ "Monday",   0,  0 ]
EtOrbi.parse('2019-01-01').rr  # => [ "Tuesday",  1,  1 ]

This change was motivated by fugit gh-114.

Chronic integration

By default, et-orbi relies on Chronic to parse strings like "tomorrow" or "friday 1pm", if Chronic is present.

EtOrbi.parse('tomorrow')
  # => #<EtOrbi::EoTime:0x007fbc6aa8a560
  #      @seconds=1575687600.0,
  #      @zone=#<TZInfo::TimezoneProxy: Asia/Tokyo>,
  #      @time=nil>
EtOrbi.parse('tomorrow').to_s
  # => "2019-12-07 12:00:00 +0900"

This is a poor design choice I replicated from rufus-scheduler.

Of course this leads to issues.

It's probably better to have Chronic do its work outside of et-orbi, like in:

EtOrbi.parse(Chronic.parse('tomorrow').to_s).to_s
  # => "2019-12-07 12:00:00 +0900"

If one has Chronic present in their project but doesn't want it to interfere with et-orbi, it can be disabled at parse call:

EtOrbi.parse('tomorrow')
  # => #<EtOrbi::EoTime:0x007ffb5b2a2390
  #      @seconds=1575687600.0,
  #      @zone=#<TZInfo::TimezoneProxy: Asia/Tokyo>,
  #      @time=nil>
EtOrbi.parse('tomorrow', enable_chronic: false)
  # ArgumentError: No time information in "tomorrow"
  #   from /home/jmettraux/w/et-orbi/lib/et-orbi/make.rb:31:in `rescue in parse'

or at the et-orbi level:

irb(main):007:0> EtOrbi.chronic_enabled = false
  # => false
irb(main):008:0> EtOrbi.chronic_enabled?
  # => false
EtOrbi.parse('tomorrow')
  # ArgumentError: No time information in "tomorrow"
  #   from /home/jmettraux/w/et-orbi/lib/et-orbi/make.rb:31:in `rescue in parse'

Testing

To run tests, use proba:

bundle exec proba

Rails?

If Rails is present, Time.zone is provided and EtOrbi will use it, unless ENV['TZ'] is set to a valid timezone name. Setting ENV['TZ'] to nil can give back precedence to Time.zone.

Rails sets its timezone under config/application.rb.

Related projects

Sister projects

  • rufus-scheduler - a cron/at/in/every/interval in-process scheduler, in fact, it's the father project to this fugit project
  • fugit - Time tools for flor and the floraison project. Cron parsing and occurrence computing. Timestamps and more.

LICENSE

MIT, see LICENSE.txt


Owner metadata


GitHub Events

Total
Last Year

Committers metadata

Last synced: about 22 hours ago

Total Commits: 499
Total Committers: 10
Avg Commits per committer: 49.9
Development Distribution Score (DDS): 0.032

Commits in past year: 30
Committers in past year: 3
Avg Commits per committer in past year: 10.0
Development Distribution Score (DDS) in past year: 0.167

Name Email Commits
John Mettraux j****x@g****m 483
dependabot[bot] 4****] 4
Keenan Brock k****n@t****t 3
Vais Salikhov v****v@g****m 2
Stan Hu s****u@g****m 2
Stanisław Pitucha s****a@e****m 1
Phil Ross p****s@g****m 1
Peter Goldstein p****n@g****m 1
Igor Victor g****a@y****u 1
Akira Matsuda r****e@d****p 1

Committer domains:


Issue and Pull Request metadata

Last synced: 7 days ago

Total issues: 27
Total pull requests: 18
Average time to close issues: about 1 month
Average time to close pull requests: about 21 hours
Total issue authors: 13
Total pull request authors: 12
Average comments per issue: 3.07
Average comments per pull request: 1.89
Merged pull request: 11
Bot issues: 0
Bot pull requests: 2

Past year issues: 3
Past year pull requests: 4
Past year average time to close issues: 1 day
Past year average time to close pull requests: about 11 hours
Past year issue authors: 1
Past year pull request authors: 3
Past year average comments per issue: 0.33
Past year average comments per pull request: 0.5
Past year merged pull request: 1
Past year bot issues: 0
Past year bot pull requests: 1

More stats: https://issues.ecosyste.ms/repositories/lookup?url=https://github.com/floraison/et-orbi

Top Issue Authors

  • jmettraux (15)
  • jsmartt (1)
  • chrisarcand (1)
  • mdave16 (1)
  • igoshevski (1)
  • ramfjord (1)
  • stanhu (1)
  • rangerscience (1)
  • jstrouse (1)
  • assembler (1)
  • bhartis007 (1)
  • itsjamie (1)
  • MTRNord (1)

Top Pull Request Authors

  • stanhu (4)
  • tennisvelu (2)
  • dependabot[bot] (2)
  • vais (2)
  • philr (1)
  • petergoldstein (1)
  • kbrock (1)
  • gogainda (1)
  • amatsuda (1)
  • adis-io (1)
  • viraptor (1)
  • d-m-u (1)

Top Issue Labels

  • todo (1)

Top Pull Request Labels

  • dependencies (2)
  • github_actions (1)

Package metadata

gem.coop: et-orbi

Time zones for fugit and rufus-scheduler. Urbi et Orbi.

  • Homepage: https://github.com/floraison/et-orbi
  • Documentation: http://www.rubydoc.info/gems/et-orbi/
  • Licenses: MIT
  • Latest release: 1.4.0 (published 5 months ago)
  • Last Synced: 2026-03-03T00:02:34.238Z (about 23 hours ago)
  • Versions: 34
  • Dependent Packages: 0
  • Dependent Repositories: 0
  • Downloads: 191,885,733 Total
  • Docker Downloads: 723,386,092
  • Rankings:
    • Dependent repos count: 0.0%
    • Dependent packages count: 0.0%
    • Average: 0.066%
    • Docker downloads count: 0.126%
    • Downloads: 0.139%
  • Maintainers (1)
rubygems.org: et-orbi

Time zones for fugit and rufus-scheduler. Urbi et Orbi.

  • Homepage: https://github.com/floraison/et-orbi
  • Documentation: http://www.rubydoc.info/gems/et-orbi/
  • Licenses: MIT
  • Latest release: 1.4.0 (published 5 months ago)
  • Last Synced: 2026-02-28T07:35:02.957Z (4 days ago)
  • Versions: 34
  • Dependent Packages: 3
  • Dependent Repositories: 5,575
  • Downloads: 191,584,578 Total
  • Docker Downloads: 723,386,092
  • Rankings:
    • Docker downloads count: 0.156%
    • Downloads: 0.156%
    • Dependent repos count: 0.425%
    • Dependent packages count: 4.021%
    • Average: 4.154%
    • Forks count: 8.314%
    • Stargazers count: 11.854%
  • Maintainers (1)
proxy.golang.org: github.com/floraison/et-orbi

  • Homepage:
  • Documentation: https://pkg.go.dev/github.com/floraison/et-orbi#section-documentation
  • Licenses: mit
  • Latest release: v1.4.0 (published 5 months ago)
  • Last Synced: 2026-03-01T12:30:40.870Z (2 days ago)
  • Versions: 33
  • Dependent Packages: 0
  • Dependent Repositories: 0
  • Rankings:
    • Dependent packages count: 5.497%
    • Forks count: 5.627%
    • Dependent repos count: 5.866%
    • Average: 5.95%
    • Stargazers count: 6.81%
ubuntu-23.10: ruby-et-orbi

  • Homepage: https://github.com/floraison/et-orbi
  • Licenses: mit
  • Latest release: 1.2.7-2 (published 18 days ago)
  • Last Synced: 2026-02-13T18:19:21.692Z (18 days ago)
  • Versions: 1
  • Dependent Packages: 0
  • Dependent Repositories: 0
  • Rankings:
    • Dependent repos count: 0.0%
    • Dependent packages count: 0.0%
    • Average: 100%
ubuntu-23.04: ruby-et-orbi

  • Homepage: https://github.com/floraison/et-orbi
  • Licenses: mit
  • Latest release: 1.2.2-1 (published 21 days ago)
  • Last Synced: 2026-02-11T06:38:56.695Z (21 days ago)
  • Versions: 1
  • Dependent Packages: 0
  • Dependent Repositories: 0
  • Rankings:
    • Dependent repos count: 0.0%
    • Dependent packages count: 0.0%
    • Average: 100%
ubuntu-24.04: ruby-et-orbi

  • Homepage: https://github.com/floraison/et-orbi
  • Licenses: mit
  • Latest release: 1.2.7-2 (published 25 days ago)
  • Last Synced: 2026-02-06T15:08:42.706Z (25 days ago)
  • Versions: 1
  • Dependent Packages: 0
  • Dependent Repositories: 0
  • Rankings:
ubuntu-24.10: ruby-et-orbi

  • Homepage: https://github.com/floraison/et-orbi
  • Licenses: mit
  • Latest release: 1.2.7-2 (published 22 days ago)
  • Last Synced: 2026-02-09T16:30:31.504Z (22 days ago)
  • Versions: 1
  • Dependent Packages: 0
  • Dependent Repositories: 0
  • Rankings:
ubuntu-20.04: ruby-et-orbi

  • Homepage: https://github.com/floraison/et-orbi
  • Licenses: mit
  • Latest release: 1.2.2-1 (published 19 days ago)
  • Last Synced: 2026-02-13T07:13:05.865Z (19 days ago)
  • Versions: 1
  • Dependent Packages: 0
  • Dependent Repositories: 0
  • Rankings:
    • Dependent repos count: 0.0%
    • Dependent packages count: 0.0%
    • Average: 100%
debian-12: ruby-et-orbi

  • Homepage: https://github.com/floraison/et-orbi
  • Documentation: https://packages.debian.org/bookworm/ruby-et-orbi
  • Licenses: mit
  • Latest release: 1.2.2-1 (published 19 days ago)
  • Last Synced: 2026-02-12T23:28:49.614Z (19 days ago)
  • Versions: 1
  • Dependent Packages: 0
  • Dependent Repositories: 0
  • Rankings:
    • Dependent repos count: 0.0%
    • Dependent packages count: 0.0%
    • Average: 100%
debian-11: ruby-et-orbi

  • Homepage: https://github.com/floraison/et-orbi
  • Documentation: https://packages.debian.org/bullseye/ruby-et-orbi
  • Licenses: mit
  • Latest release: 1.2.2-1 (published 21 days ago)
  • Last Synced: 2026-02-13T08:20:01.515Z (19 days ago)
  • Versions: 1
  • Dependent Packages: 0
  • Dependent Repositories: 0
  • Rankings:
    • Dependent repos count: 0.0%
    • Dependent packages count: 0.0%
    • Average: 100%
ubuntu-22.04: ruby-et-orbi

  • Homepage: https://github.com/floraison/et-orbi
  • Licenses: mit
  • Latest release: 1.2.2-1 (published 18 days ago)
  • Last Synced: 2026-02-13T13:16:19.774Z (18 days ago)
  • Versions: 1
  • Dependent Packages: 0
  • Dependent Repositories: 0
  • Rankings:
    • Dependent repos count: 0.0%
    • Dependent packages count: 0.0%
    • Average: 100%
debian-13: ruby-et-orbi

  • Homepage: https://github.com/floraison/et-orbi
  • Documentation: https://packages.debian.org/trixie/ruby-et-orbi
  • Licenses: mit
  • Latest release: 1.2.7-2 (published 19 days ago)
  • Last Synced: 2026-02-13T13:15:07.277Z (18 days ago)
  • Versions: 1
  • Dependent Packages: 0
  • Dependent Repositories: 0
  • Rankings:
    • Dependent repos count: 0.0%
    • Dependent packages count: 0.0%
    • Average: 100%
debian-10: ruby-et-orbi

  • Homepage: https://github.com/floraison/et-orbi
  • Documentation: https://packages.debian.org/buster/ruby-et-orbi
  • Licenses: mit
  • Latest release: 1.1.7-1 (published 20 days ago)
  • Last Synced: 2026-02-13T04:21:04.861Z (19 days ago)
  • Versions: 1
  • Dependent Packages: 0
  • Dependent Repositories: 0
  • Rankings:
    • Dependent repos count: 0.0%
    • Dependent packages count: 0.0%
    • Average: 100%

Dependencies

et-orbi.gemspec rubygems
  • chronic ~> 0.10 development
  • rspec ~> 3.8 development
  • tzinfo >= 0
.github/workflows/test.yaml actions
  • actions/checkout v3 composite
  • ruby/setup-ruby v1 composite

Score: 26.926139797260856