scms 1.7.8

Sign up to get free protection for your applications and to get access to all the features.
Files changed (69) hide show
  1. checksums.yaml +7 -0
  2. data/README.md +0 -0
  3. data/assets/blank-app-template/application.xml +57 -0
  4. data/assets/blank-app-template/cert.p12 +0 -0
  5. data/assets/blank-app-template/config.yml +32 -0
  6. data/assets/blank-app-template/debug.cmd +6 -0
  7. data/assets/blank-app-template/package.cmd +16 -0
  8. data/assets/blank-app-template/public/ico/favicon.ico +0 -0
  9. data/assets/blank-app-template/public/ico/logo-128.png +0 -0
  10. data/assets/blank-app-template/public/ico/logo-16.png +0 -0
  11. data/assets/blank-app-template/public/ico/logo-32.png +0 -0
  12. data/assets/blank-app-template/public/ico/logo-48.png +0 -0
  13. data/assets/blank-app-template/public/images/glyphicons-halflings-white.png +0 -0
  14. data/assets/blank-app-template/public/images/glyphicons-halflings.png +0 -0
  15. data/assets/blank-app-template/public/robots.txt +4 -0
  16. data/assets/blank-app-template/public/scripts/air/AIRAliases.js +240 -0
  17. data/assets/blank-app-template/public/scripts/air/AIRIntrospector.js +1949 -0
  18. data/assets/blank-app-template/public/scripts/air/AIRMenuBuilder.js +1322 -0
  19. data/assets/blank-app-template/public/scripts/air/applicationupdater.swf +0 -0
  20. data/assets/blank-app-template/public/scripts/air/applicationupdater_ui.swf +0 -0
  21. data/assets/blank-app-template/public/scripts/air/servicemonitor.swf +0 -0
  22. data/assets/blank-app-template/public/scripts/libs/bootstrap.js +2027 -0
  23. data/assets/blank-app-template/public/scripts/libs/jquery-1.8.2.min.js +2 -0
  24. data/assets/blank-app-template/public/scripts/libs/jquery.fn.custom.js +67 -0
  25. data/assets/blank-app-template/public/scripts/libs/knockout-2.1.0-min.js +86 -0
  26. data/assets/blank-app-template/public/scripts/presenters/dashboard-presenter.js +3 -0
  27. data/assets/blank-app-template/public/scripts/presenters/global-presenter.js +8 -0
  28. data/assets/blank-app-template/public/scripts/shared/data-persistance.js +22 -0
  29. data/assets/blank-app-template/public/scripts/shared/utils.js +107 -0
  30. data/assets/blank-app-template/public/stylesheets/bootstrap-responsive.css +1058 -0
  31. data/assets/blank-app-template/public/stylesheets/bootstrap.css +5774 -0
  32. data/assets/blank-app-template/public/stylesheets/style.css +0 -0
  33. data/assets/blank-app-template/s3config.template.yml +9 -0
  34. data/assets/blank-app-template/templates/menu.xml +5 -0
  35. data/assets/blank-app-template/templates/skin.erb.html +84 -0
  36. data/assets/blank-app-template/tools/msxsl.exe +0 -0
  37. data/assets/blank-app-template/tools/update-descriptor.xsl +18 -0
  38. data/assets/blank-app-template/tools/version.xsl +10 -0
  39. data/assets/blank-app-template/views/about.html +15 -0
  40. data/assets/blank-app-template/views/dashboard.html +7 -0
  41. data/assets/blank-template/config.yml +30 -0
  42. data/assets/blank-template/public/images/glyphicons-halflings-white.png +0 -0
  43. data/assets/blank-template/public/images/glyphicons-halflings.png +0 -0
  44. data/assets/blank-template/public/robots.txt +4 -0
  45. data/assets/blank-template/public/scripts/air-monkey-hook.js +63 -0
  46. data/assets/blank-template/public/scripts/bootstrap.js +2027 -0
  47. data/assets/blank-template/public/scripts/jquery-1.8.2.min.js +2 -0
  48. data/assets/blank-template/public/scripts/script.js +0 -0
  49. data/assets/blank-template/public/stylesheets/bootstrap-responsive.css +1058 -0
  50. data/assets/blank-template/public/stylesheets/bootstrap.css +5774 -0
  51. data/assets/blank-template/public/stylesheets/style.css +0 -0
  52. data/assets/blank-template/s3config.template.yml +10 -0
  53. data/assets/blank-template/templates/menu.xml +5 -0
  54. data/assets/blank-template/templates/skin.erb.html +108 -0
  55. data/assets/blank-template/views/about-intro.html +1 -0
  56. data/assets/blank-template/views/about-main.html +2 -0
  57. data/assets/blank-template/views/home-intro.html +3 -0
  58. data/assets/blank-template/views/home-main.html +15 -0
  59. data/assets/mime.types +68 -0
  60. data/bin/scms +127 -0
  61. data/lib/scms.rb +426 -0
  62. data/lib/scms/s3deploy.rb +45 -0
  63. data/lib/scms/scms_utils.rb +73 -0
  64. data/lib/scms/version.rb +3 -0
  65. data/scms.gemspec +24 -0
  66. data/scripts/build.bat +4 -0
  67. data/staticcms.sublime-project +8 -0
  68. data/staticcms.sublime-workspace +417 -0
  69. metadata +180 -0
@@ -0,0 +1,45 @@
1
+ module S3Deploy
2
+ VERSION = '1.0.0'
3
+ require "scms/scms_utils.rb"
4
+
5
+ def S3Deploy.sync(pub, config)
6
+ @pub = pub
7
+ ENV["S3CONF"] = config
8
+ ENV["AWS_CALLING_FORMAT"] = "SUBDOMAIN"
9
+ #ENV["SSL_CERT_DIR"] = File.join($website, "s3certs")
10
+ ENV["S3SYNC_MIME_TYPES_FILE"] = File.join(Folders[:root], "assets", "mime.types")
11
+
12
+ yamlpath=File.join(config, "s3config.yml")
13
+ #ScmsUtils.log( "Getting s3sync settings: \n#{yamlpath}\n\n")
14
+ $settings = YAML.load_file(yamlpath)
15
+
16
+ ScmsUtils.log( "Syncing with Amazon S3: **#{$settings['bucket']}**" )
17
+
18
+ removeold = "--delete"
19
+ if $settings['clean'] != nil
20
+ unless $settings['clean']
21
+ removeold = ""
22
+ end
23
+ end
24
+
25
+ cmd = "s3sync"
26
+ cache = "--cache-control='max-age=31449600'"
27
+ params = "--exclude='.svn' --progress --make-dirs --recursive --public-read #{removeold} #{cache} \"#{@pub}/\" #{$settings['bucket']}:/"
28
+ if $settings['cache'] != nil
29
+ $settings['cache'].each do |folder|
30
+ ScmsUtils.log( "Syncing **#{folder}** caching: 1 year" )
31
+ ScmsUtils.run(cmd, params)
32
+ end
33
+ end
34
+
35
+ cache = ""
36
+ ScmsUtils.log( "Syncing **root** no caching" )
37
+ ScmsUtils.run(cmd, params)
38
+
39
+ ScmsUtils.successLog("**Deployed :)**")
40
+
41
+ if $settings['uri'] != nil
42
+ ScmsUtils.log("[_#{$settings['uri']}_](#{$settings['uri']})")
43
+ end
44
+ end
45
+ end
@@ -0,0 +1,73 @@
1
+ module ScmsUtils
2
+ require 'find'
3
+ require 'fileutils'
4
+ require 'maruku'
5
+ require 'open-uri'
6
+
7
+ def ScmsUtils.run(cmd, params)
8
+ if system("#{cmd} #{params}")
9
+ ScmsUtils.successLog( "**#{cmd} ran successfully**" )
10
+ else
11
+ raise "Error running #{cmd}"
12
+ end
13
+ end
14
+
15
+ def ScmsUtils.errLog(msg)
16
+ if !msg.nil?
17
+ if $html == "true"
18
+ doc = Maruku.new(msg)
19
+ puts "<span style='color: red;'>#{doc.to_html}</span>"
20
+ else
21
+ puts msg
22
+ end
23
+ end
24
+ end
25
+
26
+ def ScmsUtils.successLog(msg)
27
+ if !msg.nil?
28
+ if $html == "true"
29
+ doc = Maruku.new(msg)
30
+ puts "<span style='color: green;'>#{doc.to_html}</span>"
31
+ else
32
+ puts msg
33
+ end
34
+ end
35
+ end
36
+
37
+ def ScmsUtils.log(msg)
38
+ if !msg.nil?
39
+ if $html == "true"
40
+ doc = Maruku.new(msg)
41
+ puts doc.to_html
42
+ else
43
+ puts msg
44
+ end
45
+ end
46
+ end
47
+
48
+ def ScmsUtils.writelog(pub, log)
49
+ if !pub.nil? && !log.nil?
50
+ open(File.join(pub, "build.log"), 'a') { |f|
51
+ f.puts log
52
+ }
53
+ end
54
+ end
55
+
56
+ def ScmsUtils.txt_2_html(rawsnippet)
57
+ if rawsnippet != nil
58
+ rawsnippet.gsub!(/(http:\/\/\S+)/, '<a href="\1" target="_blank" ref="external">\1</a>')
59
+ rawsnippet.gsub!(/\n/, "<br />")
60
+ end
61
+
62
+ return rawsnippet
63
+ end
64
+
65
+ def ScmsUtils.uriEncode(uri)
66
+ return uri.gsub(" ", "%20")
67
+ end
68
+
69
+ def ScmsUtils.uriDecode(uri)
70
+ return uri.gsub("%20", " ")
71
+ end
72
+
73
+ end
@@ -0,0 +1,3 @@
1
+ module StaticCMS
2
+ VERSION = '1.7.8'
3
+ end
data/scms.gemspec ADDED
@@ -0,0 +1,24 @@
1
+ # -*- encoding: utf-8 -*-
2
+
3
+ $:.push File.expand_path("../lib", __FILE__)
4
+ require 'scms/version'
5
+
6
+ Gem::Specification.new do |s|
7
+ s.name = 'scms'
8
+ s.version = StaticCMS::VERSION
9
+ s.date = '2013-06-29'
10
+ s.homepage = 'https://github.com/cprobert/Static-CMS'
11
+ s.summary = "Create simple static websites, in a jiffy"
12
+ s.description = "A gem for creating static html websites"
13
+ s.authors = ["Courtenay Probert"]
14
+ s.email = 'courtenay@probert.me.uk'
15
+ s.files = Dir.glob("**/*")
16
+
17
+ s.add_dependency "aproxacs-s3sync"
18
+ s.add_dependency "nokogiri"
19
+ s.add_dependency "maruku"
20
+ s.add_dependency "sass"
21
+ s.add_dependency "packr"
22
+
23
+ s.executables << 'scms'
24
+ end
data/scripts/build.bat ADDED
@@ -0,0 +1,4 @@
1
+ @echo off
2
+ cd ..
3
+ gem build scms.gemspec
4
+ pause
@@ -0,0 +1,8 @@
1
+ {
2
+ "folders":
3
+ [
4
+ {
5
+ "path": "/I/Code/GitHub/Static-CMS"
6
+ }
7
+ ]
8
+ }
@@ -0,0 +1,417 @@
1
+ {
2
+ "auto_complete":
3
+ {
4
+ "selected_items":
5
+ [
6
+ [
7
+ "margin",
8
+ "margin-bottom"
9
+ ],
10
+ [
11
+ "con",
12
+ "console"
13
+ ],
14
+ [
15
+ "re",
16
+ "resolvePath"
17
+ ],
18
+ [
19
+ "local",
20
+ "local"
21
+ ],
22
+ [
23
+ "we",
24
+ "websiteService"
25
+ ],
26
+ [
27
+ "t",
28
+ "temp"
29
+ ],
30
+ [
31
+ "has",
32
+ "hasBuildDirSetting"
33
+ ],
34
+ [
35
+ "website",
36
+ "websites"
37
+ ],
38
+ [
39
+ "fa",
40
+ "false"
41
+ ],
42
+ [
43
+ "air",
44
+ "air-monkey"
45
+ ],
46
+ [
47
+ "web",
48
+ "Websites"
49
+ ],
50
+ [
51
+ "ex",
52
+ "exists"
53
+ ],
54
+ [
55
+ "is",
56
+ "isApp"
57
+ ],
58
+ [
59
+ "par",
60
+ "param"
61
+ ],
62
+ [
63
+ "he",
64
+ "height"
65
+ ],
66
+ [
67
+ "h",
68
+ "height"
69
+ ],
70
+ [
71
+ "w",
72
+ "width"
73
+ ],
74
+ [
75
+ "native",
76
+ "nativeWindow"
77
+ ],
78
+ [
79
+ "pre",
80
+ "preventDefault"
81
+ ],
82
+ [
83
+ "nat",
84
+ "nativePath"
85
+ ],
86
+ [
87
+ "webs",
88
+ "websiteFolder"
89
+ ],
90
+ [
91
+ "s",
92
+ "saveWebsites"
93
+ ],
94
+ [
95
+ "get",
96
+ "getWebsites"
97
+ ],
98
+ [
99
+ "view",
100
+ "viewObj"
101
+ ],
102
+ [
103
+ "hea",
104
+ "header"
105
+ ],
106
+ [
107
+ "c",
108
+ "currentVersion"
109
+ ]
110
+ ]
111
+ },
112
+ "buffers":
113
+ [
114
+ ],
115
+ "build_system": "",
116
+ "command_palette":
117
+ {
118
+ "height": 58.0,
119
+ "selected_items":
120
+ [
121
+ ],
122
+ "width": 416.0
123
+ },
124
+ "console":
125
+ {
126
+ "height": 0.0
127
+ },
128
+ "distraction_free":
129
+ {
130
+ "menu_visible": true,
131
+ "show_minimap": false,
132
+ "show_open_files": false,
133
+ "show_tabs": false,
134
+ "side_bar_visible": false,
135
+ "status_bar_visible": false
136
+ },
137
+ "file_history":
138
+ [
139
+ "/I/Code/cs-scripts/QSonic/orderdate.csx",
140
+ "/C/Code/static_cms/air-monkey/update-config.xml",
141
+ "/C/Code/static_cms/air-monkey/package.bat",
142
+ "/C/Code/static_cms/air-monkey/commands/air-monkey-deploy.cmd",
143
+ "/C/Code/static_cms/air-monkey/commands/air-monkey-build.cmd",
144
+ "/C/Code/static_cms/air-monkey/assets/scripts/modules/website-service.js",
145
+ "/C/Code/static_cms/air-monkey/assets/scripts/modules/app.js",
146
+ "/C/Code/static_cms/air-monkey/assets/scripts/handlers/cms-handler.js",
147
+ "/C/Code/static_cms/air-monkey/assets/scripts/handlers/index-handler.js",
148
+ "/C/Code/static_cms/air-monkey/index.html",
149
+ "/C/Code/static_cms/air-monkey/cms.html",
150
+ "/C/Code/static_cms/air-monkey/assets/scripts/ckeditor-config.js",
151
+ "/C/Code/static_cms/air-monkey/assets/stylesheets/bootstrap.buttons.min.css",
152
+ "/C/Code/static_cms/air-monkey/assets/scripts/libs/yepnope.1.5.4-min.js",
153
+ "/C/Code/static_cms/air-monkey/web-loader.html",
154
+ "/C/Code/static_cms/air-monkey/assets/ckeditor/contents.css",
155
+ "/C/Code/static_cms/air-monkey/assets/scripts/modules/native-updater.js",
156
+ "/C/Code/static_cms/air-monkey/assets/scripts/modules/systray.js",
157
+ "/C/Code/static_cms/air-monkey/assets/scripts/modules/netmon.js",
158
+ "/C/Code/static_cms/air-monkey/assets/scripts/handlers/global.js",
159
+ "/C/Code/static_cms/air-monkey/assets/scripts/utils.js",
160
+ "/C/Users/cprobert/Dropbox/Code/Shout-On-Air/scripts/netmon.js",
161
+ "/C/Code/static_cms/air-monkey/assets/ckeditor/config.js",
162
+ "/C/Code/static_cms/air-monkey/assets/ckeditor/ckeditor.js",
163
+ "/C/Code/static_cms/air-monkey/assets/scripts/models/index.model.js",
164
+ "/C/Code/static_cms/air-monkey/assets/air/AIRAliases.js",
165
+ "/C/Users/cprobert/Dropbox/Websites/shout-on-air.probert.me.uk/compiled/index.html",
166
+ "/C/Users/cprobert/Dropbox/Companies/iTutor Tech/Websites/static-cms.ipassexam.com/views/deploy-intro.html",
167
+ "/C/Users/cprobert/Dropbox/Companies/iTutor Tech/Websites/static-cms.ipassexam.com/build/index.html",
168
+ "/C/Code/static_cms/air-monkey/assets/scripts/handlers/web-loader-handler.js",
169
+ "/C/Users/cprobert/AppData/Roaming/Sublime Text 2/Packages/User/Preferences.sublime-settings",
170
+ "/C/Users/cprobert/AppData/Roaming/Sublime Text 2/Packages/Default/Preferences.sublime-settings",
171
+ "/C/Code/static_cms/air-monkey/assets/scripts/prefs.js",
172
+ "/C/Code/static_cms/air-monkey/assets/scripts/libs/knockout-2.1.0-min.js",
173
+ "/C/Users/cprobert/Dropbox/Code/Flamingo/flamingo.rb",
174
+ "/C/Code/static_cms/air-monkey/assets/scripts/modules/ruby-check.js",
175
+ "/C/Code/static_cms/air-monkey/assets/scripts/global.js",
176
+ "/C/Code/static_cms/air-monkey/assets/scripts/libs/jquery.pubsub-1.0.js",
177
+ "/C/Code/static_cms/air-monkey/assets/scripts/modules/data-persistance.js",
178
+ "/C/Code/static_cms/air-monkey/assets/air/AIRIntrospector.js",
179
+ "/C/Code/static_cms/air-monkey/assets/scripts/index.js",
180
+ "/C/Code/static_cms/air-monkey/assets/scripts/air-monkey.model.js",
181
+ "/C/Code/static_cms/air-monkey/assets/scripts/native-updater.js",
182
+ "/C/Code/static_cms/air-monkey/assets/scripts/air-libs.js",
183
+ "/C/Code/static_cms/air-monkey/assets/scripts/ruby-check.js"
184
+ ],
185
+ "find":
186
+ {
187
+ "height": 34.0
188
+ },
189
+ "find_in_files":
190
+ {
191
+ "height": 0.0,
192
+ "where_history":
193
+ [
194
+ "C:\\Code\\static_cms\\air-monkey",
195
+ "C:\\Code\\static_cms\\air-monkey\\assets\\scripts",
196
+ "C:\\Code\\static_cms\\air-monkey"
197
+ ]
198
+ },
199
+ "find_state":
200
+ {
201
+ "case_sensitive": false,
202
+ "find_history":
203
+ [
204
+ "Syncing everything else",
205
+ "silksvn",
206
+ "Do not close this window",
207
+ "update-descriptor.xsl",
208
+ "static-cms.rb",
209
+ "air-monkey-build.cmd",
210
+ "config-peek",
211
+ "get-config-setting",
212
+ "config-peek",
213
+ "CodeMirror",
214
+ ">return<",
215
+ "return",
216
+ "z-index",
217
+ "modal-backdrop",
218
+ "<script type=\"text/javascript\" src=",
219
+ "></script>",
220
+ "bootstrap.css",
221
+ "view",
222
+ "../",
223
+ "app-version",
224
+ "message-head",
225
+ "modal-header",
226
+ "File does not exist:",
227
+ "<script type=\"text/javascript\" src=\"assets/scripts/handlers/global.js\"></script>",
228
+ "netmon",
229
+ "left",
230
+ "$(this).log",
231
+ "Opening pub: ",
232
+ "No index",
233
+ "engageBridge",
234
+ "Edit should build to temp dir",
235
+ "data.local",
236
+ "customBuildDirProcessor",
237
+ "getEditWebsitePubFolder",
238
+ "tempEditDir",
239
+ "air-monkey-build.cmd",
240
+ "customBuildDirProcessor",
241
+ "app.website.build",
242
+ "customBuildDirProcessor",
243
+ "getEditWebsitePubFolder",
244
+ "getDefaultWebsitePubFolder",
245
+ "console.log",
246
+ "engageBridge",
247
+ "console.log",
248
+ "html",
249
+ "console",
250
+ "Deploy",
251
+ "deployScript",
252
+ "getWebsitePubFolder",
253
+ "data",
254
+ "peek",
255
+ "getWebsitePubFolder",
256
+ "pub.createDirectory",
257
+ "Websites",
258
+ "websites",
259
+ "web",
260
+ "folders",
261
+ "Websites",
262
+ "websites",
263
+ "self",
264
+ "getWebsitePubFolder",
265
+ "compiled",
266
+ "wsGridVM.websites",
267
+ "stdOutVM.lines.push",
268
+ "stdOutVM.lines",
269
+ "push",
270
+ ".lines",
271
+ "stdOutVM",
272
+ "knockout-2.1.0-min.js",
273
+ "air.File.",
274
+ "folders",
275
+ "firstRun",
276
+ "prefs.isLaunch",
277
+ "app.folder.website",
278
+ "app.folder.websites",
279
+ "startNativeProcess",
280
+ "websiteService.getWebsitePubFolder(",
281
+ "app.folder.pub(",
282
+ "app.folder",
283
+ "app.data(",
284
+ "app.data",
285
+ "app.folder.pub",
286
+ "prefs.isLaunch",
287
+ "app.data",
288
+ "prefs.",
289
+ "prefs.winy",
290
+ "prefs.winx",
291
+ "popMsg",
292
+ "console.log",
293
+ "popMsg",
294
+ "setMessage",
295
+ "message",
296
+ "app.website.build",
297
+ "app.website.buiul",
298
+ "app.website.build",
299
+ "air-libs.js",
300
+ "showGrid",
301
+ "stdOutVM",
302
+ "$guiConsole",
303
+ "airMonkeyViewModel",
304
+ "publishing",
305
+ "Process Error:",
306
+ "app.data(\"firstRun\"",
307
+ "updateGems",
308
+ "app.data(\"firstRun\"",
309
+ "app.updateGems",
310
+ "prefs.firstRun",
311
+ "installUpdate",
312
+ "onUpdateInstall",
313
+ "$.publish"
314
+ ],
315
+ "highlight": true,
316
+ "in_selection": false,
317
+ "preserve_case": false,
318
+ "regex": false,
319
+ "replace_history":
320
+ [
321
+ "bootstrap.min.css",
322
+ "air.trace",
323
+ "getEditWebsitePubFolder",
324
+ "stdOutVM.print",
325
+ "websiteService.folders.website",
326
+ "websiteService.folders.websites",
327
+ "websiteService.getWebsitePubFolder(",
328
+ "data.local(",
329
+ "prefs.window.y",
330
+ "prefs.window.x",
331
+ "popMsg",
332
+ "utils.js",
333
+ "show",
334
+ "stdOutVM",
335
+ "wsGridVM"
336
+ ],
337
+ "reverse": false,
338
+ "show_context": true,
339
+ "use_buffer2": true,
340
+ "whole_word": false,
341
+ "wrap": true
342
+ },
343
+ "groups":
344
+ [
345
+ {
346
+ "sheets":
347
+ [
348
+ ]
349
+ }
350
+ ],
351
+ "incremental_find":
352
+ {
353
+ "height": 34.0
354
+ },
355
+ "input":
356
+ {
357
+ "height": 31.0
358
+ },
359
+ "layout":
360
+ {
361
+ "cells":
362
+ [
363
+ [
364
+ 0,
365
+ 0,
366
+ 1,
367
+ 1
368
+ ]
369
+ ],
370
+ "cols":
371
+ [
372
+ 0.0,
373
+ 1.0
374
+ ],
375
+ "rows":
376
+ [
377
+ 0.0,
378
+ 1.0
379
+ ]
380
+ },
381
+ "menu_visible": true,
382
+ "replace":
383
+ {
384
+ "height": 62.0
385
+ },
386
+ "save_all_on_build": true,
387
+ "select_file":
388
+ {
389
+ "height": 0.0,
390
+ "selected_items":
391
+ [
392
+ [
393
+ "in",
394
+ "assets/scripts/models/index.model.js"
395
+ ],
396
+ [
397
+ "indexmodel",
398
+ "assets/scripts/models/index.model.js"
399
+ ]
400
+ ],
401
+ "width": 0.0
402
+ },
403
+ "select_project":
404
+ {
405
+ "height": 0.0,
406
+ "selected_items":
407
+ [
408
+ ],
409
+ "width": 0.0
410
+ },
411
+ "show_minimap": true,
412
+ "show_open_files": false,
413
+ "show_tabs": true,
414
+ "side_bar_visible": true,
415
+ "side_bar_width": 211.0,
416
+ "status_bar_visible": true
417
+ }