mikereedell / sunrisesunset-ruby Goto Github PK
View Code? Open in Web Editor NEWRuby gem for calculating the sunrise/set given a date and lat/long coordinates, based on the Java version.
License: MIT License
Ruby gem for calculating the sunrise/set given a date and lat/long coordinates, based on the Java version.
License: MIT License
Heroku ruby 2.0.0 installs RubySunrise no problem, but when application runs it fails at:
require 'SolarEventCalculator'
Gem deployment issue?
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)
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?
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
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...
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.