Module: Dpu
- Defined in:
- lib/dpu.rb,
lib/dpu/version.rb
Defined Under Namespace
Modules: ScmService Classes: Cli
Constant Summary collapse
- SCM_SERVICES =
[]
- VERSION =
"0.6.1"
Class Method Summary collapse
Class Method Details
.determine_permanent_uri(path_or_link, start_line_number: nil, end_line_number: nil, max_find_version: 20) ⇒ Object
14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 |
# File 'lib/dpu.rb', line 14 def determine_permanent_uri(path_or_link, start_line_number: nil, end_line_number: nil, max_find_version: 20) path = path_or_link.realpath relative_path = determine_relative_path(path) remote_url = get_remote_url(path) scm_service, repository_uri = determine_scm_service_and_repository_uri(remote_url) permanent_uri_parts = [ repository_uri, scm_service.ref_prefix, find_same_content_version(path, relative_path, max_find_version) || determine_commit_id(path), relative_path, ] permanent_uri = URI(permanent_uri_parts.join("/")) permanent_uri.fragment = scm_service.determine_fragment(start_line_number, end_line_number) return permanent_uri end |