dato-dump 0.1.0 → 0.1.1

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: 6efc5e3740820b43a45c824813d5959e98660eab
4
- data.tar.gz: 299c79004a95820fd0a0084db649266ea7163f3c
3
+ metadata.gz: c0acb3cd3803786090b9daac375842579e4cb8cf
4
+ data.tar.gz: 77aa5c416d8c3ab465d81ff0ed41e45ea957f4e6
5
5
  SHA512:
6
- metadata.gz: f427f47bb2c8abf08161298916ba1860942b2d5c6a2cb2f405b0224fe37507e00e63cc425d21ab78c99d4be29978b416fd00e7e9e4095150ed5a92be8565fc08
7
- data.tar.gz: 57bc833517cc1f94296e572432797bbc23585ea6669aece66d828330318dd8e7361f23a63328e4eb30fafca6b18f8150d809ca3ef8d235150970951b18c2fc1b
6
+ metadata.gz: e585aac8dd071527e24eddd5e31ab16fcd5c8881361b47562f61c9061c90f2cc7894e77b2d240f977cfca2809d93c601826d8f85348dede18b7053611a9b4521
7
+ data.tar.gz: bc58cbe15edd9b97c6ddcf20203e0777f271589e17154c3c82409f1639411c595dc9ccc70ce7926dbe1094b69ec25cbc412dee32a8602b048375970cb944d1ad
@@ -29,7 +29,7 @@ module DatoDump
29
29
  end
30
30
 
31
31
  collections_by_type.each do |key, value|
32
- path = File.join(configuration.destination_path, key + ".yml")
32
+ path = File.join(configuration.destination_path, key + ".json")
33
33
  File.open(path, 'w') do |file|
34
34
  file.write JSON.pretty_generate(value)
35
35
  end
@@ -13,12 +13,19 @@ module DatoDump
13
13
 
14
14
  def dump
15
15
  attributes = { id: record.id }
16
- record.content_type.fields.each do |field|
16
+ content_type = record.content_type
17
+
18
+ content_type.fields.each do |field|
17
19
  attributes[field.api_key] = dump_attribute(
18
20
  record.send(field.api_key),
19
21
  field
20
22
  )
21
23
  end
24
+
25
+ if content_type.sortable
26
+ attributes["position"] = record.position
27
+ end
28
+
22
29
  attributes.to_h
23
30
  end
24
31
 
@@ -1,3 +1,3 @@
1
1
  module DatoDump
2
- VERSION = "0.1.0"
2
+ VERSION = "0.1.1"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: dato-dump
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Stefano Verna