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 'ejs'
|
||||||
|
|
||||||
gem 'simplecov'
|
gem 'simplecov'
|
||||||
|
#gem 'perftools.rb'
|
||||||
|
|
||||||
|
@ -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
|
||||||
|
@ -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'
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user