File: absolute_path.pp

package info (click to toggle)
puppet-module-puppetlabs-stdlib 8.5.0-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 2,880 kB
  • sloc: ruby: 14,188; sh: 46; makefile: 2
file content (7 lines) | stat: -rw-r--r-- 540 bytes parent folder | download
1
2
3
4
5
6
7
# @summary Emulate the is_absolute_path and validate_absolute_path functions
#
# The first pattern is originally from is_absolute_path, which had it from 2.7.x's lib/puppet/util.rb Puppet::Util.absolute_path?
# slash = '[\\\\/]'
# name = '[^\\\\/]+'
# %r!^(([A-Z]:#{slash})|(#{slash}#{slash}#{name}#{slash}#{name})|(#{slash}#{slash}\?#{slash}#{name}))!i,
type Stdlib::Compat::Absolute_path = Variant[Pattern[/^(([a-zA-Z]:[\\\/])|([\\\/][\\\/][^\\\/]+[\\\/][^\\\/]+)|([\\\/][\\\/]\?[\\\/][^\\\/]+))/], Pattern[/^\//]] # lint:ignore:140chars