appmake 0.0.31 → 0.0.32

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 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(bg = true)
6
+ def self.listen(block = true)
7
7
  callback = Proc.new do |modified, added, removed|
8
- puts "=> rebuilding CSS"
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(bg)
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
@@ -3,15 +3,19 @@ require "listen"
3
3
  module Appmake
4
4
  module Listeners
5
5
  class Js
6
- def self.listen(bg = true)
6
+ def self.listen(block = true)
7
7
  callback = Proc.new do |modified, added, removed|
8
- puts "=> rebuilding JS"
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(bg)
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(bg = true)
6
+ def self.listen(block = true)
7
7
  callback = Proc.new do |modified, added, removed|
8
- puts "=> rebuilding TPL"
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(bg)
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
@@ -1,3 +1,3 @@
1
1
  module Appmake
2
- VERSION = "0.0.31"
2
+ VERSION = "0.0.32"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: appmake
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.31
4
+ version: 0.0.32
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors: