10行代码实现coffeescript全自动编译成js(linux/mac os)

2014-12-28 0 933
10行代码实现coffeescript全自动编译成js(linux/mac os)
require 'fssm'

FILE_PATH = '/home/yourpath/'

def compile(path)
	system "coffee -c #{path}"
end

FSSM.monitor FILE_PATH,'**/*.coffee' do
  update {|base, relative| compile "#{base}/#{relative}"}
  delete {|base, relative| system "rm #{base}/#{relative}".sub(/\.coffee$/,'.js')}
  create {|base, relative| compile "#{base}/#{relative}"}
end

遇见资源网 ruby 10行代码实现coffeescript全自动编译成js(linux/mac os) http://www.ox520.com/16214.html

常见问题

相关文章

发表评论
暂无评论
官方客服团队

为您解决烦忧 - 24小时在线 专业服务