module TFSGraph::TFSHelpers

Public Instance Methods

base_username(name) click to toggle source
# File lib/tfs_graph/tfs_helpers.rb, line 25
def base_username(name)
  name.split(/\/|\\/).last
end
branch_base(path) click to toggle source
# File lib/tfs_graph/tfs_helpers.rb, line 3
def branch_base(path)
  branch_path_to_name(path).split('-').first
end
branch_path_to_name(path) click to toggle source

handles OData paths: $>RJR>Project>Path

# File lib/tfs_graph/tfs_helpers.rb, line 8
def branch_path_to_name(path)
  path_parts(path).last
end
branch_project(path) click to toggle source
# File lib/tfs_graph/tfs_helpers.rb, line 21
def branch_project(path)
  path_parts(path)[1]
end
odata_path_to_server_path(path) click to toggle source
# File lib/tfs_graph/tfs_helpers.rb, line 17
def odata_path_to_server_path(path)
  path.gsub ">", "/"
end
scrub_changeset(version) click to toggle source
# File lib/tfs_graph/tfs_helpers.rb, line 29
def scrub_changeset(version)
  version.gsub /\D/, "" unless version.nil?
end
server_path_to_odata_path(path) click to toggle source

handles TFS server paths: $/RJR/Project/Path

# File lib/tfs_graph/tfs_helpers.rb, line 13
def server_path_to_odata_path(path)
  path.gsub "/", ">"
end

Private Instance Methods

path_parts(path) click to toggle source
# File lib/tfs_graph/tfs_helpers.rb, line 34
def path_parts(path)
  path.split(">")
end
server_path_parts(path) click to toggle source
# File lib/tfs_graph/tfs_helpers.rb, line 38
def server_path_parts(path)
  path.split("/")
end