aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/RUNNING_UNIT_TESTS.rdoc
diff options
context:
space:
mode:
authorAndrey Chernih <andrey.chernih@gmail.com>2014-07-11 23:26:33 +0400
committerAndrey Chernih <andrey.chernih@gmail.com>2014-07-11 23:26:33 +0400
commitb3a34cd3747840a8bd92612d02d947da01bcd00e (patch)
treeba9ffca697fdea43a20a61eca138d1cfe6f63b23 /activerecord/RUNNING_UNIT_TESTS.rdoc
parent132d400b6f1b73f828b8d50b90edac72244e11c5 (diff)
downloadrails-b3a34cd3747840a8bd92612d02d947da01bcd00e.tar.gz
rails-b3a34cd3747840a8bd92612d02d947da01bcd00e.tar.bz2
rails-b3a34cd3747840a8bd92612d02d947da01bcd00e.zip
Add ability to extend `rails server` command options parser
With this change it will be possible to add additional options to the `option_parser` like this: require 'rails/commands/server' module Rails class Server < ::Rack::Server class Options def option_parser_with_open(options) parser = option_parser_without_open options parser.on('-o', '--open', 'Open in default browser') { options[:open] = true } parser end alias_method_chain :option_parser, :open end def start_with_open start_without_open do `open http://localhost:3000` if options[:open] end end alias_method_chain :start, :open end end
Diffstat (limited to 'activerecord/RUNNING_UNIT_TESTS.rdoc')
0 files changed, 0 insertions, 0 deletions