appmake 0.0.18 → 0.0.19
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.
- data/lib/appmake.rb +44 -3
- metadata +1 -1
data/lib/appmake.rb
CHANGED
@@ -18,8 +18,15 @@ class Appmake
|
|
18
18
|
FileUtils.mkdir "css"
|
19
19
|
end
|
20
20
|
|
21
|
-
puts "=>
|
22
|
-
|
21
|
+
puts "=> create /css/app.scss"
|
22
|
+
f = File.new("/css/app.scss", "w+")
|
23
|
+
f.puts(APP_SCSS)
|
24
|
+
f.close
|
25
|
+
|
26
|
+
puts "=> create /css/body.scss"
|
27
|
+
f = File.new("/css/body.scss", "w+")
|
28
|
+
f.puts(BODY_SCSS)
|
29
|
+
f.close
|
23
30
|
|
24
31
|
unless Dir.exists? "js"
|
25
32
|
puts "=> mkdir /js"
|
@@ -31,7 +38,10 @@ class Appmake
|
|
31
38
|
FileUtils.mkdir "js/lib"
|
32
39
|
end
|
33
40
|
|
34
|
-
puts "=>
|
41
|
+
puts "=> create /js/app_tpl.js"
|
42
|
+
f = File.new("js/app_tpl.js")
|
43
|
+
f.puts(APP_TPL_JS)
|
44
|
+
f.close
|
35
45
|
FileUtils.touch "js/app_tpl.js"
|
36
46
|
|
37
47
|
puts "=> create /js/compile_templates.js"
|
@@ -54,6 +64,11 @@ class Appmake
|
|
54
64
|
f.puts(INDEX_HTML)
|
55
65
|
f.close
|
56
66
|
|
67
|
+
puts "=> create /tpl/welcome.html"
|
68
|
+
f = File.new("/tpl/welcome.html", "w+")
|
69
|
+
f.puts(WELCOME_HTML)
|
70
|
+
f.close
|
71
|
+
|
57
72
|
puts "=> rebuilding TPL"
|
58
73
|
system("node js/compile_templates.js")
|
59
74
|
|
@@ -311,4 +326,30 @@ INDEX_HTML = <<'EOS'
|
|
311
326
|
<script type="text/javascript" src="js/app.js"></script>
|
312
327
|
</body>
|
313
328
|
</html>
|
329
|
+
EOS
|
330
|
+
|
331
|
+
APP_TPL_JS = <<'EOS'
|
332
|
+
(function() {
|
333
|
+
var templates = require("./templates");
|
334
|
+
document.write(templates.welcome({title: "Appmake", description: "Welcome in Appmake example app"}));
|
335
|
+
}())
|
336
|
+
EOS
|
337
|
+
|
338
|
+
WELCOME_HTML = << 'EOS'
|
339
|
+
<h1>{{= it.title }}</h1>
|
340
|
+
<p>{{= it.description }}</p>
|
341
|
+
EOS
|
342
|
+
|
343
|
+
APP_SCSS = << 'EOS'
|
344
|
+
@import "body";
|
345
|
+
|
346
|
+
body {
|
347
|
+
color: $bodyColor;
|
348
|
+
background-color: $bodyBackgroundColor;
|
349
|
+
}
|
350
|
+
EOS
|
351
|
+
|
352
|
+
BODY_SCSS = << 'EOS'
|
353
|
+
$bodyColor: #A47;
|
354
|
+
$bodyBackgroundColor: #BCF;
|
314
355
|
EOS
|