geospatial 1.1.2 → 1.1.3

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: c33ebcfa6ce57ecf40849207cad45923cd05798c
4
- data.tar.gz: 4544dd721796c69545d912d366c1d2decb4ed86a
3
+ metadata.gz: 8ee2c24c3dbccd264f68b61b60ac34e96a6fa7c1
4
+ data.tar.gz: 9b08372743682db4ec05e6b4d7e27913ab0d5f87
5
5
  SHA512:
6
- metadata.gz: e66b9c99f255792077ef4fd7721c34ade15e059d1f5af0a06db9406fba8e794d447d0703a7eae8e8b81aa9b0e60a6feff914e6abaea71dd129f305111d729c6a
7
- data.tar.gz: c668a129d0e1131d622015e759ac7e03703869d8b6aa8a0c920e9e7b9ca1e5262b3d2533c91d88868d71978c5a03a9ea4e1363daef9c289506eaf693f8a6be53
6
+ metadata.gz: c0c6c0d19786014b9f6cb5da18e31a2c00c4248240326e1b1a28870e6b80a0f903ad75781a0b2553ed7c1420bd1590db43fb9fb1124ce8fcc335763ef77509ba
7
+ data.tar.gz: aafcf7bfeb1171e973f86844ae8d87a8f94104f94cbe733bb0762890aa1c59aa205260a984e4e0cf54b55f6a963e2b401cd5eb6b53416c2eb49259bbaef7cbe1
@@ -83,7 +83,7 @@ module Geospatial
83
83
  end
84
84
 
85
85
  def to_s
86
- "#{self.class}#{self.to_a.inspect}"
86
+ "#{self.class}[#{self.longitude.to_f}, #{self.latitude.to_f}]"
87
87
  end
88
88
 
89
89
  alias inspect to_s
@@ -19,5 +19,5 @@
19
19
  # THE SOFTWARE.
20
20
 
21
21
  module Geospatial
22
- VERSION = "1.1.2"
22
+ VERSION = "1.1.3"
23
23
  end
@@ -20,17 +20,23 @@
20
20
 
21
21
  require 'geospatial/location'
22
22
 
23
- module Geospatial::LocationSpec
24
- describe Geospatial::Location do
25
- let(:lake_tekapo) {Geospatial::Location.new(170.53, -43.89)}
26
- let(:lake_alex) {Geospatial::Location.new(170.45, -43.94)}
27
-
28
- it "compute the correct distance between two points" do
29
- expect(lake_alex.distance_from(lake_tekapo)).to be_within(100).of(8_500)
30
- end
31
-
32
- it "should format nicely" do
33
- expect("#{lake_alex}").to be == "Geospatial::Location[170.45, -43.94]"
34
- end
23
+ RSpec.describe Geospatial::Location do
24
+ let(:lake_tekapo) {Geospatial::Location.new(170.53, -43.89)}
25
+ let(:lake_alex) {Geospatial::Location.new(170.45, -43.94)}
26
+
27
+ it "compute the correct distance between two points" do
28
+ expect(lake_alex.distance_from(lake_tekapo)).to be_within(100).of(8_500)
29
+ end
30
+
31
+ it "should format nicely" do
32
+ expect("#{lake_alex}").to be == "Geospatial::Location[170.45, -43.94]"
35
33
  end
36
34
  end
35
+
36
+ require 'bigdecimal'
37
+
38
+ RSpec.describe Geospatial::Location[BigDecimal.new("170.45"), BigDecimal.new("-43.94")] do
39
+ it "should format nicely" do
40
+ expect("#{subject}").to be == "Geospatial::Location[170.45, -43.94]"
41
+ end
42
+ end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: geospatial
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.2
4
+ version: 1.1.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Samuel Williams