sun 1.0.0 → 1.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/LICENSE.txt +1 -1
- data/README.md +4 -4
- data/lib/sun.rb +5 -1
- data/lib/sun/version.rb +1 -1
- metadata +3 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 4bb59a47e7f0c5a42a6788e36b62bc5e1166995830a11e884c0b1bbf6d46d3e4
|
4
|
+
data.tar.gz: 965057217e9b4f87a67816d84d2b49126f7e03d5c376ad8d8bc1e0817d8cbda1
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a5b62348f398cc72d5976bdde1879aae6ea900530116f672d0774dbe00d493a703153068822383b24c2f4a73a4555235990fdd1f9f4e9bf518fcacd1638a2adc
|
7
|
+
data.tar.gz: a878d7fb246392717e76753a4a497538fe09712b655b895230960f926e851802209eb3b1f35eaa3948dc3d23ac9b5849d1f458f3b7450ec449df3f48172931f2
|
data/LICENSE.txt
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
The MIT License (MIT)
|
2
2
|
|
3
|
-
Copyright (c) 2015 Cory Kaufman-Schofield
|
3
|
+
Copyright (c) 2015-17 Cory Kaufman-Schofield
|
4
4
|
|
5
5
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
6
6
|
of this software and associated documentation files (the "Software"), to deal
|
data/README.md
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
# Sun
|
2
2
|
|
3
|
-
**
|
3
|
+
**Solar calculator for Ruby**
|
4
4
|
|
5
5
|
* [Source Code]
|
6
6
|
* [API documentation]
|
7
7
|
* [Rubygem]
|
8
8
|
|
9
9
|
[Source Code]: https://github.com/allspiritseve/sun "Source code at Github"
|
10
|
-
[API documentation]: http://rubydoc.info/gems/sun/
|
10
|
+
[API documentation]: http://www.rubydoc.info/gems/sun/file/README.md "RDoc API Documentation at RubyDoc.info"
|
11
11
|
[Rubygem]: http://rubygems.org/gems/sun "Ruby gem at RubyGems.org"
|
12
12
|
|
13
13
|
Sun is a solar calculator for Ruby based on the [National Oceanic & Atmospheric Administration (NOAA) solar calculator](http://www.esrl.noaa.gov/gmd/grad/solcalc/). Sunrise and sunset results are apparent times and not actual times (due to atmospheric refraction, apparent sunrise occurs shortly before the sun crosses above the horizon and apparent sunset occurs shortly after the sun crosses below the horizon).
|
@@ -48,10 +48,10 @@ Sun.sunset(time, latitude, longitude) # => 2015-01-01 16:38:16 -0500
|
|
48
48
|
Sun.sunrise_minutes(time, latitude, longitude) # => 740.0366212342198
|
49
49
|
|
50
50
|
# Solar noon in minutes after midnight (UTC)
|
51
|
-
Sun.
|
51
|
+
Sun.solar_noon_minutes(time, latitude, longitude) # => 1019.1596410575343
|
52
52
|
|
53
53
|
# Sunset in minutes after midnight (UTC)
|
54
|
-
Sun.
|
54
|
+
Sun.sunset_minutes(time, latitude, longitude) # => 1298.2826608808487
|
55
55
|
```
|
56
56
|
|
57
57
|
## Notes
|
data/lib/sun.rb
CHANGED
@@ -83,7 +83,11 @@ module Sun
|
|
83
83
|
|
84
84
|
def self.sun_time_minutes(type, time, latitude, longitude)
|
85
85
|
date = date(time)
|
86
|
-
|
86
|
+
if offset_multiplier(type) == 0
|
87
|
+
offset = 0
|
88
|
+
else
|
89
|
+
offset = offset_multiplier(type) * 4 * hour_angle(date, latitude)
|
90
|
+
end
|
87
91
|
720 - (4 * longitude) - equation_of_time(date, longitude) + offset
|
88
92
|
rescue Math::DomainError
|
89
93
|
raise InvalidCoordinates, "Could not determine sun times for coordinates: #{latitude}, #{longitude}"
|
data/lib/sun/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: sun
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Cory Kaufman-Schofield
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2019-12-26 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -133,8 +133,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
133
133
|
- !ruby/object:Gem::Version
|
134
134
|
version: '0'
|
135
135
|
requirements: []
|
136
|
-
|
137
|
-
rubygems_version: 2.4.8
|
136
|
+
rubygems_version: 3.0.3
|
138
137
|
signing_key:
|
139
138
|
specification_version: 4
|
140
139
|
summary: Calculate sunrise and sunset times
|