plugins/client_pkg/client_pkg.rb in rsence-2.1.11 vs plugins/client_pkg/client_pkg.rb in rsence-2.2.0
- old
+ new
@@ -30,11 +30,11 @@
@last_time = Time.now
@log_path = log_path
@log_file = nil
end
def log( str )
- if RSence.args[:verbose]
+ if RSence.args[:verbose] or not RSence.args[:suppress_build_messages]
puts str
return
else
if @last_time < Time.now - 30
@last_time = Time.now
@@ -53,22 +53,28 @@
@log_file = nil
end
end
def rebuild_client
- until not @build_busy
- puts "build busy, sleeping.."
- sleep 0.5
+ while @build_busy
+ puts "-- build busy, sleeping.. --"
+ sleep 0.1
end
@build_busy = true
@last_change = Time.now.to_i
@client_build.setup_dirs
@client_build.run
+ @client_cache = ClientPkgCache.new
@client_cache.set_cache( @client_build.js, @client_build.gz, @client_build.themes )
+ RSence.plugin_manager.incr! if RSence.config[:transporter_conf][:client_autoreload]
@build_busy = false
end
+ def ready?
+ return (not @build_busy)
+ end
+
def open
if not @thr and RSence.args[:autoupdate]
@thr = Thread.new do
Thread.pass
while true
@@ -133,9 +139,13 @@
@build_logger.close
end
def squeeze( js )
return @client_build.squeeze( js )
+ end
+
+ def coffee( src )
+ return @client_build.coffee( src )
end
def init
@thr = false