scms 1.9.4 → 1.9.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/scms/version.rb +1 -1
- data/lib/scms.rb +8 -5
- 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: 8afbf980cb75d561c9a31da6363773ed87695218
|
4
|
+
data.tar.gz: 14b0ec6f0fe85009bcc5758ac7ddd6d761bb5f81
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: eeb4cac2eea8f198918e020d4c5ffeebce645b18299306290603577382d7a598fc0798f33a15b3a8b827bccd07f4995bbc601373749726d667568cc3ebc8d41f
|
7
|
+
data.tar.gz: d366328cd072ca5f08a6434c987b2f17685073d46e3960a138ade8028a145e2abc7502bfa2c78d4201f7dce2338c96daa73e7d77889dda45e97439b6ccaedb3f
|
data/lib/scms/version.rb
CHANGED
data/lib/scms.rb
CHANGED
@@ -72,8 +72,8 @@ module Scms
|
|
72
72
|
end
|
73
73
|
|
74
74
|
#Bundle resources
|
75
|
-
scripts = Scms.bundle($settings["scripts"])
|
76
|
-
stylesheets = Scms.bundle($settings["stylesheets"])
|
75
|
+
scripts = Scms.bundle($settings["scripts"], ".js")
|
76
|
+
stylesheets = Scms.bundle($settings["stylesheets"], ".css")
|
77
77
|
bundles = Scms.bundle($settings["bundles"])
|
78
78
|
#Generate pages
|
79
79
|
Scms.parsepages(scripts, stylesheets, bundles)
|
@@ -230,7 +230,7 @@ module Scms
|
|
230
230
|
end
|
231
231
|
end
|
232
232
|
|
233
|
-
def Scms.bundle(bundleConfig)
|
233
|
+
def Scms.bundle(bundleConfig, defaultExt=".bundle")
|
234
234
|
scripts = Hash.new
|
235
235
|
if bundleConfig != nil
|
236
236
|
ScmsUtils.log("Bundeling:")
|
@@ -243,7 +243,7 @@ module Scms
|
|
243
243
|
else
|
244
244
|
bundleVersion = 1
|
245
245
|
end
|
246
|
-
bundleName = File.join("scripts", "#{name}-v#{bundleVersion}
|
246
|
+
bundleName = File.join("scripts", "#{name}-v#{bundleVersion}.#{defaultExt}") #Legasy name filename from root and version
|
247
247
|
bundleName = File.join(option[1]["generate"]) if option[1]["generate"] != nil #just use the generate
|
248
248
|
scripts[name] = bundleName
|
249
249
|
ScmsUtils.successLog("#{bundleName}")
|
@@ -265,7 +265,10 @@ module Scms
|
|
265
265
|
bundleDir = File.dirname(bundleName)
|
266
266
|
Dir.mkdir(bundleDir, 755) unless File::directory?(bundleDir)
|
267
267
|
File.open(bundleName, 'w') {|f| f.write(content) }
|
268
|
-
|
268
|
+
if File.extname(bundleName) == ".js"
|
269
|
+
puts "Minifing: #{bundleName}"
|
270
|
+
Scms.packr(bundleName) unless /(-min)|(\.min)/.match(bundleName)
|
271
|
+
end
|
269
272
|
end
|
270
273
|
end
|
271
274
|
end
|