-
-
Notifications
You must be signed in to change notification settings - Fork 540
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #792 from hanami/migrate-command-server
Migrate server command to new CLI
- Loading branch information
Showing
3 changed files
with
43 additions
and
38 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
module Hanami | ||
module CommandLine | ||
class Server | ||
include Hanami::Cli::Command | ||
|
||
register 'server' | ||
|
||
desc 'Starts a hanami server' | ||
|
||
option :port, alias: '-p', desc: 'The port to run the server on' | ||
option :server, desc: 'Choose a specific Rack::Handler (webrick, thin, etc)' | ||
option :rackup, desc: 'A rackup configuration file path to load (config.ru)' | ||
option :host, desc: 'The host address to bind to' | ||
option :debug, desc: 'Turn on debug output' | ||
option :warn, desc: 'Turn on warnings' | ||
option :daemonize, desc: 'If true, the server will daemonize itself (fork, detach, etc)' | ||
option :pid, desc: 'Path to write a pid file after daemonize' | ||
option :environment, desc: 'Path to environment configuration (config/environment.rb)' | ||
option :code_reloading, desc: 'Code reloading', type: :boolean, default: true | ||
|
||
def call(options) | ||
require 'hanami/commands/server' | ||
Hanami::Commands::Server.new(options).start | ||
end | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
module Hanami | ||
module CommandLine | ||
class Version | ||
include Hanami::Cli::Command | ||
|
||
register "version" | ||
aliases '--version', '-v' | ||
|
||
def call | ||
puts "v#{Hanami::VERSION}" | ||
end | ||
end | ||
end | ||
end |