diff options
author | Yves Senn <yves.senn@gmail.com> | 2013-01-06 00:05:25 +0100 |
---|---|---|
committer | Yves Senn <yves.senn@gmail.com> | 2013-01-10 17:09:06 +0100 |
commit | 3e1ed7818ba1abbc331c568327c6c0d64702985e (patch) | |
tree | 55b9e604c97849090f154f4a8feb2ad52a44858a /railties/lib/rails/commands/profiler.rb | |
parent | 8d926f58d91020f9a8936ad6908939c0e298907b (diff) | |
download | rails-3e1ed7818ba1abbc331c568327c6c0d64702985e.tar.gz rails-3e1ed7818ba1abbc331c568327c6c0d64702985e.tar.bz2 rails-3e1ed7818ba1abbc331c568327c6c0d64702985e.zip |
extract PerformanceTest into rails-performance_tests gem
Diffstat (limited to 'railties/lib/rails/commands/profiler.rb')
-rw-r--r-- | railties/lib/rails/commands/profiler.rb | 32 |
1 files changed, 0 insertions, 32 deletions
diff --git a/railties/lib/rails/commands/profiler.rb b/railties/lib/rails/commands/profiler.rb deleted file mode 100644 index 315bcccf61..0000000000 --- a/railties/lib/rails/commands/profiler.rb +++ /dev/null @@ -1,32 +0,0 @@ -require 'optparse' -require 'rails/test_help' -require 'rails/performance_test_help' -require 'active_support/testing/performance' - -def options - options = {} - defaults = ActiveSupport::Testing::Performance::DEFAULTS - - OptionParser.new do |opt| - opt.banner = "Usage: rails profiler 'Ruby.code' 'Ruby.more_code' ... [OPTS]" - opt.on('-r', '--runs N', Numeric, 'Number of runs.', "Default: #{defaults[:runs]}") { |r| options[:runs] = r } - opt.on('-o', '--output PATH', String, 'Directory to use when writing the results.', "Default: #{defaults[:output]}") { |o| options[:output] = o } - opt.on('-m', '--metrics a,b,c', Array, 'Metrics to use.', "Default: #{defaults[:metrics].join(",")}") { |m| options[:metrics] = m.map(&:to_sym) } - opt.on('-f', '--formats x,y,z', Array, 'Formats to output to.', "Default: #{defaults[:formats].join(",")}") { |m| options[:formats] = m.map(&:to_sym) } - opt.parse!(ARGV) - end - - options -end - -class ProfilerTest < ActionDispatch::PerformanceTest #:nodoc: - self.profile_options = options - - ARGV.each do |expression| - eval <<-RUBY - def test_#{expression.parameterize('_')} - #{expression} - end - RUBY - end -end |