Add option to configure PlantUML endpoint

This commit is contained in:
Horacio Sanson
2015-02-05 01:05:30 +09:00
parent 249eed5c2c
commit 1cceb7d4b4
+17
View File
@@ -120,6 +120,10 @@ opts = OptionParser.new do |opts|
opts.on("--h1-title", "Sets page title to value of first h1") do
wiki_options[:h1_title] = true
end
opts.on("--plantuml-url [URL]", "Sets the PlantUML server endpoint.") do |url|
wiki_options[:plantuml_url] = url
end
end
# Read command line options into `options` hash
@@ -167,6 +171,12 @@ if options['irb']
if !wiki.exist? then
raise Gollum::InvalidGitRepositoryError
end
if wiki_options[:plantuml_url]
Gollum::Filter::PlantUML.configure do |config|
puts "Using #{wiki_options[:plantuml_url]} as PlantUML endpoint"
config.url = wiki_options[:plantuml_url]
end
end
puts "Loaded Gollum wiki at #{File.expand_path(gollum_path).inspect}."
puts
puts %( page = wiki.page('page-name'))
@@ -197,6 +207,13 @@ else
require cfg
end
if wiki_options[:plantuml_url]
Gollum::Filter::PlantUML.configure do |config|
puts "Using #{wiki_options[:plantuml_url]} as PlantUML endpoint"
config.url = wiki_options[:plantuml_url]
end
end
base_path = wiki_options[:base_path]
if wiki_options[:base_path].nil?