Sha256: 7a9f65e6416c69bf5c7d1c568f3102d2036cea656156ba119f0b92ec96a10e63

Contents?: true

Size: 682 Bytes

Versions: 7

Compression:

Stored size: 682 Bytes

Contents

ARGV << '--help' if ARGV.empty?

help_message = <<-EOT
Usage: rperf COMMAND [ARGS]

 benchmarker  See how fast a piece of code runs
 profiler     Get profile information from a piece of code

All commands can be run with -h (or --help) for more information.
EOT

command = ARGV.shift

case command

when 'benchmarker', 'profiler'
  require APP_PATH
  Rails.application.require_environment!
  require "rails/perftest/commands/#{command}"

when '-h', '--help'
  puts help_message
else
  puts "Error: Command '#{command}' not recognized"
  if %x{rake #{command} --dry-run 2>&1 } && $?.success?
    puts "Did you mean: `$ rake #{command}` ?\n\n"
  end
  puts help_message
  exit(1)
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
rails-perftest-0.0.7 lib/rails/perftest/commands.rb
rails-perftest-0.0.6 lib/rails/perftest/commands.rb
rails-perftest-0.0.5 lib/rails/perftest/commands.rb
rails-perftest-0.0.4 lib/rails/perftest/commands.rb
rails-perftest-0.0.3 lib/rails/perftest/commands.rb
rails-perftest-0.0.2 lib/rails/perftest/commands.rb
rails-perftest-0.0.1 lib/rails/perftest/commands.rb