Permalink
Browse files

Loads an optional second command line var to monkey patch jasminehelper

  • Loading branch information...
1 parent add3e1e commit 75bb56f294c40ab70d021e655a9bd6db39de9e04 @ragaskar ragaskar committed Oct 15, 2009
Showing with 9 additions and 6 deletions.
  1. +6 −3 bin/jasmine
  2. +3 −3 lib/jasmine-ruby/jasmine_helper.rb
View
9 bin/jasmine
@@ -1,16 +1,19 @@
#!/usr/bin/env ruby
require File.expand_path(File.join(File.dirname(__FILE__), "..", "lib", "jasmine-ruby", "jasmine_helper.rb"))
+if ARGV[1]
+ require File.expand_path(File.join(Dir.pwd, ARGV[1]))
+end
if ARGV[0] == 'server'
require 'rubygems'
- require File.expand_path(File.join(JasmineHelper.jasmine_root, "contrib/ruby/jasmine_spec_builder"))
+ require File.expand_path(File.join(__FILE__, "../../jasmine/contrib/ruby/jasmine_spec_builder"))
puts "your tests are here:"
puts " http://localhost:8888/run.html"
- JASMINE_SPEC_DIR = ARGV[1] || File.join(`pwd`.chomp, "spec")
+ JASMINE_SPEC_DIR = ARGV[1] || File.join(Dir.pwd, "spec")
Jasmine::SimpleServer.start(8888,
- lambda { JasmineHelper.spec_file_urls },
+ lambda { JasmineHelper.specs },
JasmineHelper.dir_mappings)
end
#
View
6 lib/jasmine-ruby/jasmine_helper.rb
@@ -29,12 +29,12 @@ def self.jasmine_spec_dir
end
end
- def self.raw_spec_files
+ def self.spec_files
Dir.glob(File.join(jasmine_spec_dir, "**/*[Ss]pec.js"))
end
- def self.spec_file_urls
- raw_spec_files.collect {|f| f.sub(jasmine_spec_dir, "/spec")}
+ def self.specs
+ spec_files.collect {|f| f.sub(jasmine_spec_dir, "/spec")}
end
def self.dir_mappings

0 comments on commit 75bb56f

Please sign in to comment.