locomotivecms_mounter 1.3.0 → 1.3.1
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/models/page.rb +1 -1
- data/lib/locomotive/mounter/reader/api/base.rb +1 -1
- data/lib/locomotive/mounter/reader/file_system/pages_reader.rb +12 -2
- data/lib/locomotive/mounter/version.rb +1 -1
- data/lib/locomotive/mounter/writer/api/pages_writer.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: bd805b0725f79d360e2dca56b557700f21345f3f
|
4
|
+
data.tar.gz: f437f1070d2c438ae866e4bd686b1a5d32407103
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c65468b6d09942dc0f7628990530d74a5f0467da2e3e6b77479526cade925d1e77c0a563c9d22494f625e8ef531f20ba7f8e4217504455381f6a05ba2a5d2ece
|
7
|
+
data.tar.gz: 223bdc863a4e1acc7dcac5f075807441c81599a4ec292ab3126a94269052335c0212b86162eb08292b16eb95c8d004734ce4b64ee7d0228501d1fa03f4376306
|
@@ -150,7 +150,7 @@ module Locomotive
|
|
150
150
|
# @return [ Integer ] An unique id corresponding to the depth and position
|
151
151
|
#
|
152
152
|
def depth_and_position
|
153
|
-
self.depth *
|
153
|
+
self.depth * 1000 + (self.position || 199)
|
154
154
|
end
|
155
155
|
|
156
156
|
# A layout is a page whose the template does
|
@@ -69,10 +69,16 @@ module Locomotive
|
|
69
69
|
|
70
70
|
# Record pages found in file system
|
71
71
|
def fetch
|
72
|
-
|
72
|
+
position, last_dirname = nil, nil
|
73
|
+
|
74
|
+
Dir.glob(File.join(self.root_dir, '**/*')).sort.each do |filepath|
|
73
75
|
next unless File.directory?(filepath) || filepath =~ /\.(#{Locomotive::Mounter::TEMPLATE_EXTENSIONS.join('|')})$/
|
74
76
|
|
75
|
-
|
77
|
+
if last_dirname != File.dirname(filepath)
|
78
|
+
position, last_dirname = 100, File.dirname(filepath)
|
79
|
+
end
|
80
|
+
|
81
|
+
page = self.add(filepath, position: position)
|
76
82
|
|
77
83
|
next if File.directory?(filepath) || page.nil?
|
78
84
|
|
@@ -83,6 +89,8 @@ module Locomotive
|
|
83
89
|
else
|
84
90
|
Locomotive::Mounter.logger.warn "Unknown locale in the '#{File.basename(filepath)}' file."
|
85
91
|
end
|
92
|
+
|
93
|
+
position += 1
|
86
94
|
end
|
87
95
|
end
|
88
96
|
|
@@ -105,6 +113,8 @@ module Locomotive
|
|
105
113
|
page.mounting_point = self.mounting_point
|
106
114
|
page.filepath = File.expand_path(filepath)
|
107
115
|
|
116
|
+
page.template = OpenStruct.new(raw_source: '') if File.directory?(filepath)
|
117
|
+
|
108
118
|
self.pages[fullpath] = page
|
109
119
|
end
|
110
120
|
|
@@ -227,7 +227,7 @@ module Locomotive
|
|
227
227
|
|
228
228
|
# editable elements
|
229
229
|
(params[:editable_elements] || []).each do |element|
|
230
|
-
if element[:content] =~
|
230
|
+
if element[:content] =~ /^\/samples\//
|
231
231
|
element[:source] = self.path_to_file(element.delete(:content))
|
232
232
|
elsif element[:content] =~ %r($http://)
|
233
233
|
element[:source_url] = element.delete(:content)
|
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.3.
|
4
|
+
version: 1.3.1
|
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-10-
|
11
|
+
date: 2013-10-24 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: tilt
|