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 'ejs'
gem 'simplecov' gem 'simplecov'
#gem 'perftools.rb'

View File

@ -203,7 +203,7 @@ module Jasmine::Headless
end end
def expanded_dir(path) 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 end
def extension_filter def extension_filter
@ -221,11 +221,11 @@ module Jasmine::Headless
end end
def src_dir def src_dir
config_dir_or_pwd('src_dir') @src_dir ||= config_dir_or_pwd('src_dir')
end end
def spec_dir def spec_dir
config_dir_or_pwd('spec_dir') @spec_dir ||= config_dir_or_pwd('spec_dir')
end end
def spec_file_searches def spec_file_searches

View File

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