jasmine/bin/jasmine

26 lines
923 B
Ruby
Executable File

#!/usr/bin/env ruby
require 'rubygems'
cwd = File.expand_path(File.join(File.dirname(__FILE__), '..'))
require File.expand_path(File.join(cwd, "lib", "jasmine-ruby", "jasmine_helper.rb"))
#to load JasmineHelper overrides
if ARGV[1]
require File.expand_path(File.join(Dir.pwd, ARGV[1]))
end
if ARGV[0] == 'server'
require File.expand_path(File.join(cwd, "jasmine/contrib/ruby/jasmine_spec_builder"))
puts "your tests are here:"
puts " http://localhost:8888/run.html"
Jasmine::SimpleServer.start(8888,
lambda { JasmineHelper.specs },
JasmineHelper.dir_mappings,
:spec_helpers => JasmineHelper.spec_helpers)
end
if ARGV[0] == 'init'
require 'ftools'
File.makedirs('spec')
dest_dir = File.expand_path(File.join(Dir.pwd, 'spec'))
File.copy(File.expand_path(File.join(cwd, 'templates/example_spec.js')), dest_dir)
end