scms 4.2.0 → 4.2.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +8 -8
- data/lib/scms.rb +4 -1
- data/lib/scms/scms-bundler.rb +15 -3
- data/lib/scms/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
---
|
2
2
|
!binary "U0hBMQ==":
|
3
3
|
metadata.gz: !binary |-
|
4
|
-
|
4
|
+
NGJkMzc0YTk1MDZjNzUyYmFhM2MwMGM1MGE5NWM4ZTVlYTIwMDZjOQ==
|
5
5
|
data.tar.gz: !binary |-
|
6
|
-
|
6
|
+
NWNkMTA5YWI3ZmYyMDJiY2UwOTI4NDllYjliNjUwYTM4OTZkN2M4MA==
|
7
7
|
SHA512:
|
8
8
|
metadata.gz: !binary |-
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
ZDVmODk5Yjg0MzkxYjQ4N2RhZjYwYmY4ZGNhYjViMTg0YzM3ZTc5NTlkMDA0
|
10
|
+
ZWVkOTQ4MDgyYWEyYjcyYjNlYzM4Y2JkNDVhYTc2MDA5NDJlMjg3N2Y0YWE0
|
11
|
+
ZjBmMDJmM2FhODI4OTE4ODI0MWFiN2RkYjliZGJhYmRhOWU5NGI=
|
12
12
|
data.tar.gz: !binary |-
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
OWJiNjNmYjM1NTdlNTY5NjNjMzk5ZjJmZDgzZGNiYzJhM2YwM2ZjYzMxZGRm
|
14
|
+
ZDYwMWFlNGZjMGJmMjA1OGNlNDEzZDBlNmZiZDI3ODdmNjgzMjE2MzYxNGI0
|
15
|
+
YTk1MGQ0NTYzM2FmN2NhMzgxOTQzMDZkNTZiNjQxOTdhNTQ1YTQ=
|
data/lib/scms.rb
CHANGED
@@ -311,7 +311,10 @@ module Scms
|
|
311
311
|
websiteroot = ScmsUtils.uriEncode("file:///#{website}/") if options[:mode] == "cms"
|
312
312
|
|
313
313
|
Dir.glob('**/*.bundle').each do|bundle|
|
314
|
-
|
314
|
+
getGeneratedBundleName = ScmsBundler.getGeneratedBundleName(bundle)
|
315
|
+
stub = ScmsBundler.toStub(bundle)
|
316
|
+
bundleModel[bundle] = getGeneratedBundleName
|
317
|
+
bundleModel[stub] = getGeneratedBundleName #Access bundle model without bundle extention
|
315
318
|
end
|
316
319
|
|
317
320
|
bundleConfig = settings["bundles"]
|
data/lib/scms/scms-bundler.rb
CHANGED
@@ -1,5 +1,6 @@
|
|
1
1
|
module ScmsBundler
|
2
2
|
require 'fileutils'
|
3
|
+
require 'packr'
|
3
4
|
require 'scms/scms-bundler.rb'
|
4
5
|
|
5
6
|
def ScmsBundler.run()
|
@@ -11,7 +12,6 @@ module ScmsBundler
|
|
11
12
|
def ScmsBundler.bundle(bundle)
|
12
13
|
puts "Parsing bundle: #{bundle}"
|
13
14
|
|
14
|
-
|
15
15
|
content = ""
|
16
16
|
if File::exists?(bundle)
|
17
17
|
wd = File.dirname(bundle)
|
@@ -23,12 +23,20 @@ module ScmsBundler
|
|
23
23
|
|
24
24
|
next if bundleFile == nil
|
25
25
|
next if bundleFile == ""
|
26
|
+
next if line.match(/^generate:/)
|
26
27
|
|
27
28
|
if !line.match(/^#/)
|
28
29
|
b = File.join(wd, bundleFile)
|
29
30
|
puts "Including: #{line}"
|
30
31
|
if File::exists?(b)
|
31
|
-
|
32
|
+
fileContents = File.read(b)
|
33
|
+
|
34
|
+
if File.extname(b) == ".js"
|
35
|
+
puts "Minifing: #{b}"
|
36
|
+
fileContents = Packr.pack(fileContents) unless /(-min)|(\.min)|(\-pack)|(\.pack)/.match(b)
|
37
|
+
end
|
38
|
+
|
39
|
+
content += fileContents + "\n"
|
32
40
|
else
|
33
41
|
puts "Can not read: #{b}"
|
34
42
|
end
|
@@ -91,8 +99,12 @@ module ScmsBundler
|
|
91
99
|
return files
|
92
100
|
end
|
93
101
|
|
102
|
+
def ScmsBundler.toStub(bundle)
|
103
|
+
return bundle.gsub(".bundle", "")
|
104
|
+
end
|
105
|
+
|
94
106
|
def ScmsBundler.getGeneratedBundleName(bundle)
|
95
|
-
name =
|
107
|
+
name = ScmsBundler.toStub(bundle)
|
96
108
|
|
97
109
|
if File::exists?(bundle)
|
98
110
|
wd = File.dirname(bundle)
|
data/lib/scms/version.rb
CHANGED