libgd-gis 0.4.6 → 0.4.7

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.
Files changed (3) hide show
  1. checksums.yaml +4 -4
  2. data/lib/gd/gis/layer_geojson.rb +11 -10
  3. metadata +1 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: f3554f0a9c975f7b1b08d83ed233235e5fd6c1819c8a53bad5ee8f9ad2c47171
4
- data.tar.gz: 6135f85c489fe8e5019d0812bb2c7d4125c850e386d2b422ff55ce6ef70ccc51
3
+ metadata.gz: 845f824374bd07e832f915da01a2c4f0139ceab3836b121397d66f710c83a789
4
+ data.tar.gz: 8eeb1c1abc669c85333bc201875b8e07a5af34803dcae9753875ee12b288895b
5
5
  SHA512:
6
- metadata.gz: 32e87dda7bde5daa819cb12b1712b3a438d7996558b1781631a2bcfa6e8a15e2d92e45a4ff72f2e7c66ce4da30737f827fc648da3fb35c6ab84d0718022ec58c
7
- data.tar.gz: 9cd4fe592fa790a046efa016603b458abb5092f80f52ed2896a9e8d0c69160f3ec44f6a8ecdb42fed7d1d56219bf0cca78ed57ae90b9ff5152abdb456cd807a6
6
+ metadata.gz: 1a7ee52afb255c6da0cee58bcd53f6639a6994cf68e6138c581dd1729d3e382197f5b1ad83916c100774ac6e721ad0f2f88e7c9c6e3419396cdaa7b7252fb8e1
7
+ data.tar.gz: f3bbff63007f3857f556908b553f5fa20a5c7a3da7934f478f1da0a7c967864dd82e597c3388a2ff78a0c2cd647c29d970689b60ebd130af275029431f23c52b
@@ -26,18 +26,19 @@ module GD
26
26
  # @raise [JSON::ParserError] if the file is invalid JSON
27
27
  # @raise [Errno::ENOENT] if the file does not exist
28
28
  def self.load(source)
29
- geojson = case source
30
- when String
31
- if source.strip.start_with?("{", "[")
32
- JSON.parse(source)
29
+
30
+ geojson = case source
31
+ when String
32
+ if source.strip.start_with?("{", "[")
33
+ JSON.parse(source)
34
+ else
35
+ JSON.parse(File.read(source))
36
+ end
37
+ when Hash
38
+ source
33
39
  else
34
- JSON.parse(File.read(source))
40
+ raise ArgumentError, "Unsupported GeoJSON source"
35
41
  end
36
- when Hash
37
- source
38
- else
39
- raise ArgumentError, "Unsupported GeoJSON source"
40
- end
41
42
 
42
43
  # 1) Detect CRS
43
44
  crs_name = data["crs"]&.dig("properties", "name")
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: libgd-gis
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.6
4
+ version: 0.4.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Germán Alberto Giménez Silva