module JekyllRemotePlantUMLPlugin::Utils::PlantUML
Public Instance Methods
expand_path(path, current, last, separator)
click to toggle source
# File lib/jekyll_remote_plantuml_plugin/utils.rb, line 86 def expand_path(path, current, last, separator) path = path[1..] if path.start_with?(separator) && current.zero? path = [path, separator] unless path.end_with?(separator) || current == last path end
generate_url(provider, encoded_content, format)
click to toggle source
# File lib/jekyll_remote_plantuml_plugin/utils.rb, line 74 def generate_url(provider, encoded_content, format) join_paths(provider, format, encoded_content).to_s end
join_paths(*paths, separator: "/")
click to toggle source
# File lib/jekyll_remote_plantuml_plugin/utils.rb, line 78 def join_paths(*paths, separator: "/") paths = paths.compact.reject(&:empty?) last = paths.length - 1 paths.each_with_index.map do |path, index| expand_path(path, index, last, separator) end.join end