scms 2.0.2 → 2.0.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/scms.rb +26 -19
- data/lib/scms/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5f381843ee93fb7c0c758ba3205076e82392b921
|
4
|
+
data.tar.gz: 6458d3e0809e62af6f6ba24c417f0c88b3d29e1c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 39ac479902d10445c3189c93cb0eb0e2267f046a620f41fb849317a9a2172a7a417c2525b339d7d54d75650b02cd432db0e754487af7da5f5023e5dafde1f470
|
7
|
+
data.tar.gz: db12283f651d7d18c4da2f0b2a74fddddce747549cff8e685f66e39d1ff3357d33beea9534f75b8768755a3d5a6c972d4b3f6894b24571c424c783ac2f224048
|
data/lib/scms.rb
CHANGED
@@ -123,8 +123,11 @@ module Scms
|
|
123
123
|
if !htmlsnipet.empty?
|
124
124
|
viewmodel = Hash.new
|
125
125
|
viewmodel = {
|
126
|
-
:
|
127
|
-
:
|
126
|
+
:name => pagename,
|
127
|
+
:title => title,
|
128
|
+
:url => pageurl,
|
129
|
+
:data => pagedata,
|
130
|
+
:rootdir => @website,
|
128
131
|
:resource => resource
|
129
132
|
}
|
130
133
|
|
@@ -149,7 +152,7 @@ module Scms
|
|
149
152
|
end
|
150
153
|
|
151
154
|
if @mode == "cms"
|
152
|
-
views[view[0]] = "<div class='cms' data-view='#{view[1]}' data-page='#{
|
155
|
+
views[view[0]] = "<div class='cms' data-view='#{view[1]}' data-page='#{pageurl}'>#{Scms.parsetemplate(viewSnippet, viewmodel)}</div>"
|
153
156
|
else
|
154
157
|
views[view[0]] = Scms.parsetemplate(viewSnippet, viewmodel)
|
155
158
|
end
|
@@ -244,23 +247,27 @@ module Scms
|
|
244
247
|
content = ""
|
245
248
|
assetList = ""
|
246
249
|
files = option[1]["files"]
|
247
|
-
files
|
248
|
-
|
249
|
-
|
250
|
-
|
251
|
-
|
252
|
-
|
253
|
-
|
250
|
+
if files != nil
|
251
|
+
files.each do |asset|
|
252
|
+
assetList += "\t#{asset}\n"
|
253
|
+
assetname = File.join(@website, asset)
|
254
|
+
if File::exists?(assetname)
|
255
|
+
content = content + "\n" + File.read(assetname)
|
256
|
+
else
|
257
|
+
ScmsUtils.errLog( "Error: No such file #{assetname}" )
|
258
|
+
end
|
254
259
|
end
|
255
|
-
|
256
|
-
|
257
|
-
|
258
|
-
|
259
|
-
|
260
|
-
|
261
|
-
|
262
|
-
|
263
|
-
|
260
|
+
ScmsUtils.log("#{assetList}")
|
261
|
+
|
262
|
+
bundleDir = File.dirname(bundleName)
|
263
|
+
Dir.mkdir(bundleDir, 755) unless File::directory?(bundleDir)
|
264
|
+
File.open(bundleName, 'w') {|f| f.write(content) }
|
265
|
+
if File.extname(bundleName) == ".js"
|
266
|
+
puts "Minifing: #{bundleName}"
|
267
|
+
Scms.packr(bundleName) unless /(-min)|(\.min)/.match(bundleName)
|
268
|
+
end
|
269
|
+
else
|
270
|
+
ScmsUtils.errLog("No files in bundle");
|
264
271
|
end
|
265
272
|
end
|
266
273
|
end
|
data/lib/scms/version.rb
CHANGED