Procházet zdrojové kódy

Clean up runner.js

tags/0.4.0
Michael Jackson před 14 roky
rodič
revize
9867b8d917
2 změnil soubory, kde provedl 13 přidání a 19 odebrání
  1. +0
    -3
      Rakefile
  2. +13
    -16
      test/mustache_spec.rb

+ 0
- 3
Rakefile Zobrazit soubor

@@ -1,9 +1,6 @@
require 'rake'
require 'rake/clean'

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

task :default => :spec

desc "Run all specs"


+ 13
- 16
test/mustache_spec.rb Zobrazit soubor

@@ -249,22 +249,19 @@ describe "mustache" do
end

def run_js(runner, js)
send(runner, js)
end

def run_js_js(js)
File.open("runner.js", 'w') {|f| f << js}
`#{JS_PATH} runner.js`
end

def run_js_jsc(js)
File.open("runner.js", 'w') {|f| f << js}
`#{JSC_PATH} runner.js`
end
cmd = case runner
when :run_js_js
JS_PATH
when :run_js_jsc
JSC_PATH
when :run_js_rhino
"java #{RHINO_JAR}"
end

def run_js_rhino(js)
File.open("runner.js", 'w') {|f| f << js}
`java #{RHINO_JAR} runner.js`
runner_file = "runner.js"
File.open(runner_file, 'w') {|f| f << js}
`#{cmd} #{runner_file}`
ensure
FileUtils.rm_r(runner_file)
end
end


Načítá se…
Zrušit
Uložit