GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - svoop/airac: AIRAC cycle calculations

This repository was archived by the owner on Mar 2, 2026. It is now read-only.
BranchesTags
Open more actions menu

Latest commit

 

History

36 Commits
36 Commits

Folders and files

NameName
Last commit message
Last commit date
.github
.github
 
 
bin
bin
 
 
checksums
checksums
 
 
exe
exe
 
 
lib
lib
 
 
sig
sig
 
 
spec
spec
 
 
.gitignore
.gitignore
 
 
.ruby-version
.ruby-version
 
 
CHANGELOG.md
CHANGELOG.md
 
 
LICENSE.txt
LICENSE.txt
 
 
README.md
README.md
 
 
airac.gemspec
airac.gemspec
 
 
gems.rb
gems.rb
 
 
guardfile.rb
guardfile.rb
 
 
rakefile.rb
rakefile.rb
 
 

Repository files navigation

Version Tests Code Climate GitHub Sponsors

AIRAC

AIRAC (Aeronautical Information Regulation And Control) cycle calculations for Ruby.

Important

For personal reasons, I am no longer contributing to Open Flightmaps and therefore this gem is now archived and will not be updated anymore. Feel free to contact me if you want to revive or sponsor it.

  • Homepage
  • API
  • Author: Sven Schwyn - Bitcetera

Thank you for supporting free and open-source software by sponsoring on GitHub or on Donorbox. Any gesture is appreciated, from a single Euro for a ☕️ cup of coffee to 🍹 early retirement.

Install

Add the following to the Gemfile or gems.rb of your Bundler powered Ruby project:

gem 'airac'

And then install the bundle:

bundle install

Usage

You can use this gem in your Ruby project:

cycle = AIRAC::Cycle.new('2018-01-01')
cycle.date         # => #<Date: 2017-12-07>
cycle.effective    # => 2017-12-07 00:00:00 UTC..2018-01-03 23:59:59 UTC
cycle.id           # => 1713
(cycle + 5).id     # => 1804
(cycle - 5).id     # => 1708

The cycle can be formatted similar to Date#strftime, however, the placeholder %i represents the AIRAC cycle ID:

cycle = AIRAC::Cycle.new('2018-01-01')
cycle.to_s                            # "1713 2017-12-07"
cycle.to_s("@%i as per %b %-d, %Y")   # => "@1713 as per Dec 7, 2017"

The current AIRAC cycle scheme started on 2015-06-25, therefore any calculation which leads to dates prior to inception will cause an error:

(cycle - 100).id   # => ArgumentError

The AIRAC::Cycle class implements Comparable and its instances can safely be used s Hash keys.

If you prefer to do the math on the shell, the airac executable is your friend:

airac --help

Development

To install the development dependencies and then run the test suite:

bundle install
bundle exec rake    # run tests once
bundle exec guard   # run tests whenever files are modified

You're welcome to submit issues and contribute code by forking the project and submitting pull requests.

License

The gem is available as open source under the terms of the MIT License.

About

AIRAC cycle calculations

bitcetera.com

Topics

aviationgemopenflightmapsruby

Resources

Readme
MIT license
Activity

Stars

1 star

Watchers

1 watching

Forks

0 forks
Report repository

Releases

Sponsor this project

Used by

Contributors

Languages

You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.