locomotivecms_wagon 2.2.0.rc2 → 2.2.0.rc3

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: 52fd2b1db00c64e0a1378a8ece082374ac3b7f14
4
- data.tar.gz: 2c6357e45921c7655bcbec88b4576d295bcae1a4
3
+ metadata.gz: 6975244fe7a2d1cdf8c2e261440f6a809b48f048
4
+ data.tar.gz: 27f4950a89ec9a5857eecb31c34d7a0ab6c87b9b
5
5
  SHA512:
6
- metadata.gz: e3ad48fc103305f876cb47e0179f83b2450289504ff59454e8494008396977605327f8bc2979993521d0844b20b5b1958a28a8eb8ee584c1320d6d7d1ce963d7
7
- data.tar.gz: 851e04f5cf06181e9b53e12a7d52929dddd8becd6aa00f5073db54d8cbccd1881ca51ae50af2d473a17338150073eb1d0b193e9b119221aebfbd2a0f0d64c1e9
6
+ metadata.gz: 3af332b6afa4227b7755315e8079ffb82973d8c7daa768eba466ebb1d76165201859a6d3ea56f1360dbc8ef3632131224b3d52c3ef38c0025f75a8678eab4af5
7
+ data.tar.gz: 627f9e406a83ce2824c495907c4e8e71ae01c2f4b445521a476c0737e8132cf87c3f54eef8ac49eeac2d0ee6d942d28b9c16ff89e8e019fd4294beace933ec37
@@ -6,7 +6,7 @@ module Locomotive::Wagon
6
6
 
7
7
  module AssetsConcern
8
8
 
9
- REGEX = /(https?:\/\/\S+)?\/sites\/[0-9a-f]{24}\/(assets|pages|theme|content_entry[0-9a-f]{24})\/(([^;.]+)\/)*([a-zA-Z_\-0-9.%]+)\.([A-Za-z]{2,})(\?\w+)?/
9
+ REGEX = /(https?:\/\/\S+)?\/sites\/[0-9a-f]{24}\/(assets|pages|theme|content_entry[0-9a-f]{24})\/(([^;.]+)\/)*([a-zA-Z_\-0-9.%]+)(\?\w+)?/
10
10
 
11
11
  # The content assets on the remote engine follows the format: /sites/<id>/assets/<type>/<file>
12
12
  # This method replaces these urls by their local representation. <type>/<file>
@@ -17,7 +17,7 @@ module Locomotive::Wagon
17
17
  return '' if content.blank?
18
18
 
19
19
  content.force_encoding('utf-8').gsub(REGEX) do |url|
20
- filename = "#{$5}.#{$6}"
20
+ filename = $5
21
21
  folder = case $2
22
22
  when 'assets', 'pages' then File.join('samples', $2)
23
23
  when 'theme' then $4
@@ -27,7 +27,6 @@ module Locomotive::Wagon
27
27
  def yaml_attributes(content_type, entry)
28
28
  fields = %w(_slug) + content_type.fields.map { |f| f['name'] } + %w(seo_title meta_description meta_keywords)
29
29
  localized_fields = (content_type.attributes['localized_names'] || []) + %w(_slug seo_title meta_description meta_keywords)
30
- fields_with_urls = content_type.attributes['urls_names']
31
30
 
32
31
  attributes = {}
33
32
 
@@ -41,6 +40,8 @@ module Locomotive::Wagon
41
40
  end
42
41
  end
43
42
 
43
+ attributes['_visible'] = false unless entry[default_locale].attributes['_visible'] == true
44
+
44
45
  { entry[default_locale].attributes[content_type.label_field_name].to_s => clean_attributes(attributes) }
45
46
  end
46
47
 
@@ -28,7 +28,11 @@ EOF
28
28
  private
29
29
 
30
30
  def yaml_attributes(page, locale)
31
- attributes = page.attributes.slice('title', 'slug', 'handle', 'position', 'listed', 'published', 'redirect_url', 'is_layout', 'content_type', 'seo_title', 'meta_description', 'meta_keywords')
31
+ keys = ['title', 'slug', 'handle', 'position', 'listed', 'published', 'redirect_url', 'is_layout', 'content_type', 'seo_title', 'meta_description', 'meta_keywords']
32
+
33
+ keys << 'response_type' if page.attributes['response_type'] != 'text/html'
34
+
35
+ attributes = page.attributes.slice(*keys)
32
36
 
33
37
  if locale != default_locale
34
38
  attributes.delete_if { |k, _| %w(handle position listed published is_layout content_type).include?(k) }
@@ -3,7 +3,7 @@ module Locomotive::Wagon
3
3
  class PullSiteCommand < PullBaseCommand
4
4
 
5
5
  def _pull
6
- attributes = current_site.attributes.slice('name', 'locales', 'domains', 'timezone', 'seo_title', 'meta_keywords', 'meta_description', 'picture_thumbnail_url', 'metafields', 'metafields_schema', 'metafields_ui')
6
+ attributes = current_site.attributes.slice('name', 'locales', 'domains', 'timezone', 'seo_title', 'meta_keywords', 'meta_description', 'picture_thumbnail_url', 'metafields', 'metafields_schema', 'metafields_ui', 'robots_txt')
7
7
 
8
8
  locales.each_with_index do |locale, index|
9
9
  if index == 0
@@ -32,7 +32,7 @@ module Locomotive::Wagon
32
32
  end
33
33
 
34
34
  def replace_editable_elements(filepath, replacement)
35
- content = File.read(File.join(path, filepath))
35
+ content = File.read(File.join(path, filepath), encoding: 'utf-8')
36
36
  existing = content =~ /\A.*?editable_elements:.*?\n---/m
37
37
 
38
38
  content.gsub /\A---(.*?)\n---/m do |s|
@@ -1,5 +1,5 @@
1
1
  module Locomotive
2
2
  module Wagon
3
- VERSION = '2.2.0.rc2'
3
+ VERSION = '2.2.0.rc3'
4
4
  end
5
5
  end
@@ -28,7 +28,7 @@ Gem::Specification.new do |gem|
28
28
 
29
29
  gem.add_dependency 'locomotivecms_common', '~> 0.2.0'
30
30
  gem.add_dependency 'locomotivecms_coal', '~> 1.3.0.rc1'
31
- gem.add_dependency 'locomotivecms_steam', '~> 1.2.0.rc2'
31
+ gem.add_dependency 'locomotivecms_steam', '~> 1.2.0.rc3'
32
32
 
33
33
  gem.add_dependency 'haml', '~> 4.0.7'
34
34
  gem.add_dependency 'listen', '~> 3.0.4'
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: locomotivecms_wagon
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.2.0.rc2
4
+ version: 2.2.0.rc3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Didier Lafforgue
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2016-09-15 00:00:00.000000000 Z
12
+ date: 2016-10-26 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rake
@@ -115,14 +115,14 @@ dependencies:
115
115
  requirements:
116
116
  - - "~>"
117
117
  - !ruby/object:Gem::Version
118
- version: 1.2.0.rc2
118
+ version: 1.2.0.rc3
119
119
  type: :runtime
120
120
  prerelease: false
121
121
  version_requirements: !ruby/object:Gem::Requirement
122
122
  requirements:
123
123
  - - "~>"
124
124
  - !ruby/object:Gem::Version
125
- version: 1.2.0.rc2
125
+ version: 1.2.0.rc3
126
126
  - !ruby/object:Gem::Dependency
127
127
  name: haml
128
128
  requirement: !ruby/object:Gem::Requirement