contentful-database-importer 0.3.1 → 0.3.2

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: ee4e3d7da26209f2dbecf16ea8c41d988e729c3b
4
- data.tar.gz: 1dc3c64c9cedf1411a35a8df9ffa4bb23b159ba2
3
+ metadata.gz: b17382659fb9cb37caad7dcc726b1d8b1bf8e832
4
+ data.tar.gz: 6991bbcd25ed0283426a4fdcb08de456ec712189
5
5
  SHA512:
6
- metadata.gz: 10e0939c31cbdb87f5741660b0b4abdc7350b8c279f2c647a950aee456852049712482af718e439710128d029147fb7dcd5c5d68c57bdecd66f40903ac0009fc
7
- data.tar.gz: 4726fa34a131195c33a9cdf4c8c3b152389cb3c38c5daee104fa6fc2214975823664ad26dd5ebae00f26d52d9f1405262d1d949f1dfdc09556ca99b7570fffd5
6
+ metadata.gz: f22eb2bf0b1a2c997130526d5e4e747f7e9ef2b1f6ac5aac2e7554516ad6b05127444828f2cf0d08480c328c3339f2f18893dd85cd91aa3b486062caf853715d
7
+ data.tar.gz: d3ae25e2559afaa74439bad1e50ed450e165ea9ca5fd4ca58216b46dfef629b5aa104b6d0ff36d99ff405df16380b182e92b7faf8aa4059bd5b63915c751cdda
data/CHANGELOG.md CHANGED
@@ -2,6 +2,13 @@
2
2
 
3
3
  ## Unreleased
4
4
 
5
+ ## 0.3.2
6
+
7
+ ### Fixed
8
+ * Excluded Fields are no longer part of the Content Type definition
9
+ * Display Fields no longer take into account excluded fields
10
+ * Asset IDs no longer contain non-valid characters
11
+
5
12
  ## 0.3.1
6
13
 
7
14
  ### Fixed
@@ -92,7 +92,7 @@ module Contentful
92
92
  end
93
93
 
94
94
  def fields_definition
95
- fields.map { |f| field_definition(f) }
95
+ fields.reject { |f| f[:exclude_from_output] }.map { |f| field_definition(f) }
96
96
  end
97
97
 
98
98
  def content_type_definition
@@ -53,9 +53,11 @@ module Contentful
53
53
  end
54
54
 
55
55
  def display_field
56
- @display_field || (fields.find do |f|
56
+ default_display_field = fields.reject { |f| f[:exclude_from_output] }.find do |f|
57
57
  f[:type] == :string || f[:type] == :symbol
58
- end || {})[:maps_to]
58
+ end || {}
59
+
60
+ @display_field || default_display_field[:maps_to]
59
61
  end
60
62
 
61
63
  def display_field=(field_name)
@@ -88,7 +88,7 @@ module Contentful
88
88
  def create_associated_asset(name, value)
89
89
  extension = value.split('.').last
90
90
  associated_assets << {
91
- id: Support.snake_case(name),
91
+ id: asset_id_from_name(name),
92
92
  title: name,
93
93
  file: {
94
94
  filename: name,
@@ -107,9 +107,13 @@ module Contentful
107
107
 
108
108
  {
109
109
  linkType: 'Asset',
110
- id: Support.snake_case(name)
110
+ id: asset_id_from_name(name)
111
111
  }
112
112
  end
113
+
114
+ def asset_id_from_name(name)
115
+ Support.snake_case(name.gsub(/[^\w ]/i, '_'))
116
+ end
113
117
  end
114
118
  end
115
119
  end
@@ -1,5 +1,5 @@
1
1
  module Contentful
2
2
  module DatabaseImporter
3
- VERSION = '0.3.1'.freeze
3
+ VERSION = '0.3.2'.freeze
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: contentful-database-importer
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.1
4
+ version: 0.3.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Contentful GmbH (David Litvak Bruno)
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2017-04-08 00:00:00.000000000 Z
11
+ date: 2017-05-12 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: contentful_bootstrap