scms 4.2.0 → 4.2.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- ZDVjYTM4YjlhZTdlZTM3MGE0YzlkNGRkYjE3MzgxYzc1OWQ1ZTZlMA==
4
+ NGJkMzc0YTk1MDZjNzUyYmFhM2MwMGM1MGE5NWM4ZTVlYTIwMDZjOQ==
5
5
  data.tar.gz: !binary |-
6
- ZjQ4MzhhOTAzNDFiMDhlZjZkMTkxNTI1OWExMGM2YjQ0ZWM4NjMyMA==
6
+ NWNkMTA5YWI3ZmYyMDJiY2UwOTI4NDllYjliNjUwYTM4OTZkN2M4MA==
7
7
  SHA512:
8
8
  metadata.gz: !binary |-
9
- ZDc3NDI0Y2RkYjRkZDNhMjZlMjUxN2Q3Y2MxYjFjYjE2YWZmN2RiODE4YTlh
10
- MDE4Mjk4N2IyNTYwMWMwOGZlOGIyZjQ2OGFlNzNhZTU5MDM1NzFhODY5NWRj
11
- NzIwYjE3ZDc3MWE1MzZlMGVmM2E0MjI2NGU2NDU5OWE5ZDRmZmQ=
9
+ ZDVmODk5Yjg0MzkxYjQ4N2RhZjYwYmY4ZGNhYjViMTg0YzM3ZTc5NTlkMDA0
10
+ ZWVkOTQ4MDgyYWEyYjcyYjNlYzM4Y2JkNDVhYTc2MDA5NDJlMjg3N2Y0YWE0
11
+ ZjBmMDJmM2FhODI4OTE4ODI0MWFiN2RkYjliZGJhYmRhOWU5NGI=
12
12
  data.tar.gz: !binary |-
13
- NThjZDY1MGYyZDNjNDc3NGE2OWFmMzEzN2NkNGU2MjU3Njg3M2VkOGI2ZjQ0
14
- N2E4NDMyMTA5ZTNkMTYzMjc5NTNiMjkwMjM3ZmM1MDc4ZGUzNjkyYWM3MTFj
15
- YmY4Mzc2ZTA3YjM1NTVlYTdlM2NhOWU4MGY4ZWQ5NDAzMzg5Mzk=
13
+ OWJiNjNmYjM1NTdlNTY5NjNjMzk5ZjJmZDgzZGNiYzJhM2YwM2ZjYzMxZGRm
14
+ ZDYwMWFlNGZjMGJmMjA1OGNlNDEzZDBlNmZiZDI3ODdmNjgzMjE2MzYxNGI0
15
+ YTk1MGQ0NTYzM2FmN2NhMzgxOTQzMDZkNTZiNjQxOTdhNTQ1YTQ=
@@ -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
- bundleModel[bundle] = ScmsBundler.getGeneratedBundleName(bundle)
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"]
@@ -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
- content += File.read(b) + "\n"
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 = bundle.gsub(".bundle", "")
107
+ name = ScmsBundler.toStub(bundle)
96
108
 
97
109
  if File::exists?(bundle)
98
110
  wd = File.dirname(bundle)
@@ -1,3 +1,3 @@
1
1
  module Scms
2
- VERSION = "4.2.0"
2
+ VERSION = "4.2.2"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: scms
3
3
  version: !ruby/object:Gem::Version
4
- version: 4.2.0
4
+ version: 4.2.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Courtenay Probert