appmake 0.0.30 → 0.0.31

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,18 @@
1
+ require "listen"
2
+
3
+ module Appmake
4
+ module Listeners
5
+ class Css
6
+ def self.listen(bg = true)
7
+ callback = Proc.new do |modified, added, removed|
8
+ puts "=> rebuilding CSS"
9
+ system("bundle exec sass css/app.scss css/app.css")
10
+ end
11
+
12
+ listener = Listen.to "css", :filter => /\.scss$/
13
+ listener.change(&callback)
14
+ listener.start(bg)
15
+ end
16
+ end
17
+ end
18
+ end
@@ -3,7 +3,7 @@ require "listen"
3
3
  module Appmake
4
4
  module Listeners
5
5
  class Js
6
- def self.listen(bg = false)
6
+ def self.listen(bg = true)
7
7
  callback = Proc.new do |modified, added, removed|
8
8
  puts "=> rebuilding JS"
9
9
  system("node bin/compile_templates.js")
@@ -0,0 +1,18 @@
1
+ require "listen"
2
+
3
+ module Appmake
4
+ module Listeners
5
+ class Tpl
6
+ def self.listen(bg = true)
7
+ callback = Proc.new do |modified, added, removed|
8
+ puts "=> rebuilding TPL"
9
+ system("node js/compile_templates.js")
10
+ end
11
+
12
+ listener = Listen.to "tpl", :filter => /\.html$/
13
+ listener.change(&callback)
14
+ listener.start(bg)
15
+ end
16
+ end
17
+ end
18
+ end
@@ -1,3 +1,3 @@
1
1
  module Appmake
2
- VERSION = "0.0.30"
2
+ VERSION = "0.0.31"
3
3
  end
data/lib/appmake.rb CHANGED
@@ -1,6 +1,8 @@
1
1
  require "thor"
2
2
  require "appmake/version"
3
+ require "appmake/listeners/css"
3
4
  require "appmake/listeners/js"
5
+ require "appmake/listeners/tpl"
4
6
 
5
7
  module Appmake
6
8
  class Appmake < Thor
@@ -32,7 +34,9 @@ module Appmake
32
34
 
33
35
  desc "watch", "watch for files to compile"
34
36
  def watch
37
+ Listeners::Css.listen(false)
35
38
  Listeners::Js.listen(false)
39
+ Listeners::Tpl.listen()
36
40
  end
37
41
  end
38
42
  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.30
4
+ version: 0.0.31
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -91,7 +91,9 @@ files:
91
91
  - appmake.gemspec
92
92
  - bin/appmake
93
93
  - lib/appmake.rb
94
+ - lib/appmake/listeners/css.rb
94
95
  - lib/appmake/listeners/js.rb
96
+ - lib/appmake/listeners/tpl.rb
95
97
  - lib/appmake/version.rb
96
98
  - templates/bin/compile_templates.js.tt
97
99
  - templates/css/app.scss.tt