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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA1:
3
- metadata.gz: 981419de39da6b66ce62873498c91aee04386fa0
4
- data.tar.gz: 0232e38b4729004f092cfb1cb40e724c4167d3cb
2
+ SHA256:
3
+ metadata.gz: 4bb59a47e7f0c5a42a6788e36b62bc5e1166995830a11e884c0b1bbf6d46d3e4
4
+ data.tar.gz: 965057217e9b4f87a67816d84d2b49126f7e03d5c376ad8d8bc1e0817d8cbda1
5
5
  SHA512:
6
- metadata.gz: 01e62ce25b8f19b34c9be095521bb76c91cc534a5323154705b4ea0e3792f9bb6d9367369512f4cf292c0f37cf34de38ec7283fd6e671a0db27990b1c7be818f
7
- data.tar.gz: 5845f933f5011c81a0089cb9f38eeff5862497c1d70b42fbd2cb58474a4fc2c771b19af6d7842d87b724576fa74a0166d72d67db8380e0ca0b010cd77e5b0094
6
+ metadata.gz: a5b62348f398cc72d5976bdde1879aae6ea900530116f672d0774dbe00d493a703153068822383b24c2f4a73a4555235990fdd1f9f4e9bf518fcacd1638a2adc
7
+ data.tar.gz: a878d7fb246392717e76753a4a497538fe09712b655b895230960f926e851802209eb3b1f35eaa3948dc3d23ac9b5849d1f458f3b7450ec449df3f48172931f2
@@ -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
- **Sunrise / sunset times for Ruby**
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/frames "RDoc API Documentation at RubyDoc.info"
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.solar_noon(time, latitude, longitude) # => 1019.1596410575343
51
+ Sun.solar_noon_minutes(time, latitude, longitude) # => 1019.1596410575343
52
52
 
53
53
  # Sunset in minutes after midnight (UTC)
54
- Sun.sunset(time, latitude, longitude) # => 1298.2826608808487
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
- offset = offset_multiplier(type) * 4 * hour_angle(date, latitude)
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}"
@@ -1,3 +1,3 @@
1
1
  module Sun
2
- VERSION = "1.0.0"
2
+ VERSION = "1.0.1"
3
3
  end
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.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: 2015-09-08 00:00:00.000000000 Z
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
- rubyforge_project:
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