geo_units 0.3.1 → 0.3.1.1

Sign up to get free protection for your applications and to get access to all the features.
data/Rakefile CHANGED
@@ -32,13 +32,3 @@ RSpec::Core::RakeTask.new(:spec) do |spec|
32
32
  end
33
33
 
34
34
  task :default => :spec
35
-
36
- require 'rake/rdoctask'
37
- Rake::RDocTask.new do |rdoc|
38
- version = File.exist?('VERSION') ? File.read('VERSION') : ""
39
-
40
- rdoc.rdoc_dir = 'rdoc'
41
- rdoc.title = "geo_units #{version}"
42
- rdoc.rdoc_files.include('README*')
43
- rdoc.rdoc_files.include('lib/**/*.rb')
44
- end
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.3.1
1
+ 0.3.1.1
data/geo_units.gemspec CHANGED
@@ -5,7 +5,7 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = "geo_units"
8
- s.version = "0.3.1"
8
+ s.version = "0.3.1.1"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Kristian Mandrup"]
@@ -6,11 +6,13 @@ module GeoUnits
6
6
  module Dms
7
7
  include NumericCheckExt
8
8
 
9
+ class ParseError < StandardError; end
10
+
9
11
  def parse_dms dms_str, options= {}
10
12
  # check for signed decimal degrees without NSEW, if so return it directly
11
13
  return dms_str if is_numeric?(dms_str)
12
14
 
13
- raise "DMS parse error: #{dms_str}" if !(dms_str =~ /[NSEW]$/) || (dms_str =~ /\./)
15
+ raise ParseError, "DMS parse error: #{dms_str}" if !(dms_str =~ /[NSEW]$/) || (dms_str =~ /\./)
14
16
 
15
17
  # strip off any sign or compass dir'n & split out separate d/m/s
16
18
  dms = dms_str.strip.gsub(/^-/,'').gsub(/[NSEW]$/i,'').split(/[^0-9.,]+/).map(&:strip).map(&:to_f)
@@ -32,7 +34,7 @@ module GeoUnits
32
34
  nil
33
35
  end
34
36
 
35
- raise "DMS parse error: #{deg} for #{dms_str}" if !deg
37
+ raise ParseError, "DMS parse error: #{deg} for #{dms_str}" if !deg
36
38
 
37
39
  deg = (deg * -1) if (/^-|[WS]$/i.match(dms_str.strip)) # take '-', west and south as -ve
38
40
  deg.to_f
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: geo_units
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.1
4
+ version: 0.3.1.1
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -181,7 +181,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
181
181
  version: '0'
182
182
  segments:
183
183
  - 0
184
- hash: 4502680806644763495
184
+ hash: 3331028762583632085
185
185
  required_rubygems_version: !ruby/object:Gem::Requirement
186
186
  none: false
187
187
  requirements: