glug 0.0.3 → 0.0.4
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 +4 -4
- data/lib/glug.rb +9 -2
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f31f80c7aff2ed19ae265806fcdd335481c9a499
|
4
|
+
data.tar.gz: c7e0077ef04f37c3efef47574cc39432e25672ae
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 033c50d05dfbbdc53fe38d38f4dbb4c5bea6a334abcf468821a41b5487c8bffd9e78294204aa509f163d2966cde6841103f468391163a637ad11b2a06d834421
|
7
|
+
data.tar.gz: 3808af2c1e2de6a7120b9e2a834304749ddf4017f90a6a0b9a54b732a74ab17a2b457de04de329f838bf70333d7211a55b77bc05b41fbad15d2379ad6883c458
|
data/lib/glug.rb
CHANGED
@@ -92,7 +92,8 @@ module Glug # :nodoc:
|
|
92
92
|
# Assemble into Mapbox GL JSON format
|
93
93
|
def to_hash
|
94
94
|
out = @kv.dup
|
95
|
-
out['sources'] = @sources
|
95
|
+
out['sources'] = @sources.dup
|
96
|
+
out['sources'].each { |k,v| p k; p v; v.delete(:default); out['sources'][k] = v }
|
96
97
|
out['layers'] = @layers.select { |r| r.write? }.collect { |r| r.to_hash }.compact
|
97
98
|
out
|
98
99
|
end
|
@@ -317,7 +318,13 @@ module Glug # :nodoc:
|
|
317
318
|
stylesheet.refs[mk] = hash['id']
|
318
319
|
end
|
319
320
|
|
320
|
-
hash[:layout].empty? && hash[:paint].empty?
|
321
|
+
if hash[:layout].empty? && hash[:paint].empty?
|
322
|
+
nil
|
323
|
+
else
|
324
|
+
hash.delete(:layout) if hash[:layout].empty?
|
325
|
+
hash.delete(:paint) if hash[:paint].empty?
|
326
|
+
hash
|
327
|
+
end
|
321
328
|
end
|
322
329
|
|
323
330
|
# Key to identify matching layer properties (slow but...)
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: glug
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Richard Fairhurst
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-
|
11
|
+
date: 2018-05-15 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: neatjson
|