Class: HighFive::Thor::Tasks::Development
- Inherits:
-
HighFive::Thor::Task
- Object
- Thor
- HighFive::Thor::Task
- HighFive::Thor::Tasks::Development
- Includes:
- Thor::Actions
- Defined in:
- lib/high_five/thor/tasks/development.rb
Instance Method Summary collapse
Methods inherited from HighFive::Thor::Task
Constructor Details
This class inherits a constructor from HighFive::Thor::Task
Instance Method Details
#server(platform = "web") ⇒ Object
11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 |
# File 'lib/high_five/thor/tasks/development.rb', line 11 def server(platform="web") root = nil if [:platform_path] [File.join([:platform_path], 'www'), File.join([:platform_path], 'assets', 'www')].each do |path| if File.exist? path root = path break end end else root = base_config.build_platform_config(platform).destination_root end puts "Starting server with root=#{root}" server = WEBrick::HTTPServer.new(:Port => 3000, :DocumentRoot => root) trap 'INT' do server.shutdown end server.start end |