瀏覽代碼

Use rake/clean

tags/0.4.0
Michael Jackson 14 年之前
父節點
當前提交
89863d714b
共有 2 個文件被更改,包括 11 次插入10 次删除
  1. +9
    -7
      Rakefile
  2. +2
    -3
      test/mustache_spec.rb

+ 9
- 7
Rakefile 查看文件

@@ -1,4 +1,8 @@
require 'rake'
require 'rake/clean'

# See mustache_spec.rb
CLOBBER.include('runner.js')

task :default => :spec

@@ -23,13 +27,16 @@ def templated_build(name, opts={})
short = name.downcase
source = "mustache-#{short}"
dependencies = ["mustache.js"] + Dir.glob("#{source}/*.tpl.*")
target_js = opts[:location] ? "mustache.js" : "#{short}.mustache.js"

CLEAN.include(opts[:location] ? opts[:location] : target_js)

desc "Package for #{name}"
task short.to_sym => dependencies do
target_js = opts[:location] ? "mustache.js" : "#{short}.mustache.js"

puts "Packaging for #{name}"

mkdir_p opts[:location] if opts[:location]

sh "cat #{source}/#{target_js}.tpl.pre mustache.js \
#{source}/#{target_js}.tpl.post > #{opts[:location] || '.'}/#{target_js}"

@@ -49,8 +56,3 @@ templated_build "qooxdoo"
templated_build "Dojo", :location => "dojox/string"
templated_build "YUI3", :location => "yui3/mustache"
templated_build "requirejs"

desc "Remove temporary files."
task :clean do
sh "git clean -fdx"
end

+ 2
- 3
test/mustache_spec.rb 查看文件

@@ -175,8 +175,7 @@ describe "mustache" do
end

context "running in SpiderMonkey (Mozilla, Firefox)" do
p JS_PATH
if !JS_PATH.empty?
if File.exist?(JS_PATH)
before(:each) do
@run_js = :run_js_js
end
@@ -196,7 +195,7 @@ describe "mustache" do
end

context "running in JavaScriptCore (WebKit, Safari)" do
if File.exists?(JSC_PATH)
if File.exist?(JSC_PATH)
before(:each) do
@run_js = :run_js_jsc
end


Loading…
取消
儲存