small speed optimization
This commit is contained in:
parent
ee3b6e598c
commit
0d4562119f
2
Gemfile
2
Gemfile
@ -19,3 +19,5 @@ gem 'jquery-rails'
|
||||
gem 'ejs'
|
||||
|
||||
gem 'simplecov'
|
||||
#gem 'perftools.rb'
|
||||
|
||||
|
@ -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
|
||||
|
@ -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'
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user