Sha256: 7a0447acd46e91c87107e62e609737e67631a921808db62ac08eb024490a513c
Contents?: true
Size: 1.4 KB
Versions: 2
Compression:
Stored size: 1.4 KB
Contents
# Lunartic [](http://badge.fury.io/rb/lunartic) [](https://codeclimate.com/github/brianokeefe/lunartic) Calculate the approximate phase of the moon on a given date. Note: Calculations are currently *very* approximate and will be improved shortly. ## Installation Add this line to your application's Gemfile: gem 'lunartic' And then execute: $ bundle Or install it yourself as: $ gem install lunartic ## Usage You can get the `day` (day within a cycle, 0..28), `percent_full` (0..1), and `phase` (a symbol) of the moon on a given day like so: ~~~ ruby irb(main):001:0> require 'lunartic' => true # get moon data for today irb(main):002:0> moon = Lunartic.today => #<Lunartic::Moon:0x007fa5028e4dc0 @date=#<Date: 2014-06-25 ((2456834j,0s,0n),+0s,2299161j)>> irb(main):003:0> moon.day => 27 irb(main):004:0> moon.phase => :waning_crescent irb(main):005:0> moon.percent_full => 0.17138763236974325 # or, get moon data for a given Date irb(main):006:0> Lunartic.on_date(Date.new(1989, 12, 28)).phase => :new ~~~ ## Testing $ rake spec ## Contributing 1. Fork it 2. Create your feature branch (`git checkout -b my-new-feature`) 3. Commit your changes (`git commit -am 'Add some feature'`) 4. Push to the branch (`git push origin my-new-feature`) 5. Create new Pull Request
Version data entries
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
lunartic-0.2.1 | README.md |
lunartic-0.2.0 | README.md |