astropanel 2.5 → 2.6
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 +4 -4
- data/bin/astropanel +23 -17
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 939fa439565527c2c8b9f0ce4e1e13ab008bd3c23f153efd9e2e01d65a50fe45
|
4
|
+
data.tar.gz: 368bbb21a445bfff885cbf6a9b1f526fe11531cdb9be1ad0ad02760ca5818416
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f393f7af8500905358502ef1a78b1e9c3808e883f8febc21bec01f84221b101fd00a305a5e7c6d522baf1fcf1343e9f9c42765fc542e2b673d925739880fa272
|
7
|
+
data.tar.gz: dd1447a1e2c3cc56f4e4d30e5284d0ceef71bc45e2dae203017b054789e4c3bbcb6ef826a682751bb39198a543c26203b03088571765ede52211e1fc1b5c5148
|
data/bin/astropanel
CHANGED
@@ -14,7 +14,7 @@
|
|
14
14
|
# for any damages resulting from its use. Further, I am under no
|
15
15
|
# obligation to maintain or extend this software. It is provided
|
16
16
|
# on an 'as is' basis without any expressed or implied warranty.
|
17
|
-
# Version: 2.
|
17
|
+
# Version: 2.6: Bug fix
|
18
18
|
|
19
19
|
# LOAD MODULES {{{1
|
20
20
|
require 'io/console'
|
@@ -760,10 +760,7 @@ class AstroPanelApp
|
|
760
760
|
@footer.say(cmds.ljust(cols))
|
761
761
|
end
|
762
762
|
|
763
|
-
|
764
|
-
# Redraw the left‐pane list of weather + visibility blocks,
|
765
|
-
# safely handling missing planet data and converting rise/set to integers
|
766
|
-
def update_left
|
763
|
+
def update_left # {{{2
|
767
764
|
date_o = ''
|
768
765
|
date_n = ''
|
769
766
|
|
@@ -930,8 +927,8 @@ class AstroPanelApp
|
|
930
927
|
update_main
|
931
928
|
end
|
932
929
|
|
933
|
-
|
934
|
-
|
930
|
+
def get_weather # {{{2
|
931
|
+
# Fetch weather from met.no, but never let network errors crash the app
|
935
932
|
uri = URI("https://api.met.no/weatherapi/locationforecast/2.0/complete?lat=#{@lat}&lon=#{@lon}")
|
936
933
|
req = Net::HTTP::Get.new(uri)
|
937
934
|
req['User-Agent'] = 'astropanel/1.0 g@isene.com'
|
@@ -1014,25 +1011,34 @@ class AstroPanelApp
|
|
1014
1011
|
end
|
1015
1012
|
|
1016
1013
|
def get_planets # {{{2
|
1014
|
+
# Build @planets entries for each unique date in @weather
|
1017
1015
|
@planets.clear
|
1018
|
-
|
1019
|
-
|
1020
|
-
|
1016
|
+
|
1017
|
+
# Collect exactly the dates we need (in first-seen order)
|
1018
|
+
dates = @weather.map { |w| w[:date] }.uniq
|
1019
|
+
|
1020
|
+
dates.each do |date|
|
1021
|
+
# Compute a fresh Ephemeris for that date
|
1022
|
+
ep = Ephemeris.new(date, @lat, @lon, @tz.to_i)
|
1023
|
+
|
1024
|
+
# Start with the printed table + moon phase info
|
1021
1025
|
entry = {
|
1022
1026
|
table: ep.print,
|
1023
|
-
mphase: ep.mphase,
|
1024
|
-
mph_s: ep.mph_s
|
1027
|
+
mphase: ep.mphase,
|
1028
|
+
mph_s: ep.mph_s
|
1025
1029
|
}
|
1026
|
-
|
1027
|
-
|
1028
|
-
|
1029
|
-
|
1030
|
+
|
1031
|
+
# Add rise/set times for each body
|
1032
|
+
Ephemeris::BODY_ORDER.each do |body|
|
1033
|
+
arr = ep.send(body)
|
1034
|
+
entry[:"#{body}_rise"] = arr[5]
|
1035
|
+
entry[:"#{body}_set"] = arr[7]
|
1030
1036
|
end
|
1037
|
+
|
1031
1038
|
@planets[date] = entry
|
1032
1039
|
end
|
1033
1040
|
end
|
1034
1041
|
|
1035
|
-
|
1036
1042
|
def get_events # {{{2
|
1037
1043
|
@events.clear
|
1038
1044
|
uri = URI(
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: astropanel
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: '2.
|
4
|
+
version: '2.6'
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Geir Isene
|
@@ -28,7 +28,7 @@ description: 'This program shows essential data in order to plan your observatio
|
|
28
28
|
9 days weather forecast, full ephemeris for the Sun, the Moon and all major planets,
|
29
29
|
complete with graphic representation of rise/set times, detailed info for each day
|
30
30
|
with important astronomical events, star chart displayed in the terminal and more.
|
31
|
-
New in 2.0: Full rewrite using rcurses (https://github.com/isene/rcurses). 2.
|
31
|
+
New in 2.0: Full rewrite using rcurses (https://github.com/isene/rcurses). 2.6:
|
32
32
|
Bug fix.'
|
33
33
|
email: g@isene.com
|
34
34
|
executables:
|