solcal 0.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +7 -0
- data/.gitignore +17 -0
- data/Gemfile +8 -0
- data/Gemfile.lock +31 -0
- data/LICENSE.txt +22 -0
- data/README.md +31 -0
- data/Rakefile +2 -0
- data/lib/solcal/angle.rb +29 -0
- data/lib/solcal/commands/app_longitude_command.rb +10 -0
- data/lib/solcal/commands/base_command.rb +20 -0
- data/lib/solcal/commands/declination_command.rb +10 -0
- data/lib/solcal/commands/duration_command.rb +10 -0
- data/lib/solcal/commands/eccent_earth_orbit_command.rb +10 -0
- data/lib/solcal/commands/equation_of_center_command.rb +10 -0
- data/lib/solcal/commands/equation_of_time_command.rb +15 -0
- data/lib/solcal/commands/geometric_mean_anom_command.rb +10 -0
- data/lib/solcal/commands/geometric_mean_long_command.rb +10 -0
- data/lib/solcal/commands/ha_sunrise_command.rb +13 -0
- data/lib/solcal/commands/julian_century_command.rb +15 -0
- data/lib/solcal/commands/mean_oblique_ecliptic_command.rb +10 -0
- data/lib/solcal/commands/naming_convention.rb +21 -0
- data/lib/solcal/commands/oblique_correction_command.rb +10 -0
- data/lib/solcal/commands/right_ascension_command.rb +11 -0
- data/lib/solcal/commands/solar_noon_command.rb +10 -0
- data/lib/solcal/commands/sunrise_command.rb +10 -0
- data/lib/solcal/commands/sunset_command.rb +10 -0
- data/lib/solcal/commands/true_longitude_command.rb +10 -0
- data/lib/solcal/commands/var_y_command.rb +10 -0
- data/lib/solcal/commands.rb +31 -0
- data/lib/solcal/location.rb +30 -0
- data/lib/solcal/time_of_day.rb +14 -0
- data/lib/solcal/version.rb +3 -0
- data/lib/solcal.rb +10 -0
- data/solcal.gemspec +23 -0
- data/spec/angle_spec.rb +25 -0
- data/spec/commands/app_longitude_command_spec.rb +13 -0
- data/spec/commands/base_command_spec.rb +43 -0
- data/spec/commands/declination_command_spec.rb +13 -0
- data/spec/commands/duration_command_spec.rb +13 -0
- data/spec/commands/eccent_earth_orbit_command_spec.rb +13 -0
- data/spec/commands/equation_of_center_command_spec.rb +13 -0
- data/spec/commands/equation_of_time_command_spec.rb +13 -0
- data/spec/commands/geometric_mean_anom_command_spec.rb +13 -0
- data/spec/commands/geometric_mean_long_command_spec.rb +13 -0
- data/spec/commands/ha_sunrise_command_spec.rb +13 -0
- data/spec/commands/julian_century_command_spec.rb +14 -0
- data/spec/commands/mean_oblique_ecliptic_command_spec.rb +13 -0
- data/spec/commands/naming_convention_spec.rb +35 -0
- data/spec/commands/oblique_correction_command_spec.rb +13 -0
- data/spec/commands/right_ascension_command_spec.rb +13 -0
- data/spec/commands/solar_noon_command_spec.rb +20 -0
- data/spec/commands/sunrise_command_spec.rb +13 -0
- data/spec/commands/sunset_command_spec.rb +13 -0
- data/spec/commands/true_longitude_command_spec.rb +13 -0
- data/spec/commands/var_y_command_spec.rb +13 -0
- data/spec/location_spec.rb +68 -0
- data/spec/spec.opts +3 -0
- data/spec/spec_helper.rb +7 -0
- data/spec/time_of_day_spec.rb +13 -0
- metadata +157 -0
checksums.yaml
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
---
|
|
2
|
+
SHA1:
|
|
3
|
+
metadata.gz: fbb0696fd9a72205d44e499a2151e80d00cb03c9
|
|
4
|
+
data.tar.gz: 840b58f7e25334393aa3ff7558a9b44f1bbc27ed
|
|
5
|
+
SHA512:
|
|
6
|
+
metadata.gz: 928706e7b32852e0db59b0aea5c6d8105a12536d13f4294d03d92f070189740ac766d922298dec17e23786d38e01728ff52b954b3aa07349f395b1e69d9cd663
|
|
7
|
+
data.tar.gz: 08adc087f2f69516e6f8ccef6e63a592f4c722bed58e90c000bc34dfba8c05e69740f4e4ed80459717d5d701410a24096a46c85c0aa46c90d2957c00b9eeae53
|
data/.gitignore
ADDED
data/Gemfile
ADDED
data/Gemfile.lock
ADDED
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
PATH
|
|
2
|
+
remote: .
|
|
3
|
+
specs:
|
|
4
|
+
solcal (0.0.1)
|
|
5
|
+
|
|
6
|
+
GEM
|
|
7
|
+
remote: https://rubygems.org/
|
|
8
|
+
specs:
|
|
9
|
+
diff-lcs (1.2.5)
|
|
10
|
+
rake (10.1.0)
|
|
11
|
+
rspec (3.1.0)
|
|
12
|
+
rspec-core (~> 3.1.0)
|
|
13
|
+
rspec-expectations (~> 3.1.0)
|
|
14
|
+
rspec-mocks (~> 3.1.0)
|
|
15
|
+
rspec-core (3.1.7)
|
|
16
|
+
rspec-support (~> 3.1.0)
|
|
17
|
+
rspec-expectations (3.1.2)
|
|
18
|
+
diff-lcs (>= 1.2.0, < 2.0)
|
|
19
|
+
rspec-support (~> 3.1.0)
|
|
20
|
+
rspec-mocks (3.1.3)
|
|
21
|
+
rspec-support (~> 3.1.0)
|
|
22
|
+
rspec-support (3.1.2)
|
|
23
|
+
|
|
24
|
+
PLATFORMS
|
|
25
|
+
ruby
|
|
26
|
+
|
|
27
|
+
DEPENDENCIES
|
|
28
|
+
bundler (~> 1.7)
|
|
29
|
+
rake (~> 10.0)
|
|
30
|
+
rspec
|
|
31
|
+
solcal!
|
data/LICENSE.txt
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
Copyright (c) 2014 Neil Bourgeois
|
|
2
|
+
|
|
3
|
+
MIT License
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
|
6
|
+
a copy of this software and associated documentation files (the
|
|
7
|
+
"Software"), to deal in the Software without restriction, including
|
|
8
|
+
without limitation the rights to use, copy, modify, merge, publish,
|
|
9
|
+
distribute, sublicense, and/or sell copies of the Software, and to
|
|
10
|
+
permit persons to whom the Software is furnished to do so, subject to
|
|
11
|
+
the following conditions:
|
|
12
|
+
|
|
13
|
+
The above copyright notice and this permission notice shall be
|
|
14
|
+
included in all copies or substantial portions of the Software.
|
|
15
|
+
|
|
16
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
|
17
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
|
18
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
|
19
|
+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
|
20
|
+
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
|
21
|
+
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
|
22
|
+
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
data/README.md
ADDED
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
# Solcal
|
|
2
|
+
|
|
3
|
+
Find Sunrise, Sunset, Solar Noon and Solar Position for Any Place on Earth
|
|
4
|
+
|
|
5
|
+
## Installation
|
|
6
|
+
|
|
7
|
+
Add this line to your application's Gemfile:
|
|
8
|
+
|
|
9
|
+
```ruby
|
|
10
|
+
gem 'solcal'
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
And then execute:
|
|
14
|
+
|
|
15
|
+
$ bundle
|
|
16
|
+
|
|
17
|
+
Or install it yourself as:
|
|
18
|
+
|
|
19
|
+
$ gem install solcal
|
|
20
|
+
|
|
21
|
+
## Usage
|
|
22
|
+
|
|
23
|
+
TODO: Write usage instructions here
|
|
24
|
+
|
|
25
|
+
## Contributing
|
|
26
|
+
|
|
27
|
+
1. Fork it ( https://github.com/[my-github-username]/solcal/fork )
|
|
28
|
+
2. Create your feature branch (`git checkout -b my-new-feature`)
|
|
29
|
+
3. Commit your changes (`git commit -am 'Add some feature'`)
|
|
30
|
+
4. Push to the branch (`git push origin my-new-feature`)
|
|
31
|
+
5. Create a new Pull Request
|
data/Rakefile
ADDED
data/lib/solcal/angle.rb
ADDED
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
require 'bigdecimal'
|
|
2
|
+
|
|
3
|
+
module SolCal
|
|
4
|
+
class Angle
|
|
5
|
+
def initialize(rad)
|
|
6
|
+
@angle_in_rad = rad
|
|
7
|
+
end
|
|
8
|
+
|
|
9
|
+
def self.from_deg(deg)
|
|
10
|
+
Angle.new(deg*BigDecimal.new(Math::PI,9).div(180,9))
|
|
11
|
+
end
|
|
12
|
+
|
|
13
|
+
def self.from_rad(rad)
|
|
14
|
+
Angle.new(BigDecimal.new(rad,9))
|
|
15
|
+
end
|
|
16
|
+
|
|
17
|
+
def to_rad
|
|
18
|
+
@angle_in_rad
|
|
19
|
+
end
|
|
20
|
+
|
|
21
|
+
def to_deg
|
|
22
|
+
@angle_in_rad*BigDecimal.new(180,9)/BigDecimal.new(Math::PI,9)
|
|
23
|
+
end
|
|
24
|
+
|
|
25
|
+
def div(divisor)
|
|
26
|
+
Angle.new(@angle_in_rad.div(2,9))
|
|
27
|
+
end
|
|
28
|
+
end
|
|
29
|
+
end
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
module SolCal
|
|
2
|
+
module Commands
|
|
3
|
+
class BaseCommand
|
|
4
|
+
include NamingConvention
|
|
5
|
+
|
|
6
|
+
def initialize(data)
|
|
7
|
+
@data = data
|
|
8
|
+
end
|
|
9
|
+
|
|
10
|
+
def method_missing(name, *args, &block)
|
|
11
|
+
return @data[name.to_sym] if @data[name.to_sym]
|
|
12
|
+
Commands.run(name, @data)
|
|
13
|
+
end
|
|
14
|
+
|
|
15
|
+
def execute
|
|
16
|
+
@data[key] = self.do_execute
|
|
17
|
+
end
|
|
18
|
+
end
|
|
19
|
+
end
|
|
20
|
+
end
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
module SolCal
|
|
2
|
+
module Commands
|
|
3
|
+
class EquationOfCenterCommand < BaseCommand
|
|
4
|
+
protected
|
|
5
|
+
def do_execute
|
|
6
|
+
Math.sin(geometric_mean_anom.to_rad)*(1.914602-julian_century*(0.004817+0.000014*julian_century))+Math.sin(2*geometric_mean_anom.to_rad)*(0.019993-0.000101*julian_century)+Math.sin(3*geometric_mean_anom.to_rad)*0.000289
|
|
7
|
+
end
|
|
8
|
+
end
|
|
9
|
+
end
|
|
10
|
+
end
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
module SolCal
|
|
2
|
+
module Commands
|
|
3
|
+
class EquationOfTimeCommand < BaseCommand
|
|
4
|
+
protected
|
|
5
|
+
def do_execute
|
|
6
|
+
a = var_y*Math.sin(2*geometric_mean_long.to_rad)
|
|
7
|
+
b = -2*eccent_earth_orbit*Math.sin(geometric_mean_anom.to_rad)
|
|
8
|
+
c = 4*eccent_earth_orbit*var_y*Math.sin(geometric_mean_anom.to_rad)*Math.cos(2*geometric_mean_long.to_rad)
|
|
9
|
+
d = -0.5*var_y*var_y*Math.sin(4*geometric_mean_long.to_rad)
|
|
10
|
+
e = -1.25*eccent_earth_orbit*eccent_earth_orbit*Math.sin(2*geometric_mean_anom.to_rad)
|
|
11
|
+
4*Angle.from_rad(a+b+c+d+e).to_deg
|
|
12
|
+
end
|
|
13
|
+
end
|
|
14
|
+
end
|
|
15
|
+
end
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
module SolCal
|
|
2
|
+
module Commands
|
|
3
|
+
class HaSunriseCommand < BaseCommand
|
|
4
|
+
protected
|
|
5
|
+
def do_execute
|
|
6
|
+
a = Math.cos(Angle.from_deg(90.833).to_rad)
|
|
7
|
+
b = Math.cos(latitude.to_rad)*Math.cos(declination.to_rad)
|
|
8
|
+
c = Math.tan(latitude.to_rad)*Math.tan(declination.to_rad)
|
|
9
|
+
Angle.from_rad(Math.acos(a/b-c))
|
|
10
|
+
end
|
|
11
|
+
end
|
|
12
|
+
end
|
|
13
|
+
end
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
module SolCal
|
|
2
|
+
module Commands
|
|
3
|
+
class JulianCenturyCommand < BaseCommand
|
|
4
|
+
def initialize(data)
|
|
5
|
+
super(data)
|
|
6
|
+
@year,@month,@day = data[:date].year, data[:date].month, data[:date].day
|
|
7
|
+
end
|
|
8
|
+
|
|
9
|
+
protected
|
|
10
|
+
def do_execute
|
|
11
|
+
(DateTime.new(@year,@month,@day,12,0,0,time_zone).jd.to_f - 2451545)/36525
|
|
12
|
+
end
|
|
13
|
+
end
|
|
14
|
+
end
|
|
15
|
+
end
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
module SolCal
|
|
2
|
+
module Commands
|
|
3
|
+
module NamingConvention
|
|
4
|
+
def key
|
|
5
|
+
self.class.name.split('::').last
|
|
6
|
+
.gsub(/Command$/, '')
|
|
7
|
+
.gsub(/::/, '/')
|
|
8
|
+
.gsub(/([A-Z]+)([A-Z][a-z])/,'\1_\2')
|
|
9
|
+
.gsub(/([a-z\d])([A-Z])/,'\1_\2')
|
|
10
|
+
.tr("-", "_").downcase.to_sym
|
|
11
|
+
end
|
|
12
|
+
|
|
13
|
+
def get_classname_from(variable_name)
|
|
14
|
+
parts = variable_name.to_s.split('_')
|
|
15
|
+
parts.map!{|n| n.capitalize }
|
|
16
|
+
name = parts.join('')
|
|
17
|
+
"SolCal::Commands::#{name}Command"
|
|
18
|
+
end
|
|
19
|
+
end
|
|
20
|
+
end
|
|
21
|
+
end
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
module SolCal
|
|
2
|
+
module Commands
|
|
3
|
+
class RightAscensionCommand < BaseCommand
|
|
4
|
+
protected
|
|
5
|
+
def do_execute
|
|
6
|
+
Angle.from_rad(Math.atan2(BigDecimal(Math.cos(oblique_correction.to_rad),9)*BigDecimal(Math.sin(app_longitude.to_rad),9),Math.cos(app_longitude.to_rad)))
|
|
7
|
+
end
|
|
8
|
+
end
|
|
9
|
+
end
|
|
10
|
+
end
|
|
11
|
+
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
module SolCal
|
|
2
|
+
module Commands
|
|
3
|
+
autoload :NamingConvention, 'solcal/commands/naming_convention'
|
|
4
|
+
autoload :BaseCommand, 'solcal/commands/base_command'
|
|
5
|
+
autoload :JulianCenturyCommand, 'solcal/commands/julian_century_command'
|
|
6
|
+
autoload :GeometricMeanLongCommand, 'solcal/commands/geometric_mean_long_command'
|
|
7
|
+
autoload :GeometricMeanAnomCommand, 'solcal/commands/geometric_mean_anom_command'
|
|
8
|
+
autoload :EccentEarthOrbitCommand, 'solcal/commands/eccent_earth_orbit_command'
|
|
9
|
+
autoload :MeanObliqueEclipticCommand, 'solcal/commands/mean_oblique_ecliptic_command'
|
|
10
|
+
autoload :ObliqueCorrectionCommand, 'solcal/commands/oblique_correction_command'
|
|
11
|
+
autoload :RightAscensionCommand, 'solcal/commands/right_ascension_command'
|
|
12
|
+
autoload :EquationOfCenterCommand, 'solcal/commands/equation_of_center_command'
|
|
13
|
+
autoload :EquationOfTimeCommand, 'solcal/commands/equation_of_time_command'
|
|
14
|
+
autoload :TrueLongitudeCommand, 'solcal/commands/true_longitude_command'
|
|
15
|
+
autoload :AppLongitudeCommand, 'solcal/commands/app_longitude_command'
|
|
16
|
+
autoload :SolarNoonCommand, 'solcal/commands/solar_noon_command'
|
|
17
|
+
autoload :DeclinationCommand, 'solcal/commands/declination_command'
|
|
18
|
+
autoload :VarYCommand, 'solcal/commands/var_y_command'
|
|
19
|
+
autoload :HaSunriseCommand, 'solcal/commands/ha_sunrise_command'
|
|
20
|
+
autoload :DurationCommand, 'solcal/commands/duration_command'
|
|
21
|
+
autoload :SunriseCommand, 'solcal/commands/sunrise_command'
|
|
22
|
+
autoload :SunsetCommand, 'solcal/commands/sunset_command'
|
|
23
|
+
autoload :DaylightCommand, 'solcal/commands/daylight_command'
|
|
24
|
+
|
|
25
|
+
extend NamingConvention
|
|
26
|
+
|
|
27
|
+
def self.run(name, data)
|
|
28
|
+
Object.const_get(get_classname_from(name)).new(data).execute
|
|
29
|
+
end
|
|
30
|
+
end
|
|
31
|
+
end
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
module SolCal
|
|
2
|
+
class Location
|
|
3
|
+
def initialize(latitude, longitude)
|
|
4
|
+
@latitude, @longitude = Angle.from_deg(latitude), Angle.from_deg(longitude)
|
|
5
|
+
end
|
|
6
|
+
|
|
7
|
+
def method_missing(name, *args, &block)
|
|
8
|
+
puts "Location calling [#{name}] with (#{args.inspect})"
|
|
9
|
+
Commands.run(name, create_data(args[0],args[1],args[2],args[3]))
|
|
10
|
+
end
|
|
11
|
+
|
|
12
|
+
def daylight(year,month,day,time_zone)
|
|
13
|
+
results = create_data(year,month,day, time_zone)
|
|
14
|
+
Commands.run(:sunrise, results)
|
|
15
|
+
Commands.run(:sunset, results)
|
|
16
|
+
Commands.run(:duration, results)
|
|
17
|
+
results
|
|
18
|
+
end
|
|
19
|
+
|
|
20
|
+
protected
|
|
21
|
+
def create_data(year, month, day, time_zone)
|
|
22
|
+
{
|
|
23
|
+
latitude: @latitude,
|
|
24
|
+
longitude: @longitude,
|
|
25
|
+
time_zone: time_zone,
|
|
26
|
+
date: Date.new(year,month,day)
|
|
27
|
+
}
|
|
28
|
+
end
|
|
29
|
+
end
|
|
30
|
+
end
|
data/lib/solcal.rb
ADDED
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
require 'date'
|
|
2
|
+
|
|
3
|
+
module SolCal
|
|
4
|
+
autoload :Commands, 'solcal/commands'
|
|
5
|
+
autoload :Julian, 'solcal/julian'
|
|
6
|
+
autoload :Sun, 'solcal/sun'
|
|
7
|
+
autoload :Angle, 'solcal/angle'
|
|
8
|
+
autoload :TimeOfDay, 'solcal/time_of_day'
|
|
9
|
+
autoload :Location, 'solcal/location'
|
|
10
|
+
end
|
data/solcal.gemspec
ADDED
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
# coding: utf-8
|
|
2
|
+
lib = File.expand_path('../lib', __FILE__)
|
|
3
|
+
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
|
4
|
+
require 'solcal/version'
|
|
5
|
+
|
|
6
|
+
Gem::Specification.new do |spec|
|
|
7
|
+
spec.name = "solcal"
|
|
8
|
+
spec.version = Solcal::VERSION
|
|
9
|
+
spec.authors = ["Neil Bourgeois"]
|
|
10
|
+
spec.email = ["neil.bourgeois@gmail.com"]
|
|
11
|
+
spec.summary = %q{Solar Calculator: find sunrise, sunset, solar Noon and solar position for any place on earth.}
|
|
12
|
+
spec.description = %q{Solar Calculator: find sunrise, sunset, solar Noon and solar position for any place on earth.}
|
|
13
|
+
spec.homepage = ""
|
|
14
|
+
spec.license = "MIT"
|
|
15
|
+
|
|
16
|
+
spec.files = `git ls-files -z`.split("\x0")
|
|
17
|
+
spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
|
|
18
|
+
spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
|
|
19
|
+
spec.require_paths = ["lib"]
|
|
20
|
+
|
|
21
|
+
spec.add_development_dependency "bundler", "~> 1.7"
|
|
22
|
+
spec.add_development_dependency "rake", "~> 10.0"
|
|
23
|
+
end
|
data/spec/angle_spec.rb
ADDED
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
require 'spec_helper'
|
|
2
|
+
|
|
3
|
+
describe "Angle" do
|
|
4
|
+
it "should return radian value of angle" do
|
|
5
|
+
expect(SolCal::Angle.from_deg(10).to_rad).to be_within(0.0001).of(BigDecimal.new(0.1745,4))
|
|
6
|
+
expect(SolCal::Angle.from_deg(45).to_rad).to be_within(0.00001).of(BigDecimal.new(0.78539, 5))
|
|
7
|
+
expect(SolCal::Angle.from_deg(93).to_rad).to be_within(0.001).of(BigDecimal.new(1.6231562,4))
|
|
8
|
+
expect(SolCal::Angle.from_rad(1.0).to_rad).to be_within(0.001).of(BigDecimal.new(1.0,4))
|
|
9
|
+
expect(SolCal::Angle.from_rad(2.2).to_rad).to be_within(0.001).of(BigDecimal.new(2.2,4))
|
|
10
|
+
end
|
|
11
|
+
|
|
12
|
+
it "should return deg value of angle" do
|
|
13
|
+
expect(SolCal::Angle.from_rad(0.174532925).to_deg).to be_within(0.1).of(BigDecimal.new(10,4))
|
|
14
|
+
expect(SolCal::Angle.from_rad(0.785398163).to_deg).to be_within(0.1).of(BigDecimal.new(45,4))
|
|
15
|
+
expect(SolCal::Angle.from_rad(1.6231562).to_deg).to be_within(0.1).of(BigDecimal.new(93,4))
|
|
16
|
+
end
|
|
17
|
+
|
|
18
|
+
it "should normalize large angles" do
|
|
19
|
+
expect(SolCal::Angle.from_deg(5725.893).to_rad).to be_within(0.1).of(99.9)
|
|
20
|
+
end
|
|
21
|
+
|
|
22
|
+
it "should divide" do
|
|
23
|
+
expect(SolCal::Angle.from_deg(90).div(2).to_deg).to be_within(0.1).of(45)
|
|
24
|
+
end
|
|
25
|
+
end
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
require 'spec_helper'
|
|
2
|
+
|
|
3
|
+
describe "AppLongitudeCommand" do
|
|
4
|
+
before :each do
|
|
5
|
+
@result = {true_longitude:SolCal::Angle.from_deg(247.9944),julian_century:0.149125142596397}
|
|
6
|
+
@command = SolCal::Commands::AppLongitudeCommand.new(@result)
|
|
7
|
+
end
|
|
8
|
+
|
|
9
|
+
it "should execute" do
|
|
10
|
+
@command.execute
|
|
11
|
+
expect(@result[:app_longitude].to_deg).to be_within(0.01).of(247.99)
|
|
12
|
+
end
|
|
13
|
+
end
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
require 'spec_helper'
|
|
2
|
+
|
|
3
|
+
module SolCal
|
|
4
|
+
module Commands
|
|
5
|
+
class LiteralCommand < BaseCommand
|
|
6
|
+
protected
|
|
7
|
+
def do_execute
|
|
8
|
+
14
|
|
9
|
+
end
|
|
10
|
+
end
|
|
11
|
+
end
|
|
12
|
+
end
|
|
13
|
+
|
|
14
|
+
module SolCal
|
|
15
|
+
module Commands
|
|
16
|
+
class AdditionCommand < BaseCommand
|
|
17
|
+
protected
|
|
18
|
+
def do_execute
|
|
19
|
+
literal + 3
|
|
20
|
+
end
|
|
21
|
+
end
|
|
22
|
+
end
|
|
23
|
+
end
|
|
24
|
+
|
|
25
|
+
describe "BaseCommand" do
|
|
26
|
+
before :each do
|
|
27
|
+
@results = {}
|
|
28
|
+
end
|
|
29
|
+
|
|
30
|
+
it "should convert class name to key" do
|
|
31
|
+
expect(SolCal::Commands::LiteralCommand.new(@results).key).to be(:literal)
|
|
32
|
+
end
|
|
33
|
+
|
|
34
|
+
it "should store the result of command in the results hash" do
|
|
35
|
+
SolCal::Commands::LiteralCommand.new(@results).execute
|
|
36
|
+
expect(@results[:literal]).to eql(14)
|
|
37
|
+
end
|
|
38
|
+
|
|
39
|
+
it "should instantiate and execute the specified command when the result is not set" do
|
|
40
|
+
SolCal::Commands::AdditionCommand.new(@results).execute
|
|
41
|
+
expect(@results[:addition]).to eql(17)
|
|
42
|
+
end
|
|
43
|
+
end
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
require 'spec_helper'
|
|
2
|
+
|
|
3
|
+
describe "DeclinationCommand" do
|
|
4
|
+
before :each do
|
|
5
|
+
@result = {oblique_correction:SolCal::Angle.from_deg(247.99),app_longitude:SolCal::Angle.from_deg(23.4349)}
|
|
6
|
+
@command = SolCal::Commands::DeclinationCommand.new(@result)
|
|
7
|
+
end
|
|
8
|
+
|
|
9
|
+
it "should execute" do
|
|
10
|
+
@command.execute
|
|
11
|
+
expect(@result[:declination].to_deg).to be_within(0.001).of(-21.6368)
|
|
12
|
+
end
|
|
13
|
+
end
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
require 'spec_helper'
|
|
2
|
+
|
|
3
|
+
describe "DurationCommand" do
|
|
4
|
+
before :each do
|
|
5
|
+
@result = {julian_century:0.149125142596397,ha_sunrise:SolCal::Angle.from_deg(59.02064)}
|
|
6
|
+
@command = SolCal::Commands::DurationCommand.new(@result)
|
|
7
|
+
end
|
|
8
|
+
|
|
9
|
+
it "should execute" do
|
|
10
|
+
@command.execute
|
|
11
|
+
expect(@result[:duration]).to be_within(0.001).of(472.16513)
|
|
12
|
+
end
|
|
13
|
+
end
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
require 'spec_helper'
|
|
2
|
+
|
|
3
|
+
describe "EccentEarthOrbitCommand" do
|
|
4
|
+
before :each do
|
|
5
|
+
@result = {julian_century:0.149125142596397}
|
|
6
|
+
@command = SolCal::Commands::EccentEarthOrbitCommand.new(@result)
|
|
7
|
+
end
|
|
8
|
+
|
|
9
|
+
it "should execute" do
|
|
10
|
+
@command.execute
|
|
11
|
+
expect(@result[:eccent_earth_orbit]).to be_within(0.000001).of(0.016702)
|
|
12
|
+
end
|
|
13
|
+
end
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
require 'spec_helper'
|
|
2
|
+
|
|
3
|
+
describe "EquationOfCenterCommand" do
|
|
4
|
+
before :each do
|
|
5
|
+
@result = {julian_century:0.149125142596397,geometric_mean_anom:SolCal::Angle.from_deg(5725.89261441308)}
|
|
6
|
+
@command = SolCal::Commands::EquationOfCenterCommand.new(@result)
|
|
7
|
+
end
|
|
8
|
+
|
|
9
|
+
it "should execute" do
|
|
10
|
+
@command.execute
|
|
11
|
+
expect(@result[:equation_of_center]).to be_within(0.00001).of(-1.09204)
|
|
12
|
+
end
|
|
13
|
+
end
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
require 'spec_helper'
|
|
2
|
+
|
|
3
|
+
describe "EquationOfTimeCommand" do
|
|
4
|
+
before :each do
|
|
5
|
+
@result = {var_y:0.043018,geometric_mean_long:SolCal::Angle.from_deg(250.072),geometric_mean_anom:SolCal::Angle.from_deg(5726.878),eccent_earth_orbit:0.016702}
|
|
6
|
+
@command = SolCal::Commands::EquationOfTimeCommand.new(@result)
|
|
7
|
+
end
|
|
8
|
+
|
|
9
|
+
it "should execute" do
|
|
10
|
+
@command.execute
|
|
11
|
+
expect(@result[:equation_of_time]).to be_within(0.0001).of(11.0596)
|
|
12
|
+
end
|
|
13
|
+
end
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
require 'spec_helper'
|
|
2
|
+
|
|
3
|
+
describe "GeometricMeanAnomCommand" do
|
|
4
|
+
before :each do
|
|
5
|
+
@result = {julian_century:0.149125142596397}
|
|
6
|
+
@command = SolCal::Commands::GeometricMeanAnomCommand.new(@result)
|
|
7
|
+
end
|
|
8
|
+
|
|
9
|
+
it "should execute" do
|
|
10
|
+
@command.execute
|
|
11
|
+
expect(@result[:geometric_mean_anom].to_deg).to be_within(0.001).of(5725.893)
|
|
12
|
+
end
|
|
13
|
+
end
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
require 'spec_helper'
|
|
2
|
+
|
|
3
|
+
describe "GeometricMeanLongCommand" do
|
|
4
|
+
before :each do
|
|
5
|
+
@result = {julian_century:0.149125142596397}
|
|
6
|
+
@command = SolCal::Commands::GeometricMeanLongCommand.new(@result)
|
|
7
|
+
end
|
|
8
|
+
|
|
9
|
+
it "should execute" do
|
|
10
|
+
@command.execute
|
|
11
|
+
expect(@result[:geometric_mean_long].to_deg).to be_within(0.0001).of(249.0864)
|
|
12
|
+
end
|
|
13
|
+
end
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
require 'spec_helper'
|
|
2
|
+
|
|
3
|
+
describe "HaSunriseCommand" do
|
|
4
|
+
before :each do
|
|
5
|
+
@result = {latitude:SolCal::Angle.from_deg(53.5333),declination:SolCal::Angle.from_deg(-21.7958)}
|
|
6
|
+
@command = SolCal::Commands::HaSunriseCommand.new(@result)
|
|
7
|
+
end
|
|
8
|
+
|
|
9
|
+
it "should execute" do
|
|
10
|
+
@command.execute
|
|
11
|
+
expect(@result[:ha_sunrise].to_deg).to be_within(0.0001).of(59.02064)
|
|
12
|
+
end
|
|
13
|
+
end
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
require 'spec_helper'
|
|
2
|
+
|
|
3
|
+
describe "JulianCenturyCommand" do
|
|
4
|
+
before :each do
|
|
5
|
+
@results = {date:Date.new(2014,12,1), time_zone: -7}
|
|
6
|
+
@command = SolCal::Commands::JulianCenturyCommand.new(@results)
|
|
7
|
+
end
|
|
8
|
+
|
|
9
|
+
it "should calculate julian century from date" do
|
|
10
|
+
@command.execute
|
|
11
|
+
expect(@results[:julian_century]).not_to be_nil
|
|
12
|
+
expect(@results[:julian_century]).to be_within(0.0001).of(0.14912526)
|
|
13
|
+
end
|
|
14
|
+
end
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
require 'spec_helper'
|
|
2
|
+
|
|
3
|
+
describe "MeanObliqueEclipticCommand" do
|
|
4
|
+
before :each do
|
|
5
|
+
@result = {julian_century:0.149125142596397}
|
|
6
|
+
@command = SolCal::Commands::MeanObliqueEclipticCommand.new(@result)
|
|
7
|
+
end
|
|
8
|
+
|
|
9
|
+
it "should execute" do
|
|
10
|
+
@command.execute
|
|
11
|
+
expect(@result[:mean_oblique_ecliptic]).to be_within(0.001).of(23.43735)
|
|
12
|
+
end
|
|
13
|
+
end
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
require 'spec_helper'
|
|
2
|
+
|
|
3
|
+
module SolCal
|
|
4
|
+
module Commands
|
|
5
|
+
class HappyHappyCommand
|
|
6
|
+
include NamingConvention
|
|
7
|
+
end
|
|
8
|
+
|
|
9
|
+
class TestCommand
|
|
10
|
+
include NamingConvention
|
|
11
|
+
end
|
|
12
|
+
end
|
|
13
|
+
end
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
describe "NamingConvention" do
|
|
17
|
+
before :each do
|
|
18
|
+
@results = {}
|
|
19
|
+
end
|
|
20
|
+
|
|
21
|
+
it "should convert class name to key" do
|
|
22
|
+
expect(SolCal::Commands::TestCommand.new.key).to be(:test)
|
|
23
|
+
expect(SolCal::Commands::HappyHappyCommand.new.key).to be(:happy_happy)
|
|
24
|
+
end
|
|
25
|
+
|
|
26
|
+
it "should convert variable name to class name" do
|
|
27
|
+
expect(SolCal::Commands::TestCommand.new.get_classname_from("test")).to eql("SolCal::Commands::TestCommand")
|
|
28
|
+
expect(SolCal::Commands::TestCommand.new.get_classname_from("happy_happy")).to eql("SolCal::Commands::HappyHappyCommand")
|
|
29
|
+
end
|
|
30
|
+
|
|
31
|
+
it "should convert symbol to class name" do
|
|
32
|
+
expect(SolCal::Commands::TestCommand.new.get_classname_from(:test)).to eql("SolCal::Commands::TestCommand")
|
|
33
|
+
expect(SolCal::Commands::TestCommand.new.get_classname_from(:happy_happy)).to eql("SolCal::Commands::HappyHappyCommand")
|
|
34
|
+
end
|
|
35
|
+
end
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
require 'spec_helper'
|
|
2
|
+
|
|
3
|
+
describe "ObliqueCorrectionCommand" do
|
|
4
|
+
before :each do
|
|
5
|
+
@result = {julian_century:0.149125142596397,mean_oblique_ecliptic:23.43735}
|
|
6
|
+
@command = SolCal::Commands::ObliqueCorrectionCommand.new(@result)
|
|
7
|
+
end
|
|
8
|
+
|
|
9
|
+
it "should execute" do
|
|
10
|
+
@command.execute
|
|
11
|
+
expect(@result[:oblique_correction].to_deg).to be_within(0.001).of(23.4349)
|
|
12
|
+
end
|
|
13
|
+
end
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
require 'spec_helper'
|
|
2
|
+
|
|
3
|
+
describe "RightAscensionCommand" do
|
|
4
|
+
before :each do
|
|
5
|
+
@result = {app_longitude:SolCal::Angle.from_deg(247.99),oblique_correction:SolCal::Angle.from_deg(23.4349)}
|
|
6
|
+
@command = SolCal::Commands::RightAscensionCommand.new(@result)
|
|
7
|
+
end
|
|
8
|
+
|
|
9
|
+
it "should execute" do
|
|
10
|
+
@command.execute
|
|
11
|
+
expect(@result[:right_ascension].to_deg).to be_within(0.001).of(-113.777)
|
|
12
|
+
end
|
|
13
|
+
end
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
require 'spec_helper'
|
|
2
|
+
|
|
3
|
+
describe "SolarNoonCommand" do
|
|
4
|
+
before :each do
|
|
5
|
+
@result = {longitude:SolCal::Angle.from_deg(-113.5), time_zone:-7}
|
|
6
|
+
@command = SolCal::Commands::SolarNoonCommand.new(@result)
|
|
7
|
+
end
|
|
8
|
+
|
|
9
|
+
it "should execute" do
|
|
10
|
+
@result[:equation_of_time] = 11.059588
|
|
11
|
+
@command.execute
|
|
12
|
+
expect(@result[:solar_noon]).to be_within(0.0001).of(0.515931)
|
|
13
|
+
end
|
|
14
|
+
|
|
15
|
+
it "should execute with a big decimal" do
|
|
16
|
+
@result[:equation_of_time] = BigDecimal.new("10.98306")
|
|
17
|
+
@command.execute
|
|
18
|
+
expect(@result[:solar_noon]).to be_within(0.0001).of(0.515984)
|
|
19
|
+
end
|
|
20
|
+
end
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
require 'spec_helper'
|
|
2
|
+
|
|
3
|
+
describe "SunriseCommand" do
|
|
4
|
+
before :each do
|
|
5
|
+
@result = {julian_century:0.149125142596397,ha_sunrise:SolCal::Angle.from_deg(59.02064),solar_noon:0.515931}
|
|
6
|
+
@command = SolCal::Commands::SunriseCommand.new(@result)
|
|
7
|
+
end
|
|
8
|
+
|
|
9
|
+
it "should execute" do
|
|
10
|
+
@command.execute
|
|
11
|
+
expect(@result[:sunrise].to_s).to eql("08:26")
|
|
12
|
+
end
|
|
13
|
+
end
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
require 'spec_helper'
|
|
2
|
+
|
|
3
|
+
describe "SunsetCommand" do
|
|
4
|
+
before :each do
|
|
5
|
+
@result = {julian_century:0.149125142596397,ha_sunrise:SolCal::Angle.from_deg(59.02064),solar_noon:0.515931}
|
|
6
|
+
@command = SolCal::Commands::SunsetCommand.new(@result)
|
|
7
|
+
end
|
|
8
|
+
|
|
9
|
+
it "should execute" do
|
|
10
|
+
@command.execute
|
|
11
|
+
expect(@result[:sunset].to_s).to eql("16:19")
|
|
12
|
+
end
|
|
13
|
+
end
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
require 'spec_helper'
|
|
2
|
+
|
|
3
|
+
describe "TrueLongitudeCommand" do
|
|
4
|
+
before :each do
|
|
5
|
+
@result = {geometric_mean_long:SolCal::Angle.from_deg(249.0864),equation_of_center:-1.092}
|
|
6
|
+
@command = SolCal::Commands::TrueLongitudeCommand.new(@result)
|
|
7
|
+
end
|
|
8
|
+
|
|
9
|
+
it "should execute" do
|
|
10
|
+
@command.execute
|
|
11
|
+
expect(@result[:true_longitude].to_deg).to be_within(0.0001).of(247.9944)
|
|
12
|
+
end
|
|
13
|
+
end
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
require 'spec_helper'
|
|
2
|
+
|
|
3
|
+
describe "VarYCommand" do
|
|
4
|
+
before :each do
|
|
5
|
+
@result = {oblique_correction:SolCal::Angle.from_deg(23.4349)}
|
|
6
|
+
@command = SolCal::Commands::VarYCommand.new(@result)
|
|
7
|
+
end
|
|
8
|
+
|
|
9
|
+
it "should execute" do
|
|
10
|
+
@command.execute
|
|
11
|
+
expect(@result[:var_y]).to be_within(0.0001).of(0.043018)
|
|
12
|
+
end
|
|
13
|
+
end
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
require 'spec_helper'
|
|
2
|
+
|
|
3
|
+
describe "Location" do
|
|
4
|
+
before :each do
|
|
5
|
+
@edmonton = SolCal::Location.new(53.5333, -113.5)
|
|
6
|
+
@miami = SolCal::Location.new(25.7877, -80.2241)
|
|
7
|
+
@sydney = SolCal::Location.new(-33.86, 151.2094)
|
|
8
|
+
end
|
|
9
|
+
|
|
10
|
+
it "should calculate the sunrise for an arbitrary day in Edmonton" do
|
|
11
|
+
expect(SolCal::Commands).to receive(:run).and_return({sunrise:SolCal::TimeOfDay.new(0.25)})
|
|
12
|
+
expect(@edmonton.sunrise(2014,12,21,-7).to_s).to eql("06:00")
|
|
13
|
+
end
|
|
14
|
+
|
|
15
|
+
it "should calculate the sunset for an arbitrary day in Edmonton" do
|
|
16
|
+
expect(SolCal::Commands).to receive(:run).and_return({sunset:SolCal::TimeOfDay.new(0.75)})
|
|
17
|
+
expect(@edmonton.sunset(2014,12,21,-7).to_s).to eql("18:00")
|
|
18
|
+
end
|
|
19
|
+
|
|
20
|
+
it "should calculate the duration of sunlight for an arbitrary day in Edmonton" do
|
|
21
|
+
expect(SolCal::Commands).to receive(:run).and_return({duration:500})
|
|
22
|
+
expect(@edmonton.duration(2014,12,21,-7)).to eql(500)
|
|
23
|
+
end
|
|
24
|
+
|
|
25
|
+
it "should calculate daylight information for edmonton" do
|
|
26
|
+
results = @edmonton.daylight(2014,12,1,-7)
|
|
27
|
+
expect(results[:sunrise].to_s).to eql("08:27")
|
|
28
|
+
expect(results[:sunset].to_s).to eql("16:18")
|
|
29
|
+
expect(results[:duration]).to be_within(1).of(472.16513)
|
|
30
|
+
end
|
|
31
|
+
|
|
32
|
+
it "should calculate daylight information in Edmonton on winter solstice" do
|
|
33
|
+
results = @edmonton.daylight(2014,12,21,-7)
|
|
34
|
+
expect(results[:sunrise].to_s).to eql("08:48")
|
|
35
|
+
expect(results[:sunset].to_s).to eql("16:15")
|
|
36
|
+
end
|
|
37
|
+
|
|
38
|
+
it "should calculate daylight information in Edmonton on summer solstice" do
|
|
39
|
+
results = @edmonton.daylight(2014,6,21,-6)
|
|
40
|
+
expect(results[:sunrise].to_s).to eql("05:04")
|
|
41
|
+
expect(results[:sunset].to_s).to eql("22:07")
|
|
42
|
+
end
|
|
43
|
+
|
|
44
|
+
it "should calculate daylight information in Miami on winter solstice" do
|
|
45
|
+
results = @miami.daylight(2014,12,21,-5)
|
|
46
|
+
expect(results[:sunrise].to_s).to eql("07:03")
|
|
47
|
+
expect(results[:sunset].to_s).to eql("17:34")
|
|
48
|
+
end
|
|
49
|
+
|
|
50
|
+
it "should calculate daylight information in Miami on summer solstice" do
|
|
51
|
+
results = @miami.daylight(2014,6,21,-4)
|
|
52
|
+
expect(results[:sunrise].to_s).to eql("06:30")
|
|
53
|
+
expect(results[:sunset].to_s).to eql("20:15")
|
|
54
|
+
end
|
|
55
|
+
|
|
56
|
+
it "should calculate daylight information in Sydney on winter solstice" do
|
|
57
|
+
results = @sydney.daylight(2014,12,21,+11)
|
|
58
|
+
expect(results[:sunrise].to_s).to eql("05:41")
|
|
59
|
+
expect(results[:sunset].to_s).to eql("20:05")
|
|
60
|
+
end
|
|
61
|
+
|
|
62
|
+
it "should calculate daylight information in Sydney on summer solstice" do
|
|
63
|
+
results = @sydney.daylight(2014,6,21,+10)
|
|
64
|
+
expect(results[:sunrise].to_s).to eql("07:00")
|
|
65
|
+
expect(results[:sunset].to_s).to eql("16:53")
|
|
66
|
+
end
|
|
67
|
+
end
|
|
68
|
+
|
data/spec/spec.opts
ADDED
data/spec/spec_helper.rb
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
describe 'TimeOfDay' do
|
|
2
|
+
it 'should convert midnight' do
|
|
3
|
+
expect(SolCal::TimeOfDay.new(0).to_s).to eql("00:00")
|
|
4
|
+
end
|
|
5
|
+
|
|
6
|
+
it 'should convert noon' do
|
|
7
|
+
expect(SolCal::TimeOfDay.new(0.5).to_s).to eql("12:00")
|
|
8
|
+
end
|
|
9
|
+
|
|
10
|
+
it 'should convert arbitrary time' do
|
|
11
|
+
expect(SolCal::TimeOfDay.new(0.352032).to_s).to eql("08:26")
|
|
12
|
+
end
|
|
13
|
+
end
|
metadata
ADDED
|
@@ -0,0 +1,157 @@
|
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
|
2
|
+
name: solcal
|
|
3
|
+
version: !ruby/object:Gem::Version
|
|
4
|
+
version: 0.0.1
|
|
5
|
+
platform: ruby
|
|
6
|
+
authors:
|
|
7
|
+
- Neil Bourgeois
|
|
8
|
+
autorequire:
|
|
9
|
+
bindir: bin
|
|
10
|
+
cert_chain: []
|
|
11
|
+
date: 2014-12-20 00:00:00.000000000 Z
|
|
12
|
+
dependencies:
|
|
13
|
+
- !ruby/object:Gem::Dependency
|
|
14
|
+
name: bundler
|
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
|
16
|
+
requirements:
|
|
17
|
+
- - "~>"
|
|
18
|
+
- !ruby/object:Gem::Version
|
|
19
|
+
version: '1.7'
|
|
20
|
+
type: :development
|
|
21
|
+
prerelease: false
|
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
23
|
+
requirements:
|
|
24
|
+
- - "~>"
|
|
25
|
+
- !ruby/object:Gem::Version
|
|
26
|
+
version: '1.7'
|
|
27
|
+
- !ruby/object:Gem::Dependency
|
|
28
|
+
name: rake
|
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
|
30
|
+
requirements:
|
|
31
|
+
- - "~>"
|
|
32
|
+
- !ruby/object:Gem::Version
|
|
33
|
+
version: '10.0'
|
|
34
|
+
type: :development
|
|
35
|
+
prerelease: false
|
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
37
|
+
requirements:
|
|
38
|
+
- - "~>"
|
|
39
|
+
- !ruby/object:Gem::Version
|
|
40
|
+
version: '10.0'
|
|
41
|
+
description: 'Solar Calculator: find sunrise, sunset, solar Noon and solar position
|
|
42
|
+
for any place on earth.'
|
|
43
|
+
email:
|
|
44
|
+
- neil.bourgeois@gmail.com
|
|
45
|
+
executables: []
|
|
46
|
+
extensions: []
|
|
47
|
+
extra_rdoc_files: []
|
|
48
|
+
files:
|
|
49
|
+
- ".gitignore"
|
|
50
|
+
- Gemfile
|
|
51
|
+
- Gemfile.lock
|
|
52
|
+
- LICENSE.txt
|
|
53
|
+
- README.md
|
|
54
|
+
- Rakefile
|
|
55
|
+
- lib/solcal.rb
|
|
56
|
+
- lib/solcal/angle.rb
|
|
57
|
+
- lib/solcal/commands.rb
|
|
58
|
+
- lib/solcal/commands/app_longitude_command.rb
|
|
59
|
+
- lib/solcal/commands/base_command.rb
|
|
60
|
+
- lib/solcal/commands/declination_command.rb
|
|
61
|
+
- lib/solcal/commands/duration_command.rb
|
|
62
|
+
- lib/solcal/commands/eccent_earth_orbit_command.rb
|
|
63
|
+
- lib/solcal/commands/equation_of_center_command.rb
|
|
64
|
+
- lib/solcal/commands/equation_of_time_command.rb
|
|
65
|
+
- lib/solcal/commands/geometric_mean_anom_command.rb
|
|
66
|
+
- lib/solcal/commands/geometric_mean_long_command.rb
|
|
67
|
+
- lib/solcal/commands/ha_sunrise_command.rb
|
|
68
|
+
- lib/solcal/commands/julian_century_command.rb
|
|
69
|
+
- lib/solcal/commands/mean_oblique_ecliptic_command.rb
|
|
70
|
+
- lib/solcal/commands/naming_convention.rb
|
|
71
|
+
- lib/solcal/commands/oblique_correction_command.rb
|
|
72
|
+
- lib/solcal/commands/right_ascension_command.rb
|
|
73
|
+
- lib/solcal/commands/solar_noon_command.rb
|
|
74
|
+
- lib/solcal/commands/sunrise_command.rb
|
|
75
|
+
- lib/solcal/commands/sunset_command.rb
|
|
76
|
+
- lib/solcal/commands/true_longitude_command.rb
|
|
77
|
+
- lib/solcal/commands/var_y_command.rb
|
|
78
|
+
- lib/solcal/location.rb
|
|
79
|
+
- lib/solcal/time_of_day.rb
|
|
80
|
+
- lib/solcal/version.rb
|
|
81
|
+
- solcal.gemspec
|
|
82
|
+
- spec/angle_spec.rb
|
|
83
|
+
- spec/commands/app_longitude_command_spec.rb
|
|
84
|
+
- spec/commands/base_command_spec.rb
|
|
85
|
+
- spec/commands/declination_command_spec.rb
|
|
86
|
+
- spec/commands/duration_command_spec.rb
|
|
87
|
+
- spec/commands/eccent_earth_orbit_command_spec.rb
|
|
88
|
+
- spec/commands/equation_of_center_command_spec.rb
|
|
89
|
+
- spec/commands/equation_of_time_command_spec.rb
|
|
90
|
+
- spec/commands/geometric_mean_anom_command_spec.rb
|
|
91
|
+
- spec/commands/geometric_mean_long_command_spec.rb
|
|
92
|
+
- spec/commands/ha_sunrise_command_spec.rb
|
|
93
|
+
- spec/commands/julian_century_command_spec.rb
|
|
94
|
+
- spec/commands/mean_oblique_ecliptic_command_spec.rb
|
|
95
|
+
- spec/commands/naming_convention_spec.rb
|
|
96
|
+
- spec/commands/oblique_correction_command_spec.rb
|
|
97
|
+
- spec/commands/right_ascension_command_spec.rb
|
|
98
|
+
- spec/commands/solar_noon_command_spec.rb
|
|
99
|
+
- spec/commands/sunrise_command_spec.rb
|
|
100
|
+
- spec/commands/sunset_command_spec.rb
|
|
101
|
+
- spec/commands/true_longitude_command_spec.rb
|
|
102
|
+
- spec/commands/var_y_command_spec.rb
|
|
103
|
+
- spec/location_spec.rb
|
|
104
|
+
- spec/spec.opts
|
|
105
|
+
- spec/spec_helper.rb
|
|
106
|
+
- spec/time_of_day_spec.rb
|
|
107
|
+
homepage: ''
|
|
108
|
+
licenses:
|
|
109
|
+
- MIT
|
|
110
|
+
metadata: {}
|
|
111
|
+
post_install_message:
|
|
112
|
+
rdoc_options: []
|
|
113
|
+
require_paths:
|
|
114
|
+
- lib
|
|
115
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
|
116
|
+
requirements:
|
|
117
|
+
- - ">="
|
|
118
|
+
- !ruby/object:Gem::Version
|
|
119
|
+
version: '0'
|
|
120
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
|
121
|
+
requirements:
|
|
122
|
+
- - ">="
|
|
123
|
+
- !ruby/object:Gem::Version
|
|
124
|
+
version: '0'
|
|
125
|
+
requirements: []
|
|
126
|
+
rubyforge_project:
|
|
127
|
+
rubygems_version: 2.4.3
|
|
128
|
+
signing_key:
|
|
129
|
+
specification_version: 4
|
|
130
|
+
summary: 'Solar Calculator: find sunrise, sunset, solar Noon and solar position for
|
|
131
|
+
any place on earth.'
|
|
132
|
+
test_files:
|
|
133
|
+
- spec/angle_spec.rb
|
|
134
|
+
- spec/commands/app_longitude_command_spec.rb
|
|
135
|
+
- spec/commands/base_command_spec.rb
|
|
136
|
+
- spec/commands/declination_command_spec.rb
|
|
137
|
+
- spec/commands/duration_command_spec.rb
|
|
138
|
+
- spec/commands/eccent_earth_orbit_command_spec.rb
|
|
139
|
+
- spec/commands/equation_of_center_command_spec.rb
|
|
140
|
+
- spec/commands/equation_of_time_command_spec.rb
|
|
141
|
+
- spec/commands/geometric_mean_anom_command_spec.rb
|
|
142
|
+
- spec/commands/geometric_mean_long_command_spec.rb
|
|
143
|
+
- spec/commands/ha_sunrise_command_spec.rb
|
|
144
|
+
- spec/commands/julian_century_command_spec.rb
|
|
145
|
+
- spec/commands/mean_oblique_ecliptic_command_spec.rb
|
|
146
|
+
- spec/commands/naming_convention_spec.rb
|
|
147
|
+
- spec/commands/oblique_correction_command_spec.rb
|
|
148
|
+
- spec/commands/right_ascension_command_spec.rb
|
|
149
|
+
- spec/commands/solar_noon_command_spec.rb
|
|
150
|
+
- spec/commands/sunrise_command_spec.rb
|
|
151
|
+
- spec/commands/sunset_command_spec.rb
|
|
152
|
+
- spec/commands/true_longitude_command_spec.rb
|
|
153
|
+
- spec/commands/var_y_command_spec.rb
|
|
154
|
+
- spec/location_spec.rb
|
|
155
|
+
- spec/spec.opts
|
|
156
|
+
- spec/spec_helper.rb
|
|
157
|
+
- spec/time_of_day_spec.rb
|