rozi 0.0.6 → 0.0.7

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
2
  SHA1:
3
- metadata.gz: 084e9f5e296034022e164a34b9527233fd125776
4
- data.tar.gz: 6a6da8b6b1b2e32c9476cea3bd2f672c58980b7b
3
+ metadata.gz: c93dcf8497a215662be35fca8e1ac25cf25ece14
4
+ data.tar.gz: 1ef88c98d7b713704efc6799b6abc1e8ad74b0df
5
5
  SHA512:
6
- metadata.gz: 7d477e68fdc5749b65fd2ef9a93a9672973aa1ba1721b4b4b1f33e6dcf657fdf1671a955b455bcd58964eb1cb89701d046d8eac8abd879ac45bf0c4f15d4ff2c
7
- data.tar.gz: 4c743f8a93ba2bb786c1235b370fee51fb8ef04d545439ba308e76e9b9e7fef137194879fc133c9541db623e8cae0fb47c8af0ecb7da25f3b8bfd8b3222f5b18
6
+ metadata.gz: 838874d53cd4e1390539cd9fad0e60b1ec900b3878942edc330b1b5ab139d81d71939f50169b6e3dac97ce0e5fa02620e9a0bf6dde288efc617d1cf64c4dea46
7
+ data.tar.gz: f4081e83c5162bc94c2e35d1adad3719bda1e54664a1c7a117550955aa6e0c424fb984ad5c7496c5631acc922f5bd66877e781920efc627eca60927415c9d068
data/README.rdoc CHANGED
@@ -54,7 +54,9 @@ Example:
54
54
 
55
55
  Rozi.write_waypoints(waypoints, "file_path.wpt")
56
56
 
57
- See {Rozi::Waypoint} for a list of attributes.
57
+ Every aspect of the waypoint can be customized on the {Rozi::Waypoint} instance
58
+ (display format, symbol, background- and foreground colors, description, font
59
+ size etc.)
58
60
 
59
61
  == Creating Track files.
60
62
 
@@ -73,6 +75,9 @@ Example:
73
75
 
74
76
  Rozi.write_track(track, "file_path.plt")
75
77
 
78
+ Both {Rozi::Track} and {Rozi::TrackPoint} has lots of customizable attributes to
79
+ change the appearance of the track.
80
+
76
81
  == Creating NST files.
77
82
 
78
83
  See {Ozi Explorer: Name
@@ -117,3 +122,6 @@ Example using UTM with the "Norsk" datum:
117
122
 
118
123
  Rozi.write_nst(nst, "file_path.nst")
119
124
 
125
+ Note, text in name search files (names and feature codes) cannot contain
126
+ commas. There is no mechanism for escaping commas or substituting them with
127
+ different symbols like in waypoint files.
data/lib/rozi.rb CHANGED
@@ -7,14 +7,14 @@ module Rozi
7
7
  # Loads all ruby files under lib/rozi. Called automatically when requiring
8
8
  # "rozi.rb".
9
9
  #
10
- def self.load_lib
10
+ def self.require_lib!
11
11
  this_dir = File.absolute_path(File.dirname(__FILE__))
12
12
  source_files = Dir[File.join(this_dir, "rozi/**/*.rb")]
13
13
 
14
14
  source_files.each { |file|
15
- load(file)
15
+ require_relative file
16
16
  }
17
17
  end
18
18
  end
19
19
 
20
- Rozi.load_lib()
20
+ Rozi.require_lib!()
@@ -21,7 +21,10 @@ module Rozi
21
21
  #
22
22
  def open_file_for_writing(path)
23
23
  file = File.open(path, "w")
24
- file.set_encoding("ISO-8859-1", "UTF-8", crlf_newline: true)
24
+ file.set_encoding(
25
+ "ISO-8859-1", "UTF-8",
26
+ crlf_newline: true, undef: :replace, replace: "?"
27
+ )
25
28
 
26
29
  if block_given?
27
30
  yield file
@@ -1,4 +1,6 @@
1
1
 
2
+ require "rozi/ozi_functions"
3
+
2
4
  module Rozi
3
5
 
4
6
  ##
@@ -4,6 +4,10 @@ module Rozi
4
4
  ##
5
5
  # A class for writing {Rozi::NameSearchText} objects to files.
6
6
  #
7
+ # @note Text in name search files (names and feature codes) cannot contain
8
+ # commas. There is no mechanism for escaping commas or substituting them
9
+ # with different symbols like in waypoint files.
10
+ #
7
11
  class NameSearchTextWriter
8
12
 
9
13
  ##
@@ -53,7 +57,11 @@ module Rozi
53
57
 
54
58
  def name_to_line(name)
55
59
  if not name.name or not name.lat or not name.lng
56
- raise "name, lat and lng must be set!"
60
+ fail "name, lat and lng must be set!"
61
+ end
62
+
63
+ if name.name.include?(",") or name.feature_code.include?(",")
64
+ fail ArgumentError, "Text cannot contain commas"
57
65
  end
58
66
 
59
67
  "#{name.name},#{name.feature_code},#{name.zone},#{name.lat},#{name.lng}"
data/lib/rozi/track.rb CHANGED
@@ -1,4 +1,6 @@
1
1
 
2
+ require "rozi/ozi_functions"
3
+
2
4
  module Rozi
3
5
 
4
6
  ##
data/lib/rozi/version.rb CHANGED
@@ -1,4 +1,4 @@
1
1
 
2
2
  module Rozi
3
- VERSION = "0.0.6"
3
+ VERSION = "0.0.7"
4
4
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rozi
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.6
4
+ version: 0.0.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tomas Sandven
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-09-18 00:00:00.000000000 Z
11
+ date: 2014-11-07 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: A gem for working with several Ozi Explorer file formats
14
14
  email: tomas191191@gmail.com
@@ -76,4 +76,3 @@ test_files:
76
76
  - test/rozi/track_point_test.rb
77
77
  - test/rozi/name_search_text_test.rb
78
78
  - test/rozi/waypoint_writer_test.rb
79
- has_rdoc: