Class: ScoutApm::Utils::Scm
- Inherits:
-
Object
- Object
- ScoutApm::Utils::Scm
- Defined in:
- lib/scout_apm/utils/scm.rb
Class Method Summary collapse
-
.relative_scm_path(path, scm_subdirectory = ScoutApm::Agent.instance.context.environment.scm_subdirectory) ⇒ Object
Takes an *already relative* path
path
Returns a relative path, prepending the configuredscm_subdirectory
environment string.
Class Method Details
.relative_scm_path(path, scm_subdirectory = ScoutApm::Agent.instance.context.environment.scm_subdirectory) ⇒ Object
Takes an *already relative* path path
Returns a relative path, prepending the configured scm_subdirectory
environment string
7 8 9 10 11 |
# File 'lib/scout_apm/utils/scm.rb', line 7 def self.relative_scm_path(path, scm_subdirectory = ScoutApm::Agent.instance.context.environment.scm_subdirectory) @@scm_subdirectory ||= scm_subdirectory.sub(/^\//, '') @@scm_subdirectoy_blank ||= @@scm_subdirectory.empty? @@scm_subdirectoy_blank ? path : File.join(@@scm_subdirectory, path) end |