Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

find plantuml from system folder also #1760

Merged
merged 1 commit into from
Oct 27, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion doc/format.ja.md
Original file line number Diff line number Diff line change
Expand Up @@ -396,7 +396,7 @@ plot sin(x)
* Gnuplot ( http://www.gnuplot.info/ ) : `gnuplot` コマンドへのパスを OS に設定すること
* Blockdiag ( http://blockdiag.com/ ) : `blockdiag` コマンドへのパスを OS に設定すること。PDF を生成する場合は ReportLab もインストールすること
* aafigure ( https://launchpad.net/aafigure ) : `aafigure` コマンドへのパスを OS に設定すること
* PlantUML ( http://plantuml.com/ ) : `java` コマンドへのパスを OS に設定し、`plantuml.jar` が作業フォルダにあること
* PlantUML ( http://plantuml.com/ ) : `java` コマンドへのパスを OS に設定し、`plantuml.jar` が作業フォルダ、または `/usr/share/plantuml` あるいは `/usr/share/java` フォルダにあること

## 表

Expand Down
2 changes: 1 addition & 1 deletion doc/format.md
Original file line number Diff line number Diff line change
Expand Up @@ -423,7 +423,7 @@ Before using these tools, you should installed them and configured path appropri
* Gnuplot ( http://www.gnuplot.info/ ) : set path to `gnuplot` command
* Blockdiag ( http://blockdiag.com/ ) : set path to `blockdiag` command. Install ReportLab also to make a PDF
* aafigure ( https://launchpad.net/aafigure ) : set path to `aafigure` command
* PlantUML ( http://plantuml.com/ ) : set path to `java` command. place `plantuml.jar` on working folder
* PlantUML ( http://plantuml.com/ ) : set path to `java` command. place `plantuml.jar` on working folder, `/usr/share/plantuml` or `/usr/share/java`.

## Tables

Expand Down
12 changes: 11 additions & 1 deletion lib/review/builder.rb
Original file line number Diff line number Diff line change
Expand Up @@ -669,7 +669,17 @@ def graph_plantuml(id, file_path, _line, tf_path)
ext = 'eps'
file_path.sub!(/\.pdf\Z/, '.eps')
end
system_graph(id, 'java', '-jar', 'plantuml.jar', "-t#{ext}", '-charset', 'UTF-8', tf_path)
plant_path = nil
if File.exist?('plantuml.jar')
plant_path = 'plantuml.jar'
elsif File.exist?('/usr/share/plantuml/plantuml.jar')
plant_path = '/usr/share/plantuml/plantuml.jar'
elsif File.exist?('/usr/share/java/plantuml.jar')
plant_path = '/usr/share/java/plantuml.jar'
else
error!('missing plantuml.jar. Please put plantuml.jar at the working folder.')
end
system_graph(id, 'java', '-jar', plant_path, "-t#{ext}", '-charset', 'UTF-8', tf_path)
FileUtils.mv("#{tf_path}.#{ext}", file_path)
file_path
end
Expand Down