appmake 0.0.31 → 0.0.32
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/appmake.rb +5 -1
- data/lib/appmake/listeners/css.rb +8 -4
- data/lib/appmake/listeners/js.rb +8 -4
- data/lib/appmake/listeners/tpl.rb +8 -4
- data/lib/appmake/version.rb +1 -1
- metadata +1 -1
data/lib/appmake.rb
CHANGED
@@ -30,13 +30,17 @@ module Appmake
|
|
30
30
|
|
31
31
|
empty_directory "public"
|
32
32
|
template "templates/public/index.html.tt", "public/index.html"
|
33
|
+
|
34
|
+
Listeners::Css.compile
|
35
|
+
Listeners::Js.compile
|
36
|
+
Listeners::Tpl.compile
|
33
37
|
end
|
34
38
|
|
35
39
|
desc "watch", "watch for files to compile"
|
36
40
|
def watch
|
37
41
|
Listeners::Css.listen(false)
|
38
42
|
Listeners::Js.listen(false)
|
39
|
-
Listeners::Tpl.listen()
|
43
|
+
Listeners::Tpl.listen(true)
|
40
44
|
end
|
41
45
|
end
|
42
46
|
end
|
@@ -3,15 +3,19 @@ require "listen"
|
|
3
3
|
module Appmake
|
4
4
|
module Listeners
|
5
5
|
class Css
|
6
|
-
def self.listen(
|
6
|
+
def self.listen(block = true)
|
7
7
|
callback = Proc.new do |modified, added, removed|
|
8
|
-
|
9
|
-
system("bundle exec sass css/app.scss css/app.css")
|
8
|
+
self.compile()
|
10
9
|
end
|
11
10
|
|
12
11
|
listener = Listen.to "css", :filter => /\.scss$/
|
13
12
|
listener.change(&callback)
|
14
|
-
listener.start(
|
13
|
+
listener.start(block)
|
14
|
+
end
|
15
|
+
|
16
|
+
def self.compile
|
17
|
+
puts "=> rebuilding CSS"
|
18
|
+
system("bundle exec sass css/app.scss css/app.css")
|
15
19
|
end
|
16
20
|
end
|
17
21
|
end
|
data/lib/appmake/listeners/js.rb
CHANGED
@@ -3,15 +3,19 @@ require "listen"
|
|
3
3
|
module Appmake
|
4
4
|
module Listeners
|
5
5
|
class Js
|
6
|
-
def self.listen(
|
6
|
+
def self.listen(block = true)
|
7
7
|
callback = Proc.new do |modified, added, removed|
|
8
|
-
|
9
|
-
system("node bin/compile_templates.js")
|
8
|
+
self.compile()
|
10
9
|
end
|
11
10
|
|
12
11
|
listener = Listen.to "js", :filter => /\.js$/
|
13
12
|
listener.change(&callback)
|
14
|
-
listener.start(
|
13
|
+
listener.start(block)
|
14
|
+
end
|
15
|
+
|
16
|
+
def self.compile
|
17
|
+
puts "=> rebuilding JS"
|
18
|
+
system("node bin/compile_templates.js")
|
15
19
|
end
|
16
20
|
end
|
17
21
|
end
|
@@ -3,15 +3,19 @@ require "listen"
|
|
3
3
|
module Appmake
|
4
4
|
module Listeners
|
5
5
|
class Tpl
|
6
|
-
def self.listen(
|
6
|
+
def self.listen(block = true)
|
7
7
|
callback = Proc.new do |modified, added, removed|
|
8
|
-
|
9
|
-
system("node js/compile_templates.js")
|
8
|
+
self.compile()
|
10
9
|
end
|
11
10
|
|
12
11
|
listener = Listen.to "tpl", :filter => /\.html$/
|
13
12
|
listener.change(&callback)
|
14
|
-
listener.start(
|
13
|
+
listener.start(block)
|
14
|
+
end
|
15
|
+
|
16
|
+
def self.compile
|
17
|
+
puts "=> rebuilding TPL"
|
18
|
+
system("node js/compile_templates.js")
|
15
19
|
end
|
16
20
|
end
|
17
21
|
end
|
data/lib/appmake/version.rb
CHANGED