natour 0.8.0 → 0.9.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.adoc +15 -0
- data/README.adoc +1 -0
- data/bin/natour +6 -3
- data/lib/natour/asciinurse.rb +16 -7
- data/lib/natour/data/js/loader.js +6 -6
- data/lib/natour/map_geo_admin.rb +64 -49
- data/lib/natour/version.rb +1 -1
- 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: 59d15bbec4750fd92158c6cbff64a201bad92792600a03a0f430e0c77ddcbea0
|
4
|
+
data.tar.gz: 1b6dedc5f83f66173d77a176d2d20815b4055e2b93c98ecd6d6b26117219c03f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7dd61ac963164d480e626414bef161e1f1a702d26a2ff71e733a796610b18b7942a5f6ce400329a7c9b3f0566ea501d20f7926285d923d85a4eda4835331f14f
|
7
|
+
data.tar.gz: 1ad29625fc06e4f738c7e7127d3381aa701ec033618c9d2a5c1b7167b56b1890f3ba4c8035a8bfe4f6dba33ddf5a3d6b842f0650a1da22c19b04b149c51c5977
|
data/CHANGELOG.adoc
CHANGED
@@ -6,6 +6,21 @@ The format is based on https://keepachangelog.com/en/1.0.0/[Keep a Changelog^],
|
|
6
6
|
|
7
7
|
== Unreleased
|
8
8
|
|
9
|
+
== 0.9.0 - 2022-10-08
|
10
|
+
|
11
|
+
=== Added
|
12
|
+
|
13
|
+
- Support colors for GPS tracks, waypoints and routes (`natour map create` command only).
|
14
|
+
|
15
|
+
=== Changed
|
16
|
+
|
17
|
+
- Omit empty columns of species lists in AsciiDoc output.
|
18
|
+
|
19
|
+
=== Fixed
|
20
|
+
|
21
|
+
- Fix inconsistent handling of file errors in the command line interface.
|
22
|
+
- Fix the creation of map images.
|
23
|
+
|
9
24
|
== 0.8.0 - 2022-04-22
|
10
25
|
|
11
26
|
=== Added
|
data/README.adoc
CHANGED
data/bin/natour
CHANGED
@@ -35,7 +35,7 @@ class NatourCmd < Clamp::Command
|
|
35
35
|
map_layers: map_layers || config[:map_layers],
|
36
36
|
adoc_author: adoc_author || config[:adoc_author]
|
37
37
|
)
|
38
|
-
rescue Errno::EEXIST, Errno::ENOENT, Errno::EACCES, Errno::EINVAL => e
|
38
|
+
rescue Errno::EEXIST, Errno::ENOENT, Errno::EACCES, Errno::EISDIR, Errno::EINVAL => e
|
39
39
|
message, _, path = Natour::ErrnoUtils.split_message(e)
|
40
40
|
abort("ERROR: #{message} '#{path}'")
|
41
41
|
end
|
@@ -66,7 +66,7 @@ class NatourCmd < Clamp::Command
|
|
66
66
|
draft_backend: draft_backend || config[:draft_backend],
|
67
67
|
image_maxdim: image_maxdim || config[:image_maxdim]
|
68
68
|
)
|
69
|
-
rescue Errno::EEXIST, Errno::ENOENT, Errno::EACCES, Errno::EISDIR => e
|
69
|
+
rescue Errno::EEXIST, Errno::ENOENT, Errno::EACCES, Errno::EISDIR, Errno::EINVAL => e
|
70
70
|
message, _, path = Natour::ErrnoUtils.split_message(e)
|
71
71
|
abort("ERROR: #{message} '#{path}'")
|
72
72
|
end
|
@@ -86,6 +86,7 @@ class NatourCmd < Clamp::Command
|
|
86
86
|
option(%w[-d --out-dir], 'DIR', 'Output directory')
|
87
87
|
option(%w[-f --out-file], 'FILE', 'Output filename')
|
88
88
|
option(%W[--\[no-\]overwrite], :flag, 'Overwrite existing files')
|
89
|
+
option(%w[--gps-colors], 'COLORS', 'Colors for elements from GPS files') { |s| s.split(',') }
|
89
90
|
option(%w[--map-layers], 'LAYERS', 'Add additional layers to map images') { |s| s.split(',') }
|
90
91
|
option(%w[--image-size], 'WIDTH,HEIGHT', 'Image size') do |s|
|
91
92
|
s.split(',', 2).map { |v| Integer(v) }
|
@@ -101,11 +102,12 @@ class NatourCmd < Clamp::Command
|
|
101
102
|
filename,
|
102
103
|
overwrite: Natour::BooleanUtils.to_boolean(overwrite?, default_value: config[:overwrite]),
|
103
104
|
gps_files: paths,
|
105
|
+
gps_colors: gps_colors || config[:gps_colors],
|
104
106
|
map_layers: map_layers || config[:map_layers],
|
105
107
|
image_size: image_size || config[:image_size]
|
106
108
|
)
|
107
109
|
end
|
108
|
-
rescue Errno::EEXIST, Errno::ENOENT, Errno::EACCES => e
|
110
|
+
rescue Errno::EEXIST, Errno::ENOENT, Errno::EACCES, Errno::EISDIR, Errno::EINVAL => e
|
109
111
|
message, _, path = Natour::ErrnoUtils.split_message(e)
|
110
112
|
abort("ERROR: #{message} '#{path}'")
|
111
113
|
end
|
@@ -151,6 +153,7 @@ config = Natour::Config.load_file(
|
|
151
153
|
out_dir: nil,
|
152
154
|
out_file: nil,
|
153
155
|
overwrite: false,
|
156
|
+
gps_colors: [],
|
154
157
|
map_layers: [],
|
155
158
|
image_size: [1200, 900]
|
156
159
|
}
|
data/lib/natour/asciinurse.rb
CHANGED
@@ -97,14 +97,18 @@ module Natour
|
|
97
97
|
OpenStruct.new(
|
98
98
|
group: :plants,
|
99
99
|
title: 'Pflanzenarten',
|
100
|
-
|
101
|
-
|
100
|
+
columns: [
|
101
|
+
OpenStruct.new(header: 'Wissenschaftlicher Name', accessor: :name),
|
102
|
+
OpenStruct.new(header: 'Deutscher Name', accessor: :name_de)
|
103
|
+
]
|
102
104
|
),
|
103
105
|
OpenStruct.new(
|
104
106
|
group: :birds,
|
105
107
|
title: 'Vogelarten',
|
106
|
-
|
107
|
-
|
108
|
+
columns: [
|
109
|
+
OpenStruct.new(header: 'Deutscher Name', accessor: :name_de),
|
110
|
+
OpenStruct.new(header: 'Wissenschaftlicher Name', accessor: :name)
|
111
|
+
]
|
108
112
|
)
|
109
113
|
].each do |info|
|
110
114
|
group = groups.fetch(info.group, [])
|
@@ -115,13 +119,18 @@ module Natour
|
|
115
119
|
group.each do |species_list|
|
116
120
|
caption = '.Tabelle {counter:species_lists}'
|
117
121
|
caption << ": #{species_list.description}" if species_list.description
|
122
|
+
columns = info.columns.select do |column|
|
123
|
+
species_list.any? { |species| !species.public_send(column.accessor).nil? }
|
124
|
+
end
|
125
|
+
cols = [1] + [5 * info.columns.size / columns.size] * columns.size
|
118
126
|
doc << caption
|
119
|
-
doc <<
|
127
|
+
doc << "[cols=\"#{cols.join(',')}\",options=header]"
|
120
128
|
doc << '|==='
|
121
|
-
doc << "|Nr.|#{
|
129
|
+
doc << "|Nr.|#{columns.map(&:header).join('|')}"
|
122
130
|
species_list.each do |species|
|
123
131
|
doc <<
|
124
|
-
"|{counter:species_list#{index}}|#{
|
132
|
+
"|{counter:species_list#{index}}|#{columns.map { |column| species.public_send(column.accessor) }
|
133
|
+
.join('|')}"
|
125
134
|
end
|
126
135
|
doc << '|==='
|
127
136
|
doc << ''
|