Module: TFSGraph::TFSHelpers
- Included in:
- Branch, BranchStore, Changeset
- Defined in:
- lib/tfs_graph/tfs_helpers.rb
Instance Method Summary collapse
- #base_username(name) ⇒ Object
- #branch_base(path) ⇒ Object
-
#branch_path_to_name(path) ⇒ Object
handles OData paths: $>RJR>Project>Path.
- #branch_project(path) ⇒ Object
- #odata_path_to_server_path(path) ⇒ Object
- #scrub_changeset(version) ⇒ Object
-
#server_path_to_odata_path(path) ⇒ Object
handles TFS server paths: $/RJR/Project/Path.
Instance Method Details
#base_username(name) ⇒ Object
25 26 27 |
# File 'lib/tfs_graph/tfs_helpers.rb', line 25 def base_username(name) name.split(/\/|\\/).last end |
#branch_base(path) ⇒ Object
3 4 5 |
# 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) ⇒ Object
handles OData paths: $>RJR>Project>Path
8 9 10 |
# File 'lib/tfs_graph/tfs_helpers.rb', line 8 def branch_path_to_name(path) path_parts(path).last end |
#branch_project(path) ⇒ Object
21 22 23 |
# File 'lib/tfs_graph/tfs_helpers.rb', line 21 def branch_project(path) path_parts(path)[1] end |
#odata_path_to_server_path(path) ⇒ Object
17 18 19 |
# File 'lib/tfs_graph/tfs_helpers.rb', line 17 def odata_path_to_server_path(path) path.gsub ">", "/" end |
#scrub_changeset(version) ⇒ Object
29 30 31 |
# 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) ⇒ Object
handles TFS server paths: $/RJR/Project/Path
13 14 15 |
# File 'lib/tfs_graph/tfs_helpers.rb', line 13 def server_path_to_odata_path(path) path.gsub "/", ">" end |