locomotivecms_mounter 1.4.1 → 1.4.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/locomotive/mounter/extensions/sprockets.rb +6 -0
- data/lib/locomotive/mounter/models/content_entry.rb +2 -0
- data/lib/locomotive/mounter/models/translation.rb +1 -1
- data/lib/locomotive/mounter/reader/api/theme_assets_reader.rb +1 -0
- data/lib/locomotive/mounter/version.rb +1 -1
- data/lib/locomotive/mounter/writer/api/translations_writer.rb +10 -6
- data/lib/locomotive/mounter.rb +1 -1
- metadata +18 -18
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 22319511037ee53f5fde01a98595c7e13625bb94
|
4
|
+
data.tar.gz: a7ee27a364ec3a987db9ef5b6b2e2e07f5c10470
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 076478319cfcc093fee428b4bb8ce7426ac4764118a2e2b4bf1d6b7735baed1174221fd472105a750ed7fc7f571226aee6831fe8e9525d1096cdd7ac8ef013ca
|
7
|
+
data.tar.gz: e53c360a726731722ffaef69d85b080556651833134ac2f7a69997aea89edeae92eed2a9838c5947cf34b774b17884748554a29fe583a345e6702ab617226747
|
@@ -1,3 +1,5 @@
|
|
1
|
+
require 'yui/compressor'
|
2
|
+
|
1
3
|
module Locomotive
|
2
4
|
module Mounter
|
3
5
|
module Extensions
|
@@ -17,6 +19,10 @@ module Locomotive
|
|
17
19
|
|
18
20
|
@@path = site_path
|
19
21
|
@@env = ::Sprockets::Environment.new.tap do |env|
|
22
|
+
# minify javascripts and stylesheets
|
23
|
+
env.js_compressor = YUI::JavaScriptCompressor.new
|
24
|
+
env.css_compressor = YUI::CssCompressor.new
|
25
|
+
|
20
26
|
%w(fonts stylesheets javascripts).each do |name|
|
21
27
|
env.append_path File.join(site_path, 'public', name)
|
22
28
|
end
|
@@ -23,9 +23,9 @@ module Locomotive
|
|
23
23
|
self.translations.each do |key, translation|
|
24
24
|
self.output_resource_op translation
|
25
25
|
|
26
|
-
|
26
|
+
status = translation.persisted? ? self.update_translation(translation) : self.create_translation(translation)
|
27
27
|
|
28
|
-
self.output_resource_op_status translation,
|
28
|
+
self.output_resource_op_status translation, status
|
29
29
|
self.flush_log_buffer
|
30
30
|
end
|
31
31
|
end
|
@@ -48,7 +48,7 @@ module Locomotive
|
|
48
48
|
|
49
49
|
translation._id = response['id'] if response
|
50
50
|
|
51
|
-
!response.nil?
|
51
|
+
!response.nil? ? :success : :error
|
52
52
|
end
|
53
53
|
|
54
54
|
# Update a translation by calling the API.
|
@@ -60,10 +60,14 @@ module Locomotive
|
|
60
60
|
def update_translation(translation)
|
61
61
|
params = self.buffer_log { translation.to_params }
|
62
62
|
|
63
|
-
|
64
|
-
|
63
|
+
if self.data?
|
64
|
+
# make a call to the API for the update
|
65
|
+
response = self.put :translations, translation._id, params
|
65
66
|
|
66
|
-
|
67
|
+
!response.nil? ? :success : :error
|
68
|
+
else
|
69
|
+
:skipped
|
70
|
+
end
|
67
71
|
end
|
68
72
|
|
69
73
|
# Shortcut to get all the local translations.
|
data/lib/locomotive/mounter.rb
CHANGED
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.4.
|
4
|
+
version: 1.4.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Didier Lafforgue
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-
|
11
|
+
date: 2014-09-19 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: tilt
|
@@ -25,33 +25,33 @@ dependencies:
|
|
25
25
|
- !ruby/object:Gem::Version
|
26
26
|
version: 1.4.1
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
|
-
name: sprockets
|
28
|
+
name: sprockets-sass
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
31
|
- - "~>"
|
32
32
|
- !ruby/object:Gem::Version
|
33
|
-
version:
|
33
|
+
version: 1.2.0
|
34
34
|
type: :runtime
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
38
|
- - "~>"
|
39
39
|
- !ruby/object:Gem::Version
|
40
|
-
version:
|
40
|
+
version: 1.2.0
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
|
-
name:
|
42
|
+
name: yui-compressor
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
44
44
|
requirements:
|
45
|
-
- - "
|
45
|
+
- - "~>"
|
46
46
|
- !ruby/object:Gem::Version
|
47
|
-
version:
|
47
|
+
version: 0.12.0
|
48
48
|
type: :runtime
|
49
49
|
prerelease: false
|
50
50
|
version_requirements: !ruby/object:Gem::Requirement
|
51
51
|
requirements:
|
52
|
-
- - "
|
52
|
+
- - "~>"
|
53
53
|
- !ruby/object:Gem::Version
|
54
|
-
version:
|
54
|
+
version: 0.12.0
|
55
55
|
- !ruby/object:Gem::Dependency
|
56
56
|
name: haml
|
57
57
|
requirement: !ruby/object:Gem::Requirement
|
@@ -72,28 +72,28 @@ dependencies:
|
|
72
72
|
requirements:
|
73
73
|
- - "~>"
|
74
74
|
- !ruby/object:Gem::Version
|
75
|
-
version: 3.
|
75
|
+
version: 3.4.4
|
76
76
|
type: :runtime
|
77
77
|
prerelease: false
|
78
78
|
version_requirements: !ruby/object:Gem::Requirement
|
79
79
|
requirements:
|
80
80
|
- - "~>"
|
81
81
|
- !ruby/object:Gem::Version
|
82
|
-
version: 3.
|
82
|
+
version: 3.4.4
|
83
83
|
- !ruby/object:Gem::Dependency
|
84
84
|
name: compass
|
85
85
|
requirement: !ruby/object:Gem::Requirement
|
86
86
|
requirements:
|
87
|
-
- - "
|
87
|
+
- - ">="
|
88
88
|
- !ruby/object:Gem::Version
|
89
|
-
version: 0.12
|
89
|
+
version: '0.12'
|
90
90
|
type: :runtime
|
91
91
|
prerelease: false
|
92
92
|
version_requirements: !ruby/object:Gem::Requirement
|
93
93
|
requirements:
|
94
|
-
- - "
|
94
|
+
- - ">="
|
95
95
|
- !ruby/object:Gem::Version
|
96
|
-
version: 0.12
|
96
|
+
version: '0.12'
|
97
97
|
- !ruby/object:Gem::Dependency
|
98
98
|
name: coffee-script
|
99
99
|
requirement: !ruby/object:Gem::Requirement
|
@@ -184,14 +184,14 @@ dependencies:
|
|
184
184
|
requirements:
|
185
185
|
- - "~>"
|
186
186
|
- !ruby/object:Gem::Version
|
187
|
-
version: 0.6.
|
187
|
+
version: 0.6.11
|
188
188
|
type: :runtime
|
189
189
|
prerelease: false
|
190
190
|
version_requirements: !ruby/object:Gem::Requirement
|
191
191
|
requirements:
|
192
192
|
- - "~>"
|
193
193
|
- !ruby/object:Gem::Version
|
194
|
-
version: 0.6.
|
194
|
+
version: 0.6.11
|
195
195
|
- !ruby/object:Gem::Dependency
|
196
196
|
name: stringex
|
197
197
|
requirement: !ruby/object:Gem::Requirement
|