Giter Club home page Giter Club logo

gem-equationoftime's Introduction

<img src=“https://travis-ci.org/DouglasAllen/gem-equationoftime.svg?branch=master” alt=“Build Status” />

equationoftime

Home

equationoftime.herokuapp.com/

Code

github.com/DouglasAllen/equationoftime

RDoc

www.rubydoc.info/github/DouglasAllen/gem-equationoftime/master

Issues

github.com/DouglasAllen/equationoftime/issues

DESCRIPTION:

Calculate Sunrise and Sunset. Now uses native C wrappers. Lots of examples to play with for learning about Eot.

FEATURES/PROBLEMS:

  • Use GeoLatLng class to set coordinates or set them manually.

SYNOPSIS:

start irb

$ irb --simple-prompt

enter Code

require 'eot'
eot = Eot.new
eot.string_eot          # todays eot
eot.ajd                 # was initialized to noon today ei. jd
# Try the real AJD
eot.ajd = DateTime.now.to_time.utc.to_datetime.ajd.to_f

eot.string_eot          # nothing changes so...
eot.ma_ta_set           # recalculate ma and ta after initialization
eot.string_eot          # should be different than before

# check and set a new address
geo = GeoLatLng.new
geo.addr
geo.addr = "houston, tx"     # set new location
geo.set_coordinates          # set new coordinates
eot.latitude = geo.lat       # set the Eot class attributes
eot.longitude = geo.lng

# Be shure you have the date set right
eot.ajd = DateTime.now.to_time.utc.to_datetime.ajd.to_i

eot.ma_ta_set           # recalculate ma and ta after initialization

eot.sunrise_dt.to_time.localtime("-05:00")          # the dates sunrise as DateTime
eot.local_noon_dt.to_time.localtime("-05:00")       # the dates transit as DateTime
eot.sunset_dt.to_time.localtime("-05:00")          # the dates sunset as a DateTime

eot.ajd += 1            # the days after times can be read
eot.ma_ta_set           # recalculate ma and ta after jd changes

eot.sunrise_dt.to_time.localtime("-05:00")
eot.local_noon_dt.to_time.localtime("-05:00")
eot.sunset_dt.to_time.localtime("-05:00")

Gem patch:

$ gem install eot

After realizing this name was available I decided to use it. It installs the needed requirements as for some reason gem install equationoftime doesn’t always. Hoe hoe hoe!

REQUIREMENTS:

$ bundle install

INSTALL:

$ bundle exec rake install

Build with DEVKIT

cd to devkit dir and run devkitvars.bat

or make a batchfile to start your envirnment with 'run devkitvars'
cd to gem-equationoftime dir
Rake -T

DEVELOPERS:

After checking out the source, run:

$ bundle exec rake newb

This task will install any missing dependencies, run the tests/specs, and generate the RDoc.

LICENSE:

(The MIT License)

Copyright © 2014

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the ‘Software’), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED ‘AS IS’, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

gem-equationoftime's People

Contributors

douglasallen avatar

Watchers

 avatar

Forkers

kotp solaris007

gem-equationoftime's Issues

Fixes for synopsis in readme rubygems docs and gem.

The example in synopsis can be made to work if this line is added just after the one with
eot = Eot.new
eot.ma = eot.ma_sun # why you get nil because @ma attribute is not getting set during initialization.
check it after with
eot.ta
If you get anything besides nil then the rest should work.
The toughest part is getting everything to install properly.
The two main gems needed are rest-client and celes.
Use bundler only if you install the gem from github.
Most of the others you don't need unless you want to develope more on this gem.
Feel free to as Celes can do a lot more than what Eot is using it for.
Thanks for your interest in Ruby equationoftime gem.
FYI: You might also try gem install eot as it will patch the dependencies better.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.