equationoftime 4.1.7 → 4.1.8

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,45 @@
1
+ # init_spec.rb
2
+ gem 'minitest'
3
+ require 'minitest/autorun'
4
+
5
+ lib = File.expand_path('../../../lib', __FILE__)
6
+ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
7
+ require 'eot'
8
+
9
+ describe 'Eot_initialize has set attributes ' do
10
+
11
+ JD_TODAY = DateTime.now.to_time.utc.to_datetime.jd.to_f
12
+ it "expected #{JD_TODAY} from Eot.new.ajd" do
13
+ assert_equal(JD_TODAY, Eot.new.ajd)
14
+ end
15
+
16
+ UK_LAT = 0.0
17
+ it "expected #{UK_LAT} from Eot.new.latitude" do
18
+ assert_equal(UK_LAT, Eot.new.latitude)
19
+ end
20
+
21
+ UK_LNG = 0.0
22
+ it "expected #{UK_LNG} from Eot.new.longitude" do
23
+ assert_equal(UK_LNG, Eot.new.longitude)
24
+ end
25
+
26
+ MA_SUN = Eot.new.ma_sun
27
+ it "expected #{MA_SUN} from @ma" do
28
+ eot = Eot.new
29
+ eot.ajd = JD_TODAY
30
+ assert_equal(MA_SUN, eot.ma)
31
+ end
32
+
33
+ FRAC_CENT = (Eot.new.ajd - Eot::DJ00) / Eot::DJC
34
+ it "expected #{FRAC_CENT} from @ta" do
35
+ eot = Eot.new
36
+ eot.ajd = JD_TODAY
37
+ assert_equal(FRAC_CENT, eot.ta)
38
+ end
39
+
40
+ DEFAULT_INT = nil
41
+ it "expected #{DEFAULT_INT} from Eot.new.addr" do
42
+ assert_equal(DEFAULT_INT, Eot.new.addr)
43
+ end
44
+
45
+ end
@@ -0,0 +1,199 @@
1
+ # times_spec.rb
2
+ gem 'minitest'
3
+ require 'minitest/autorun'
4
+ lib = File.expand_path('../../../lib', __FILE__)
5
+ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
6
+ require 'eot'
7
+
8
+ times = Eot.new
9
+
10
+ describe 'tests ajd of 2456885.0 ' do
11
+
12
+ before(:each) do
13
+ times.ajd = 2_456_885.0
14
+ ajd = times.ajd
15
+ times.ma_ta_set
16
+ # check date for this ajd when needed.
17
+ times.date = times.ajd_to_datetime(ajd)
18
+ end
19
+
20
+ it 'expected 2456885.0 for times.ajd'do
21
+ assert_equal(2_456_885.0, times.ajd)
22
+ end
23
+
24
+ it 'expected "2014-08-15T12:00:00+00:00" for times.date'.to_s do
25
+ assert_equal '2014-08-15T12:00:00+00:00', times.date.to_s
26
+ end
27
+
28
+ it 'expected 3.8508003966038915 for times.ma'do
29
+ assert_equal(3.8508003966038915, times.ma)
30
+ end
31
+
32
+ it 'expected "2014-08-15T12:00:00+00:00" from \
33
+ times.ajd_to_datetime(times.ajd).to_s ' do
34
+ assert_equal '2014-08-15T12:00:00+00:00',\
35
+ times.ajd_to_datetime(times.ajd).to_s
36
+ end
37
+
38
+ it 'expected "2014-08-15T19:18:45+00:00" from \
39
+ times.astronomical_twilight_end_dt.to_s ' do
40
+ assert_equal('2014-08-15T19:18:45+00:00', \
41
+ times.astronomical_twilight_end_dt.to_s)
42
+ end
43
+
44
+ it 'expected "2014-08-15T04:50:12+00:00" from \
45
+ times.astronomical_twilight_start_dt.to_s ' do
46
+ assert_equal('2014-08-15T04:50:12+00:00', \
47
+ times.astronomical_twilight_start_dt.to_s)
48
+ end
49
+
50
+ it 'expected 2_456_885.3046949888 from \
51
+ times.astronomical_twilight_end_jd ' do
52
+ assert_equal(2_456_885.3046949888, \
53
+ times.astronomical_twilight_end_jd)
54
+ end
55
+
56
+ it 'expected 2_456_884.701532429 from \
57
+ times.astronomical_twilight_start_jd ' do
58
+ assert_equal(2_456_884.701532429, \
59
+ times.astronomical_twilight_start_jd)
60
+ end
61
+
62
+ it 'expected "2014-08-15T18:29:13+00:00" from \
63
+ times.civil_twilight_end_dt.to_s ' do
64
+ assert_equal('2014-08-15T18:29:13+00:00', \
65
+ times.civil_twilight_end_dt.to_s)
66
+ end
67
+
68
+ it 'expected "2014-08-15T05:39:44+00:00" from \
69
+ times.civil_twilight_start_dt.to_s ' do
70
+ assert_equal('2014-08-15T05:39:44+00:00', \
71
+ times.civil_twilight_start_dt.to_s)
72
+ end
73
+
74
+ it 'expected 2_456_885.270291137 from times.civil_twilight_end_jd() ' do
75
+ assert_equal(2_456_885.270291137, times.civil_twilight_end_jd)
76
+ end
77
+
78
+ it 'expected 2_456_884.735936281 from \
79
+ times.civil_twilight_start_jd() ' do
80
+ assert_equal(2_456_884.735936281, times.civil_twilight_start_jd)
81
+ end
82
+
83
+ it 'expected -0.003113709117457967 from times.eot_jd() ' do
84
+ assert_equal(-0.003113709117457967, times.eot_jd)
85
+ end
86
+
87
+ it 'expected "2014-08-15T12:04:29+00:00" \
88
+ from times.local_noon_dt().to_s ' do
89
+ assert_equal '2014-08-15T12:04:29+00:00', times.local_noon_dt.to_s
90
+ end
91
+
92
+ it 'expected "2014-08-15T18:53:58+00:00" from \
93
+ times.nautical_twilight_end_dt.to_s ' do
94
+ assert_equal('2014-08-15T18:53:58+00:00', \
95
+ times.nautical_twilight_end_dt.to_s)
96
+ end
97
+
98
+ it 'expected "2014-08-15T05:14:59+00:00" from \
99
+ times.nautical_twilight_start_dt.to_s ' do
100
+ assert_equal('2014-08-15T05:14:59+00:00', \
101
+ times.nautical_twilight_start_dt.to_s)
102
+ end
103
+
104
+ it 'expected 2_456_885.2874805206 from \
105
+ times.nautical_twilight_end_jd ' do
106
+ assert_equal(2_456_885.2874805206, \
107
+ times.nautical_twilight_end_jd)
108
+ end
109
+
110
+ it 'expected 2_456_884.7187468973 from \
111
+ times.nautical_twilight_start_jd ' do
112
+ assert_equal(2_456_884.7187468973, \
113
+ times.nautical_twilight_start_jd)
114
+ end
115
+
116
+ it 'expected "2014-08-15T06:01:02+00:00" from times.sunrise_dt() ' do
117
+ assert_equal '2014-08-15T06:01:02+00:00', times.sunrise_dt.to_s
118
+ end
119
+
120
+ it 'expected "2014-08-15T18:07:55+00:00" from times.sunset_dt() ' do
121
+ assert_equal '2014-08-15T18:07:55+00:00', times.sunset_dt.to_s
122
+ end
123
+
124
+ it 'expected 2_456_884.7507283166 from times.sunrise_jd() ' do
125
+ assert_equal(2_456_884.7507283166, times.sunrise_jd)
126
+ end
127
+
128
+ it 'expected 2_456_885.2554991012 from times.sunset_jd() ' do
129
+ assert_equal(2_456_885.2554991012, times.sunset_jd)
130
+ end
131
+
132
+ it 'expected -9.37789671342477 from times.time_delta_oblique() ' do
133
+ assert_equal(-9.37789671342477, times.time_delta_oblique)
134
+ end
135
+
136
+ it 'expected 4.894155584285298 from times.time_delta_orbit() ' do
137
+ assert_equal(4.894155584285298, times.time_delta_orbit)
138
+ end
139
+
140
+ it 'expected -4.483741129139473 from times.time_eot() ' do
141
+ assert_equal(-4.483741129139473, times.time_eot)
142
+ end
143
+
144
+ end
145
+
146
+ describe 'tests ajd of 2455055.0 ' do
147
+
148
+ before(:each) do
149
+ times.ajd = 2_455_055.0
150
+ ajd = times.ajd
151
+ times.ma_ta_set
152
+ # check date for this ajd when needed.
153
+ times.date = times.ajd_to_datetime(ajd)
154
+ end
155
+
156
+ it 'expected 2_455_055.0, from times. ' do
157
+ assert_equal(2_455_055.0, times.ajd)
158
+ end
159
+
160
+ it 'expected "2009-08-11T12:00:00+00:00" from times.date.to_s ' do
161
+ assert_equal '2009-08-11T12:00:00+00:00', times.date.to_s
162
+ end
163
+
164
+ it 'expected 3.7871218188949207 from times. ' do
165
+ assert_equal(3.7871218188949207, times.ma)
166
+ end
167
+
168
+ it 'expected "2009-08-11T12:00:00+00:00" from \
169
+ times.ajd_to_datetime(times.ajd).to_s ' do
170
+ assert_equal '2009-08-11T12:00:00+00:00', \
171
+ times.ajd_to_datetime(times.ajd).to_s
172
+ end
173
+
174
+ it 'expected -0.003584007074372416 from times.eot_jd() ' do
175
+ assert_equal(-0.003584007074372416, times.eot_jd)
176
+ end
177
+
178
+ it 'expected "2009-08-11T06:01:42+00:00" \
179
+ from times.sunrise_dt().to_s ' do
180
+ assert_equal '2009-08-11T06:01:42+00:00', times.sunrise_dt.to_s
181
+ end
182
+
183
+ it 'expected 2_455_054.75118603 from times.sunrise_jd()' do
184
+ assert_equal(2_455_054.75118603, times.sunrise_jd)
185
+ end
186
+
187
+ it 'expected "2009-08-11T18:08:36+00:00" from times.sunset_dt() ' do
188
+ assert_equal '2009-08-11T18:08:36+00:00', times.sunset_dt.to_s
189
+ end
190
+
191
+ it 'expected 2_455_055.2559819845 from times.sunset_jd() ' do
192
+ assert_equal(2_455_055.2559819845, times.sunset_jd)
193
+ end
194
+
195
+ it 'expected -5.160970187096279 is from times.time_eot() ' do
196
+ assert_equal(-5.160970187096279, times.time_eot)
197
+ end
198
+
199
+ end
data/wiki.md CHANGED
@@ -2,11 +2,11 @@ Wiki 2:
2
2
 
3
3
  $ irb --simple-prompt
4
4
 
5
- require 'eot'
5
+ require 'eot'
6
6
  eot = Eot.new()
7
7
  loop do
8
8
  puts "#{Time.now} #{eot.show_minutes(eot.now)}"
9
- sleep 11
9
+ sleep 11
10
10
  end
11
11
 
12
12
  Wiki 3:
@@ -15,8 +15,9 @@ Wiki 3:
15
15
  require 'eot';eot = Eot.new()
16
16
  # set the coordinates manually
17
17
  eot.latitude = latitude; eot.longitude = longitude; eot.ajd = Date.parse(date).jd
18
+ eot.ma_ta_set
18
19
  eot.sunrise_dt().to_time
19
- eot.sunset_dt().to_time
20
+ eot.sunset_dt().to_time
20
21
 
21
22
  Wiki 4:
22
23
 
metadata CHANGED
@@ -1,85 +1,85 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: equationoftime
3
3
  version: !ruby/object:Gem::Version
4
- version: 4.1.7
4
+ version: 4.1.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - DouglasAllen
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-11-09 00:00:00.000000000 Z
11
+ date: 2014-11-13 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
- name: bundler
14
+ name: addressable
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
17
  - - ~>
18
18
  - !ruby/object:Gem::Version
19
- version: '1.7'
20
- type: :development
19
+ version: 2.3.6
20
+ type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - ~>
25
25
  - !ruby/object:Gem::Version
26
- version: '1.7'
26
+ version: 2.3.6
27
27
  - !ruby/object:Gem::Dependency
28
- name: rake
28
+ name: rest-client
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
- - - ~>
31
+ - - ! '>='
32
32
  - !ruby/object:Gem::Version
33
- version: '10.0'
34
- type: :development
33
+ version: '0'
34
+ type: :runtime
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
- - - ~>
38
+ - - ! '>='
39
39
  - !ruby/object:Gem::Version
40
- version: '10.0'
40
+ version: '0'
41
41
  - !ruby/object:Gem::Dependency
42
- name: addressable
42
+ name: celes
43
43
  requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
45
  - - ~>
46
46
  - !ruby/object:Gem::Version
47
- version: 2.3.6
47
+ version: 0.0.1
48
48
  type: :runtime
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
52
  - - ~>
53
53
  - !ruby/object:Gem::Version
54
- version: 2.3.6
54
+ version: 0.0.1
55
55
  - !ruby/object:Gem::Dependency
56
- name: celes
56
+ name: bundler
57
57
  requirement: !ruby/object:Gem::Requirement
58
58
  requirements:
59
59
  - - ~>
60
60
  - !ruby/object:Gem::Version
61
- version: 0.0.1
62
- type: :runtime
61
+ version: '1.7'
62
+ type: :development
63
63
  prerelease: false
64
64
  version_requirements: !ruby/object:Gem::Requirement
65
65
  requirements:
66
66
  - - ~>
67
67
  - !ruby/object:Gem::Version
68
- version: 0.0.1
68
+ version: '1.7'
69
69
  - !ruby/object:Gem::Dependency
70
- name: rest-client
70
+ name: rake
71
71
  requirement: !ruby/object:Gem::Requirement
72
72
  requirements:
73
- - - ! '>='
73
+ - - ~>
74
74
  - !ruby/object:Gem::Version
75
- version: '0'
76
- type: :runtime
75
+ version: '10.0'
76
+ type: :development
77
77
  prerelease: false
78
78
  version_requirements: !ruby/object:Gem::Requirement
79
79
  requirements:
80
- - - ! '>='
80
+ - - ~>
81
81
  - !ruby/object:Gem::Version
82
- version: '0'
82
+ version: '10.0'
83
83
  description: ! "Calculate Sunrise and Sunset. Uses native C wrappers.\n Use
84
84
  the patch \"gem install eot\" to install it."
85
85
  email:
@@ -96,9 +96,10 @@ files:
96
96
  - .project
97
97
  - .rspec
98
98
  - .ruby-version
99
+ - .settings/org.eclipse.ltk.core.refactoring.prefs
100
+ - .travis.yml
99
101
  - CHANGELOG.rdoc
100
102
  - Gemfile
101
- - Gemfile.lock
102
103
  - Guardfile
103
104
  - LICENSE.rdoc
104
105
  - LICENSE.txt
@@ -106,16 +107,29 @@ files:
106
107
  - README.rdoc
107
108
  - Rakefile
108
109
  - equationoftime.gemspec
110
+ - examples/Equation_of_Time.png
111
+ - examples/cal2jd.rb
112
+ - examples/celes_formatters.rb
113
+ - examples/eot_from_noon.rb
114
+ - examples/eot_methods_list.rb
115
+ - examples/my_lst.rb
116
+ - examples/radians2degformated.rb
117
+ - examples/t_sofa.rb
118
+ - examples/test_eot_c.rb
119
+ - examples/use_addr.rb
120
+ - examples/use_ajd.rb
109
121
  - ext/eot/ceot.c
110
122
  - ext/eot/ceot.h
111
123
  - ext/eot/eot.c
112
124
  - ext/eot/extconf.rb
113
125
  - lib/eot.rb
126
+ - lib/eot/all.rb
114
127
  - lib/eot/angle_displays.rb
115
128
  - lib/eot/angles.rb
116
129
  - lib/eot/constants.rb
117
130
  - lib/eot/delta_times.rb
118
131
  - lib/eot/deltas.rb
132
+ - lib/eot/eot.so
119
133
  - lib/eot/geo_lat_lng_smt.rb
120
134
  - lib/eot/init.rb
121
135
  - lib/eot/jd_times.rb
@@ -125,6 +139,15 @@ files:
125
139
  - lib/eot/utilities.rb
126
140
  - lib/eot/version.rb
127
141
  - run_tests_eclipse.rb
142
+ - test/eot/aliased_angles_spec.rb
143
+ - test/eot/aliased_displays_spec.rb
144
+ - test/eot/aliased_utilities_spec.rb
145
+ - test/eot/angles_spec.rb
146
+ - test/eot/constants_spec.rb
147
+ - test/eot/displays_spec.rb
148
+ - test/eot/geo_spec.rb
149
+ - test/eot/init_spec.rb
150
+ - test/eot/times_spec.rb
128
151
  - wiki.md
129
152
  - wiki2.md
130
153
  homepage: https://github.com/DouglasAllen/equationoftime
@@ -132,7 +155,10 @@ licenses:
132
155
  - MIT
133
156
  metadata: {}
134
157
  post_install_message:
135
- rdoc_options: []
158
+ rdoc_options:
159
+ - --title
160
+ - Equation of Time -- Solar Position Calculator in Ruby
161
+ - --line-numbers
136
162
  require_paths:
137
163
  - lib
138
164
  required_ruby_version: !ruby/object:Gem::Requirement
@@ -151,5 +177,14 @@ rubygems_version: 2.4.2
151
177
  signing_key:
152
178
  specification_version: 4
153
179
  summary: Equation of Time calculates time of solar transition.
154
- test_files: []
155
- has_rdoc:
180
+ test_files:
181
+ - test/eot/aliased_angles_spec.rb
182
+ - test/eot/aliased_displays_spec.rb
183
+ - test/eot/aliased_utilities_spec.rb
184
+ - test/eot/angles_spec.rb
185
+ - test/eot/constants_spec.rb
186
+ - test/eot/displays_spec.rb
187
+ - test/eot/geo_spec.rb
188
+ - test/eot/init_spec.rb
189
+ - test/eot/times_spec.rb
190
+ has_rdoc: true