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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 1bc126f035df0912f914258192ed40e207f0b500
4
- data.tar.gz: 83f1f579f8ec9f6e00f9bd934261944ee8538785
3
+ metadata.gz: 22319511037ee53f5fde01a98595c7e13625bb94
4
+ data.tar.gz: a7ee27a364ec3a987db9ef5b6b2e2e07f5c10470
5
5
  SHA512:
6
- metadata.gz: e40834801eb4e0d81f23b476f6be7ad20697c32be1bcbb17a7647d1642bed4ce42af4d507cb3074ca65a13b32c261d71f8de3d5893d242bbd420156f116caf32
7
- data.tar.gz: 230ac8773c3a0524ccd3516db6a3fc4f3ac6621b2d1b14d711af67bf4df5cfae54e50e33893e12c68c9591d5c0dba7248c20bca33d8b4aed5ca7728b16123426
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
@@ -47,6 +47,8 @@ module Locomotive
47
47
 
48
48
  if field.type == :belongs_to
49
49
  value.try(:_label)
50
+ elsif field.type == :file
51
+ value['url']
50
52
  else
51
53
  value
52
54
  end
@@ -19,7 +19,7 @@ module Locomotive
19
19
  end
20
20
 
21
21
  def to_s
22
- "Translation {#{self.key}: #{self.values}}"
22
+ "Translation #{self.key} (#{self.values.keys.join(', ')})"
23
23
  end
24
24
 
25
25
  end
@@ -19,6 +19,7 @@ module Locomotive
19
19
 
20
20
  self.items = self.get(:theme_assets).map do |attributes|
21
21
  url = attributes.delete('url')
22
+ url.gsub!(/^\/\//, "https://")
22
23
 
23
24
  attributes['uri'] = URI(url =~ /^https?:\/\// ? url : "#{self.base_uri_with_scheme}#{url}")
24
25
 
@@ -2,7 +2,7 @@
2
2
  module Locomotive
3
3
  module Mounter #:nodoc
4
4
 
5
- VERSION = '1.4.1'
5
+ VERSION = '1.4.2'
6
6
 
7
7
  end
8
8
  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
- success = translation.persisted? ? self.update_translation(translation) : self.create_translation(translation)
26
+ status = translation.persisted? ? self.update_translation(translation) : self.create_translation(translation)
27
27
 
28
- self.output_resource_op_status translation, success ? :success : :error
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
- # make a call to the API for the update
64
- response = self.put :translations, translation._id, params
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
- !response.nil?
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.
@@ -5,7 +5,7 @@ Encoding.default_internal = Encoding.default_external = 'UTF-8'
5
5
 
6
6
  # Remove I18n warnings
7
7
  require 'i18n'
8
- I18n.config.enforce_available_locales = true
8
+ I18n.config.enforce_available_locales = false
9
9
 
10
10
  require 'logger'
11
11
  require 'colorize'
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.1
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-05-26 00:00:00.000000000 Z
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: '2.0'
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: '2.0'
40
+ version: 1.2.0
41
41
  - !ruby/object:Gem::Dependency
42
- name: sprockets-sass
42
+ name: yui-compressor
43
43
  requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
- - - ">="
45
+ - - "~>"
46
46
  - !ruby/object:Gem::Version
47
- version: '0'
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: '0'
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.2.12
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.2.12
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.2
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.2
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.0
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.0
194
+ version: 0.6.11
195
195
  - !ruby/object:Gem::Dependency
196
196
  name: stringex
197
197
  requirement: !ruby/object:Gem::Requirement