Skip to content

Commit 4c9dbe0

Browse files
committed
check webrick existance. Closes: #1823
1 parent 290f961 commit 4c9dbe0

File tree

4 files changed

+22
-4
lines changed

4 files changed

+22
-4
lines changed

doc/quickstart.ja.md

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,13 @@ review-init コマンドを使って、雛型となるプロジェクトフォ
6767
$ review-init プロジェクト名
6868
```
6969

70-
TeX を利用した PDF 作成を目的としているならば、雛型の作成時に、Web ブラウザによるウィザードモードで基本版面設計を行うことができます。これには `-w` オプションを付けます。
70+
TeX を利用した PDF 作成を目的としているならば、雛型の作成時に、Web ブラウザによるウィザードモードで基本版面設計を行うことができます。外部 gem の webrick が必要なので、インストールしておいてください。
71+
72+
```
73+
$ gem install webrick
74+
```
75+
76+
ウィザードモードで起動するため、review-init コマンドに `-w` オプションを付けます。
7177

7278
```
7379
$ review-init -w プロジェクト名

doc/quickstart.md

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,13 @@ $ ls hello
7272
Rakefile catalog.yml config.yml hello.re images/ layouts/ sty/ style.css
7373
```
7474

75-
If your purpose is to create a PDF using TeX, it is a good idea to use the wizard mode for basic layouting in a web browser. Add `-w` option to review-init.
75+
If your purpose is to create a PDF using TeX, it is a good idea to use the wizard mode for basic layouting in a web browser. Because the wizard mode requires webrick library, please install webrick gem before running.
76+
77+
```
78+
$ gem install webrick
79+
```
80+
81+
Run review-init with `-w` option.
7682

7783
(notice: currently wizard UI supports only Japanese language)
7884

lib/review/init.rb

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#
2-
# Copyright (c) 2018-2021 Masanori Kado, Masayoshi Takahashi, Kenshi Muto
2+
# Copyright (c) 2018-2022 Masanori Kado, Masayoshi Takahashi, Kenshi Muto
33
#
44
# This program is free software.
55
# You can distribute or modify this program under the terms of
@@ -308,7 +308,12 @@ def extract_archive(dir, filename, originalfilename)
308308
end
309309

310310
def start_webui
311-
require 'webrick'
311+
begin
312+
require 'webrick'
313+
rescue LoadError
314+
@logger.error 'not found webrick. Please install webrick gem.'
315+
exit 1
316+
end
312317
web_config = {
313318
BindAddress: @bind,
314319
Port: @port,

review.gemspec

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,4 +34,5 @@ Gem::Specification.new do |gem|
3434
gem.add_development_dependency('simplecov')
3535
gem.add_development_dependency('test-unit')
3636
gem.add_development_dependency('unicode-eaw')
37+
gem.add_development_dependency('webrick')
3738
end

0 commit comments

Comments
 (0)