1 Star 0 Fork 0

yuhai / follow

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
Rakefile 1.43 KB
一键复制 编辑 原始数据 按行查看 历史
require 'json'
LIBRARY = [ "api.js", "feed.js", "lib.js", "cli.js" ]
BROWSER_TOOLS = Dir.glob("browser/*").select{|x| x != "browser/export.js" }
task :default => :export
desc 'Export Follow for use in web browsers'
task :export => ([:clean, "cli.js"] + LIBRARY + BROWSER_TOOLS) do |task|
build = "./build"
target = "#{build}/follow"
sh "mkdir", "-p", target
LIBRARY.each do |js|
sh "node", "browser/export.js", js, "#{target}/#{js}"
end
BROWSER_TOOLS.each do |file|
sh "cp", file, build
end
# EventEmitter2 needs wrapping.
sh "node", "browser/export.js", "browser/eventemitter2.js", "#{build}/eventemitter2.js"
File.open("#{build}/boot.js", 'w') do |boot|
requirejs_paths = { 'request' => 'request.jquery',
'events' => 'eventemitter2',
# 'foo' => 'bar', etc.
}
opts = { # 'baseUrl' => "follow",
'paths' => requirejs_paths,
}
main_js = "main.js"
boot.write([ 'require(',
'// Options',
opts.to_json() + ',',
'',
'// Modules',
[main_js].to_json() + ',',
'',
'// Code to run when ready',
'function(main) { return main(); }',
');'
].join("\n"));
end
end
desc 'Clean up build files'
task :clean do
sh "rm", "-rf", "./build"
end
1
https://gitee.com/yh14232988/follow.git
git@gitee.com:yh14232988/follow.git
yh14232988
follow
follow
master

搜索帮助