locomotivecms_mounter 1.2.6 → 1.2.7
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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7821d05f00c3bf1b11108d55d65465df1226a4e0
|
4
|
+
data.tar.gz: e4c71a13f4c029c35ec539c12a487c4a693c96b7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e45de803e79045ad5b23d0656d55005b45ae10ff5deddd974cdc9e0f8c3962a65be612621e3b9faf275bcd6840123f5ad004d756cc9a9ac563d6dd754af77641
|
7
|
+
data.tar.gz: 6cdf03153e9c1094c064bd9289d4b2cbdfe70ad1d05efdc0dd222a13365ef81d75d9ba3d60a35edad55e91118a3272296035a122dbd15b2db60ce3f6421e069c
|
@@ -5,12 +5,9 @@ module Locomotive
|
|
5
5
|
|
6
6
|
# Push translations to a remote LocomotiveCMS engine.
|
7
7
|
#
|
8
|
-
# Only pushes if force_translations flag is set
|
9
|
-
#
|
10
8
|
class TranslationsWriter < Base
|
11
9
|
|
12
10
|
def prepare
|
13
|
-
return unless force_translations?
|
14
11
|
super
|
15
12
|
|
16
13
|
# set the unique identifier to each local translation
|
@@ -23,7 +20,6 @@ module Locomotive
|
|
23
20
|
|
24
21
|
# Write all the translations to the remote destination
|
25
22
|
def write
|
26
|
-
return unless force_translations?
|
27
23
|
self.translations.each do |key, translation|
|
28
24
|
self.output_resource_op translation
|
29
25
|
|
@@ -36,9 +32,6 @@ module Locomotive
|
|
36
32
|
|
37
33
|
protected
|
38
34
|
|
39
|
-
def force_translations?
|
40
|
-
self.runner.parameters[:force_translations] || false
|
41
|
-
end
|
42
35
|
# Persist a translation by calling the API. The returned id
|
43
36
|
# is then set to the translation itself.
|
44
37
|
#
|
@@ -40,7 +40,18 @@ module Locomotive
|
|
40
40
|
# @return [ Array ] List of classes
|
41
41
|
#
|
42
42
|
def writers
|
43
|
-
[SiteWriter, SnippetsWriter, ContentTypesWriter, ContentEntriesWriter, PagesWriter, ThemeAssetsWriter
|
43
|
+
[SiteWriter, SnippetsWriter, ContentTypesWriter, ContentEntriesWriter, TranslationsWriter, PagesWriter, ThemeAssetsWriter].tap do |_writers|
|
44
|
+
# modify the list depending on the parameters
|
45
|
+
if self.parameters
|
46
|
+
if self.parameters[:data] == false && !(self.parameters[:only].try(:include?, 'content_entries'))
|
47
|
+
_writers.delete(ContentEntriesWriter)
|
48
|
+
end
|
49
|
+
|
50
|
+
if self.parameters[:translations] == false && !(self.parameters[:only].try(:include?, 'translations'))
|
51
|
+
_writers.delete(TranslationsWriter)
|
52
|
+
end
|
53
|
+
end
|
54
|
+
end
|
44
55
|
end
|
45
56
|
|
46
57
|
# Get the writer to push content assets
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: locomotivecms_mounter
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.2.
|
4
|
+
version: 1.2.7
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Didier Lafforgue
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2013-09-
|
11
|
+
date: 2013-09-17 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: tilt
|