GithubHelp home page GithubHelp logo

mikereedell / sunrisesunset-ruby Goto Github PK

View Code? Open in Web Editor NEW
62.0 62.0 19.0 52 KB

Ruby gem for calculating the sunrise/set given a date and lat/long coordinates, based on the Java version.

License: MIT License

Ruby 100.00%

sunrisesunset-ruby's People

Contributors

bodacious avatar mikereedell avatar sadiecat avatar schrockwell avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

sunrisesunset-ruby's Issues

What is the difference between the various types of times?

The readme includes this:

Ruby Sunrise calculates the civil, official, nautical and astronomical sunrise/sunset

What is the difference between the 4 kinds?

Wikipedia has some insight, but it dosesn't define what official twilight is. The definitions aren't the simplest either. (Personally I'd like to focus only on generic phrases)

Different results between Rails 6.0 and 6.1, tzinfo 2?

I am working on upgrading from Rails 6.0 to Rails 6.1. I am getting different results when I do:

$ bin/rails c
Loading development environment (Rails 6.0.6.1)
>> require "solareventcalculator"
=> true
>> SolarEventCalculator.new(Date.parse("2022-05-02"), 39.275051, -76.647482).compute_official_sunset("US/Eastern")
=> Mon, 02 May 2022 20:00:00 -0400
Loading development environment (Rails 6.1.7.6)
>> require "solareventcalculator"
=> true
>> SolarEventCalculator.new(Date.parse("2022-05-02"), 39.275051, -76.647482).compute_official_sunset("US/Eastern")
=> Mon, 02 May 2022 00:00:00 +0000

I did notice that in my Gemfile.lock, tzinfo got upgraded from 1.2.11 to 2.0.6, so that might be the real issue.

Anyone know how to fix this?

Syntax error in function convert_to_datetime(time)

This line of code throws an exception:

DateTime.parse("#{@date.strftime}T#{time.hour}:#{time.min}:00+0000") unless time == nil
I think it should be
DateTime.parse("#{@date.strftime('%F')} #{time.hour}:#{time.min}:00+0000") unless time == nil

Examples?

Small request -- can you add some example usages to the README.md?

I know, I know, you've got tests, but to someone uninitiated like me, I can't tell what is convention purely for the purpose of setting up and running bulk tests vs. what is actual library usage syntax that would occur outside of a framework.

Thanks...

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.