scms 2.0.8 → 2.0.9
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +2 -0
- data/assets/mime.types +3 -1
- data/lib/scms.rb +9 -1
- data/lib/scms/scms-utils.rb +7 -0
- data/lib/scms/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b39434ffa4c1bbd9419277ac9d1df1147a93e2f7
|
4
|
+
data.tar.gz: ae6d56f657f22d9154be02cbdfaaa90fb185fb85
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9667ba1ff13349a6b2ae9121338adb126cb81252176fd1d0479416bd1f42e2f37910f87d1a759650b8ff2be957a94f8a4afa9ce382b7d5d910c7214c90df06ce
|
7
|
+
data.tar.gz: a79d5a45f8834fd1bf2ffe287eea2fba48ef34e7cd080fd5503fae2700c1d5fc6d2b96c7703f0a0976129690af9414b6999a9e84d0590bc4112c3b793aea250c
|
data/README.md
CHANGED
@@ -6,6 +6,8 @@ StaticCMS is a static website builder that creates html files from an eruby temp
|
|
6
6
|
It also has a few nifty features such as JavaScript and CSS bundeling and minimisation
|
7
7
|
When your happy with your website StaticCMS will also deploy to AmazonS3 setting approperate caching settings.
|
8
8
|
|
9
|
+
Find it useful? Then let me know: https://twitter.com/c_probert
|
10
|
+
|
9
11
|
### Installing
|
10
12
|
|
11
13
|
gem install scms
|
data/assets/mime.types
CHANGED
@@ -17,6 +17,8 @@ image/webp webp
|
|
17
17
|
|
18
18
|
font/otf otf
|
19
19
|
application/x-font-woff woff
|
20
|
+
application/x-font-ttf ttf
|
21
|
+
application/vnd.ms-fontobject eot
|
20
22
|
|
21
23
|
video/mpeg mpeg mpg
|
22
24
|
video/webm webm
|
@@ -39,6 +41,7 @@ audio/midi mid midi kar
|
|
39
41
|
audio/x-m4a m4a
|
40
42
|
audio/x-realaudio ra
|
41
43
|
|
44
|
+
application/json json
|
42
45
|
application/x-xpinstall xpi
|
43
46
|
application/xhtml+xml xhtml
|
44
47
|
application/x-shockwave-flash swf
|
@@ -53,7 +56,6 @@ application/x-7z-compressed 7z
|
|
53
56
|
application/x-rar-compressed rar
|
54
57
|
application/x-stuffit sit
|
55
58
|
application/octet-stream dmg
|
56
|
-
application/octet-stream eot
|
57
59
|
application/octet-stream iso img
|
58
60
|
application/octet-stream msi msp msm
|
59
61
|
application/msword doc dot
|
data/lib/scms.rb
CHANGED
@@ -93,6 +93,7 @@ module Scms
|
|
93
93
|
resourcepath = File.join(@website, pageconfig["resource"])
|
94
94
|
if File.exists?(resourcepath)
|
95
95
|
#ScmsUtils.log( "_Resource found: #{pageconfig["resource"]}_" )
|
96
|
+
#todo: error handeling
|
96
97
|
resource = YAML.load_file(resourcepath)
|
97
98
|
else
|
98
99
|
ScmsUtils.errLog("Resource not found: #{pageconfig["resource"]}")
|
@@ -126,6 +127,7 @@ module Scms
|
|
126
127
|
views[view[0]] = ""
|
127
128
|
viewpath = File.join(@website, view[1])
|
128
129
|
if File.exists?(viewpath)
|
130
|
+
#todo: error handeling
|
129
131
|
htmlsnipet = File.read(viewpath)
|
130
132
|
if !htmlsnipet.empty?
|
131
133
|
viewmodel = Hash.new
|
@@ -140,8 +142,10 @@ module Scms
|
|
140
142
|
|
141
143
|
if hasHandler
|
142
144
|
ScmsUtils.log("Rendering with handler")
|
145
|
+
#todo: error handeling
|
143
146
|
viewSnippet = Handler.render(viewpath)
|
144
147
|
else
|
148
|
+
#todo: why not use htmlsnipet
|
145
149
|
snnipetCode = File.read(viewpath)
|
146
150
|
case File.extname(view[1])
|
147
151
|
when ".md"
|
@@ -152,6 +156,7 @@ module Scms
|
|
152
156
|
viewSnippet = snnipetCode
|
153
157
|
puts e.message
|
154
158
|
puts e.backtrace.inspect
|
159
|
+
#todo: use scmslog
|
155
160
|
end
|
156
161
|
else
|
157
162
|
viewSnippet = snnipetCode
|
@@ -217,7 +222,7 @@ module Scms
|
|
217
222
|
websiteroot = @settings["url"] unless @settings["rooturl"] == nil
|
218
223
|
|
219
224
|
html = html.gsub('~/', websiteroot)
|
220
|
-
|
225
|
+
#todo: error handeling
|
221
226
|
File.open(out, 'w') {|f| f.write(html) }
|
222
227
|
else
|
223
228
|
ScmsUtils.errLog("Template doesn't exist: #{skin}")
|
@@ -240,6 +245,7 @@ module Scms
|
|
240
245
|
rescue Exception => e
|
241
246
|
ScmsUtils.errLog("Critical Error: Could not parse template")
|
242
247
|
ScmsUtils.errLog( e.message )
|
248
|
+
#todo: log error to build.log
|
243
249
|
end
|
244
250
|
|
245
251
|
return result
|
@@ -266,6 +272,7 @@ module Scms
|
|
266
272
|
assetdir = File.join(@website, asset)
|
267
273
|
if File::exists?(assetdir)
|
268
274
|
#try catch for permisions
|
275
|
+
#todo: error handeling
|
269
276
|
content = content + "\n" + File.read(assetdir)
|
270
277
|
else
|
271
278
|
ScmsUtils.errLog( "Asset file doesn't exists: #{asset}" )
|
@@ -276,6 +283,7 @@ module Scms
|
|
276
283
|
ScmsUtils.log("#{assetList}")
|
277
284
|
|
278
285
|
bundleDir = File.dirname(bundleName)
|
286
|
+
#todo: error handeling
|
279
287
|
Dir.mkdir(bundleDir, 755) unless File::directory?(bundleDir)
|
280
288
|
File.open(bundleName, 'w') {|f| f.write(content) }
|
281
289
|
if File.extname(bundleName) == ".js"
|
data/lib/scms/scms-utils.rb
CHANGED
@@ -6,6 +6,13 @@ module ScmsUtils
|
|
6
6
|
def ScmsUtils.getsettings(yamlpath)
|
7
7
|
ScmsUtils.log("Loading Config: #{ScmsUtils.uriEncode("file:///#{yamlpath}")}")
|
8
8
|
config = nil
|
9
|
+
|
10
|
+
#'kwalify'
|
11
|
+
#schema = Kwalify::Yaml.load_file('some_complex_schema.yaml')
|
12
|
+
#validator = Kwalify::Validator.new(schema)
|
13
|
+
#parser = Kwalify::Yaml::Parser.new(validator)
|
14
|
+
#yaml = some_complex_object.to_yaml # machine-generate
|
15
|
+
#data = parser.parse(yaml) # parse & validate <== FAIL
|
9
16
|
|
10
17
|
if File.exist?(yamlpath)
|
11
18
|
tree = File.read(yamlpath)
|
data/lib/scms/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: scms
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.0.
|
4
|
+
version: 2.0.9
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Courtenay Probert
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2013-
|
11
|
+
date: 2013-08-02 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: cprobert-s3sync
|
@@ -155,7 +155,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
155
155
|
version: '0'
|
156
156
|
requirements: []
|
157
157
|
rubyforge_project:
|
158
|
-
rubygems_version: 2.0.
|
158
|
+
rubygems_version: 2.0.6
|
159
159
|
signing_key:
|
160
160
|
specification_version: 4
|
161
161
|
summary: Create simple static websites, in a jiffy
|