small speed optimization

This commit is contained in:
John Bintz 2011-11-29 09:45:23 -05:00
parent ee3b6e598c
commit 0d4562119f
3 changed files with 10 additions and 3 deletions

View File

@ -19,3 +19,5 @@ gem 'jquery-rails'
gem 'ejs'
gem 'simplecov'
#gem 'perftools.rb'

View File

@ -203,7 +203,7 @@ module Jasmine::Headless
end
def expanded_dir(path)
Dir[path].collect { |file| File.expand_path(file) }.find_all { |path| File.file?(path) && path[extension_filter] }
Dir[path].find_all { |file| file[extension_filter] }.collect { |file| File.expand_path(file) }.find_all { |path| File.file?(path) }
end
def extension_filter
@ -221,11 +221,11 @@ module Jasmine::Headless
end
def src_dir
config_dir_or_pwd('src_dir')
@src_dir ||= config_dir_or_pwd('src_dir')
end
def spec_dir
config_dir_or_pwd('spec_dir')
@spec_dir ||= config_dir_or_pwd('spec_dir')
end
def spec_file_searches

View File

@ -3,6 +3,11 @@ if ENV['COVERAGE']
SimpleCov.start
end
if ENV['PROFILE']
require 'perftools'
PerfTools::CpuProfiler.start("/tmp/jhw-profile")
end
require 'jasmine-headless-webkit'
require 'fakefs/spec_helpers'