locomotivecms_wagon 2.2.0.rc1 → 2.2.0.rc2

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: df455a7f6accfcf8b3b18d115b4736b07b6088fa
4
- data.tar.gz: 48208819e4bde10b2e31e1a50982c0addf98d883
3
+ metadata.gz: 52fd2b1db00c64e0a1378a8ece082374ac3b7f14
4
+ data.tar.gz: 2c6357e45921c7655bcbec88b4576d295bcae1a4
5
5
  SHA512:
6
- metadata.gz: 65ad7102456ddcb49a0a5d0ec32109d58164a823fa88b7fe0f894469d7081848eca4fe3bb2d9ea9ceb8f3be0a9a65d9ad27abf2326c97db53f01e121bc6290ed
7
- data.tar.gz: daab1c49d271fccffc9ec7462420ef5488780b4148e03af7996d2f668c3629d4a19fc009c35a10600581f47cab6e18e8891baf7e04f777b08db721d34c9becf9
6
+ metadata.gz: e3ad48fc103305f876cb47e0179f83b2450289504ff59454e8494008396977605327f8bc2979993521d0844b20b5b1958a28a8eb8ee584c1320d6d7d1ce963d7
7
+ data.tar.gz: 851e04f5cf06181e9b53e12a7d52929dddd8becd6aa00f5073db54d8cbccd1881ca51ae50af2d473a17338150073eb1d0b193e9b119221aebfbd2a0f0d64c1e9
@@ -21,6 +21,7 @@ module Locomotive::Wagon
21
21
  #{yaml_attributes(page, locale)}---
22
22
  #{replace_asset_urls(page.template)}
23
23
  EOF
24
+ .gsub(/\n$/, '')
24
25
  end
25
26
  end
26
27
 
@@ -49,7 +49,10 @@ module Locomotive::Wagon
49
49
  end
50
50
 
51
51
  def can_update?(local_entity)
52
- if local_entity.handle && id = remote_entity_id_from_handle(local_entity)
52
+ # checking pathes only if the current locale is the default one
53
+ if local_entity.__locale__.to_s == default_locale.to_s &&
54
+ local_entity.handle &&
55
+ id = remote_entity_id_from_handle(local_entity)
53
56
  remote_entity_folder_path(id) == local_entity.folder_path
54
57
  else
55
58
  true
@@ -79,7 +82,7 @@ module Locomotive::Wagon
79
82
 
80
83
  @remote_entities = {}.tap do |hash|
81
84
  api_client.pages.fullpaths(default_locale).each do |entity|
82
- hash[entity.fullpath] = entity._id
85
+ hash[entity.fullpath] = entity._id
83
86
 
84
87
  if entity.respond_to?(:handle) && entity.handle.present?
85
88
  # to_sym: trick to not have conflicts with fullpaths
@@ -8,10 +8,10 @@ module Locomotive
8
8
 
9
9
  attr_accessor :__content_assets_pusher__, :__persist_content__
10
10
 
11
- def initialize(object, locale = nil, content_assets_pusher, persist_content)
11
+ def initialize(object, locale, content_assets_pusher, persist_content)
12
12
  self.__content_assets_pusher__ = content_assets_pusher
13
13
  self.__persist_content__ = persist_content
14
- super(object, locale, nil)
14
+ super(object, locale, nil) # we don't need a fallback to the default locale
15
15
  end
16
16
 
17
17
  def __attributes__
@@ -1,5 +1,5 @@
1
1
  module Locomotive
2
2
  module Wagon
3
- VERSION = '2.2.0.rc1'
3
+ VERSION = '2.2.0.rc2'
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.rc1'
31
+ gem.add_dependency 'locomotivecms_steam', '~> 1.2.0.rc2'
32
32
 
33
33
  gem.add_dependency 'haml', '~> 4.0.7'
34
34
  gem.add_dependency 'listen', '~> 3.0.4'
@@ -86,7 +86,8 @@ describe Locomotive::Wagon::PushPagesCommand do
86
86
 
87
87
  let(:handle) { nil }
88
88
  let(:folder) { '' }
89
- let(:page) { instance_double('Page', fullpath: 'modified-about-us', folder_path: folder, handle: handle) }
89
+ let(:locale) { :en }
90
+ let(:page) { instance_double('Page', fullpath: 'modified-about-us', folder_path: folder, handle: handle, __locale__: locale, __default_locale__: :en) }
90
91
 
91
92
  subject { command.send(:can_update?, page) }
92
93
 
@@ -111,6 +112,14 @@ describe Locomotive::Wagon::PushPagesCommand do
111
112
 
112
113
  end
113
114
 
115
+ context 'another locale' do
116
+
117
+ let(:locale) { :fr }
118
+
119
+ it { is_expected.to eq true }
120
+
121
+ end
122
+
114
123
  end
115
124
 
116
125
  end
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.rc1
4
+ version: 2.2.0.rc2
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-08-11 00:00:00.000000000 Z
12
+ date: 2016-09-15 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.rc1
118
+ version: 1.2.0.rc2
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.rc1
125
+ version: 1.2.0.rc2
126
126
  - !ruby/object:Gem::Dependency
127
127
  name: haml
128
128
  requirement: !ruby/object:Gem::Requirement