/ Published in: Other
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
#!/usr/bin/env ruby $LOAD_PATH << "#{ENV["TM_SUPPORT_PATH"]}/lib" require "web_preview" class SymfonyDocTest attr_reader :root_dir, :test_file def initialize(args=ENV) @root_dir = ENV['TM_PROJECT_DIRECTORY'] @test_file = ENV['TM_FILEPATH'] end def appname 'frontend' end def test_file @test_file.split(@root_dir +'/') end def run Dir.chdir @root_dir do system "symfony doctest #{appname} #{@test_file}" end end end dt = SymfonyDocTest.new html_header "DocTest - #{dt.test_file}" puts "<pre><code>" dt.run html_footer