appmake 0.0.29 → 0.0.30

Sign up to get free protection for your applications and to get access to all the features.
data/lib/appmake.rb CHANGED
@@ -32,8 +32,7 @@ module Appmake
32
32
 
33
33
  desc "watch", "watch for files to compile"
34
34
  def watch
35
- js_listener = Listeners::Js.new
36
- js_listener.start
35
+ Listeners::Js.listen(false)
37
36
  end
38
37
  end
39
38
  end
@@ -3,17 +3,15 @@ require "listen"
3
3
  module Appmake
4
4
  module Listeners
5
5
  class Js
6
- def initialize
7
- listener = Listen.to "js", :filter => /\.js$/
8
- listener.change(&callback)
9
- listener
10
- end
11
-
12
- def callback
13
- Proc.new do |modified, added, removed|
6
+ def self.listen(bg = false)
7
+ callback = Proc.new do |modified, added, removed|
14
8
  puts "=> rebuilding JS"
15
9
  system("node bin/compile_templates.js")
16
10
  end
11
+
12
+ listener = Listen.to "js", :filter => /\.js$/
13
+ listener.change(&callback)
14
+ listener.start(bg)
17
15
  end
18
16
  end
19
17
  end
@@ -1,3 +1,3 @@
1
1
  module Appmake
2
- VERSION = "0.0.29"
2
+ VERSION = "0.0.30"
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.29
4
+ version: 0.0.30
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors: