scms 2.0.7 → 2.0.8

Sign up to get free protection for your applications and to get access to all the features.
Files changed (4) hide show
  1. checksums.yaml +4 -4
  2. data/lib/scms.rb +36 -13
  3. data/lib/scms/version.rb +1 -1
  4. metadata +1 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 3c0c0d471cd69e02766106c06e8963d96213701a
4
- data.tar.gz: a2e0a4ac536d83b3c9aea6b934b30e58c785a704
3
+ metadata.gz: 8fa75d14e950e8ab9bb0706c3e55b58efc637e84
4
+ data.tar.gz: 990d4bf361a11448dbc00f6f7e45baf9b6f0f617
5
5
  SHA512:
6
- metadata.gz: 35250c77a48797cf116f5f4a7cf49079341e8227017bbf2cba7b72d9ce4114b75e0c6a0d9abdee86adc7c16632ed9bb0a0ad6ba148ea9bf7d0548a090fa718be
7
- data.tar.gz: 94cf7c1f2f34c70f228fa9be7272be65b8b11a1067d9bc1f81be586a7e2f7df10472c6b8b48690e66d483d0ac1c3a08e7fe500211090a1b9b599dbacf1e0a50f
6
+ metadata.gz: 60ef41d6927c3dfbd93e5208f6f1bd9f2c6d0ab1d7f05e9097d1b90243e24426d38cdb53be395add8680bff95f06cc0eb5947e415c7b5f3a4fb1e8e12ef31614
7
+ data.tar.gz: fa4f652d48e128ced317f38bb8e7aed4e919fff8f0ad5e0407236315ebf7901d9ddc9cf4882e3c4df0779982ff6b1d4cf6c55d5603e09b307a19a7c89f116380
data/lib/scms.rb CHANGED
@@ -36,7 +36,9 @@ module Scms
36
36
  ScmsUtils.log(e.backtrace.inspect )
37
37
  end
38
38
  else
39
- ScmsUtils.log("Bootstrap does not exist #{bootstrap}")
39
+ ScmsUtils.errLog("Bootstrap does not exist #{@settings["bootstrap"]}")
40
+ ScmsUtils.writelog("::Bootstrap does not exist #{@settings["bootstrap"]}", @website)
41
+ ScmsUtils.writelog("type NUL > #{bootstrap}", @website)
40
42
  end
41
43
  end
42
44
 
@@ -93,7 +95,9 @@ module Scms
93
95
  #ScmsUtils.log( "_Resource found: #{pageconfig["resource"]}_" )
94
96
  resource = YAML.load_file(resourcepath)
95
97
  else
96
- ScmsUtils.errLog( "Resource not found: #{resourcepath}" )
98
+ ScmsUtils.errLog("Resource not found: #{pageconfig["resource"]}")
99
+ ScmsUtils.writelog("::Resource not found #{pageconfig["resource"]}", @website)
100
+ ScmsUtils.writelog("type NUL > #{resourcepath}", @website)
97
101
  end
98
102
  end
99
103
 
@@ -110,7 +114,9 @@ module Scms
110
114
  ScmsUtils.errLog( "Handler doesnt have a render method" )
111
115
  end
112
116
  else
113
- ScmsUtils.errLog( "**Handler not found: #{handlerpath}**" )
117
+ ScmsUtils.errLog("Handler not found: #{pageconfig["handler"]}")
118
+ ScmsUtils.writelog("::Handler not found #{pageconfig["handler"]}", @website)
119
+ ScmsUtils.writelog("type NUL > #{handlerpath}", @website)
114
120
  end
115
121
  end
116
122
 
@@ -162,7 +168,8 @@ module Scms
162
168
  end
163
169
  else
164
170
  ScmsUtils.errLog("View not found: #{view[0]} - #{view[1]} [#{viewpath}]")
165
- ScmsUtils.writelog("View not found: #{view[0]} - #{view[1]} [#{viewpath}]", @website)
171
+ ScmsUtils.writelog("::View not found: #{view[0]} - #{view[1]} [#{viewpath}]", @website)
172
+ ScmsUtils.writelog("type NUL > #{viewpath}", @website)
166
173
  end
167
174
  #ScmsUtils.log( "view = #{view[0]} - #{view[1]}" )
168
175
  end
@@ -187,13 +194,15 @@ module Scms
187
194
  :rootdir => @website,
188
195
  :monkeyhook => monkeyhook
189
196
  }
190
-
197
+
198
+ break if pageconfig["generate"] == nil
199
+
191
200
  erb = File.join(@website, skin)
192
- out = File.join(@website, File.join(pageconfig["generate"].sub('~/',''))) unless pageconfig["generate"] == nil
201
+ out = File.join(@website, File.join(pageconfig["generate"].sub('~/','')))
193
202
 
194
203
  ScmsUtils.successLog("#{pageurl}")
195
- ScmsUtils.errLog("Template doesn't exist: #{erb}") unless File.exists?(erb)
196
- if File.exists?(erb) && out != nil
204
+
205
+ if File.exists?(erb)
197
206
  pubsubdir = File.dirname(out)
198
207
  Dir.mkdir(pubsubdir, 755) unless File::directory?(pubsubdir)
199
208
 
@@ -210,6 +219,10 @@ module Scms
210
219
  html = html.gsub('~/', websiteroot)
211
220
 
212
221
  File.open(out, 'w') {|f| f.write(html) }
222
+ else
223
+ ScmsUtils.errLog("Template doesn't exist: #{skin}")
224
+ ScmsUtils.writelog("::Template doesn't exist #{skin}", @website)
225
+ ScmsUtils.writelog("type NUL > #{erb}", @website)
213
226
  end
214
227
  end
215
228
  end
@@ -226,7 +239,6 @@ module Scms
226
239
  result = ERB.new(template).result(page.instance_eval { binding })
227
240
  rescue Exception => e
228
241
  ScmsUtils.errLog("Critical Error: Could not parse template")
229
- ScmsUtils.log( "(if your using resources make sure their not empty)" )
230
242
  ScmsUtils.errLog( e.message )
231
243
  end
232
244
 
@@ -251,11 +263,14 @@ module Scms
251
263
  if files != nil
252
264
  files.each do |asset|
253
265
  assetList += "\t#{asset}\n"
254
- assetname = File.join(@website, asset)
255
- if File::exists?(assetname)
256
- content = content + "\n" + File.read(assetname)
266
+ assetdir = File.join(@website, asset)
267
+ if File::exists?(assetdir)
268
+ #try catch for permisions
269
+ content = content + "\n" + File.read(assetdir)
257
270
  else
258
- ScmsUtils.errLog( "Error: No such file #{assetname}" )
271
+ ScmsUtils.errLog( "Asset file doesn't exists: #{asset}" )
272
+ ScmsUtils.writelog("::Asset file doesn't exists: #{asset}", @website)
273
+ ScmsUtils.writelog("type NUL > #{assetdir}", @website)
259
274
  end
260
275
  end
261
276
  ScmsUtils.log("#{assetList}")
@@ -302,6 +317,10 @@ module Scms
302
317
  ScmsUtils.errLog( "Error processing: #{asset}" )
303
318
  ScmsUtils.errLog( e.message )
304
319
  end
320
+ else
321
+ ScmsUtils.errLog("Sass file doesn't exists: #{asset}")
322
+ ScmsUtils.writelog("::Sass file doesn't exist #{asset}", @website)
323
+ ScmsUtils.writelog("type NUL > #{asset}", @website)
305
324
  end
306
325
  end
307
326
 
@@ -316,6 +335,10 @@ module Scms
316
335
  ScmsUtils.errLog( "Error processing: #{asset}" )
317
336
  ScmsUtils.errLog( e.message )
318
337
  end
338
+ else
339
+ ScmsUtils.errLog("Asset file doesn't exist: #{asset}")
340
+ ScmsUtils.writelog("::Asset file doesn't exist #{asset}", @website)
341
+ ScmsUtils.writelog("type NUL > #{asset}", @website)
319
342
  end
320
343
  end
321
344
 
data/lib/scms/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Scms
2
- VERSION = "2.0.7"
2
+ VERSION = "2.0.8"
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: 2.0.7
4
+ version: 2.0.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - Courtenay Probert