Skip to content

Commit

Permalink
Merge pull request #1826 from kmuto/webrick-check
Browse files Browse the repository at this point in the history
webrickの存在チェック
  • Loading branch information
kmuto authored Jul 6, 2022
2 parents 290f961 + 4c9dbe0 commit fbcd983
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 4 deletions.
8 changes: 7 additions & 1 deletion doc/quickstart.ja.md
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,13 @@ review-init コマンドを使って、雛型となるプロジェクトフォ
$ review-init プロジェクト名
```

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

```
$ gem install webrick
```

ウィザードモードで起動するため、review-init コマンドに `-w` オプションを付けます。

```
$ review-init -w プロジェクト名
Expand Down
8 changes: 7 additions & 1 deletion doc/quickstart.md
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,13 @@ $ ls hello
Rakefile catalog.yml config.yml hello.re images/ layouts/ sty/ style.css
```

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.
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.

```
$ gem install webrick
```

Run review-init with `-w` option.

(notice: currently wizard UI supports only Japanese language)

Expand Down
9 changes: 7 additions & 2 deletions lib/review/init.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#
# Copyright (c) 2018-2021 Masanori Kado, Masayoshi Takahashi, Kenshi Muto
# Copyright (c) 2018-2022 Masanori Kado, Masayoshi Takahashi, Kenshi Muto
#
# This program is free software.
# You can distribute or modify this program under the terms of
Expand Down Expand Up @@ -308,7 +308,12 @@ def extract_archive(dir, filename, originalfilename)
end

def start_webui
require 'webrick'
begin
require 'webrick'
rescue LoadError
@logger.error 'not found webrick. Please install webrick gem.'
exit 1
end
web_config = {
BindAddress: @bind,
Port: @port,
Expand Down
1 change: 1 addition & 0 deletions review.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -34,4 +34,5 @@ Gem::Specification.new do |gem|
gem.add_development_dependency('simplecov')
gem.add_development_dependency('test-unit')
gem.add_development_dependency('unicode-eaw')
gem.add_development_dependency('webrick')
end

0 comments on commit fbcd983

Please sign in to comment.