Method: Command::Web#initialize
- Defined in:
- lib/command/web.rb
#initialize ⇒ Web
Returns a new instance of Web.
13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 |
# File 'lib/command/web.rb', line 13 def initialize super("[options...]") @opt.separator <<-EOS ・WEBアプリケーション用サーバを起動します ・小説の管理及び設定をブラウザで行うことができます ・--port を指定しない場合、ポートは初回起動時にランダムで設定します (以降同じ設定を引き継ぎます) ・サーバ起動後にブラウザを立ち上げます ・サーバの停止はコンソールで Ctrl+C を入力します Examples: narou web # サーバ起動(ポートはランダム。ポート設定保存) narou web -p 4567 # ポート4567で起動(保存はされない) # 先に決めておく narou s server-port=8000 narou web # ポート8000で起動 Options: EOS @opt.on("-p", "--port PORT", Integer, "起動するポートを指定") { |port| @options["port"] = port } @opt.on("-n", "--no-browser", "起動時にブラウザは開かない") { @options["no-browser"] = true } end |