diff options
author | David Schmitt <david.schmitt@puppet.com> | 2016-10-07 14:43:05 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-10-07 14:43:05 +0100 |
commit | 527a4f1ebc21276458427fc5787a621fa8d5cb67 (patch) | |
tree | 3460fdc969438937c1e1c9cd173fb5e1193b54dd /types | |
parent | db8edf5cb36e038c747d177914aaa747c770477d (diff) | |
parent | 83539371e5b1e6ff412eda48c3a725653c506ece (diff) |
Merge pull request #664 from HelenCampbell/typeupdates
Type updates
Diffstat (limited to 'types')
-rw-r--r-- | types/absolutepath.pp | 2 | ||||
-rw-r--r-- | types/httpsurl.pp | 1 | ||||
-rw-r--r-- | types/httpurl.pp | 1 | ||||
-rw-r--r-- | types/unixpath.pp | 2 | ||||
-rw-r--r-- | types/windowspath.pp | 1 |
5 files changed, 7 insertions, 0 deletions
diff --git a/types/absolutepath.pp b/types/absolutepath.pp new file mode 100644 index 0000000..70ec916 --- /dev/null +++ b/types/absolutepath.pp @@ -0,0 +1,2 @@ +# A strict absolutepath type +type Stdlib::Absolutepath = Variant[Stdlib::Windowspath, Stdlib::Unixpath] diff --git a/types/httpsurl.pp b/types/httpsurl.pp new file mode 100644 index 0000000..36fd30f --- /dev/null +++ b/types/httpsurl.pp @@ -0,0 +1 @@ +type Stdlib::HTTPSUrl = Pattern[/^https:\/\//] diff --git a/types/httpurl.pp b/types/httpurl.pp new file mode 100644 index 0000000..0d93a95 --- /dev/null +++ b/types/httpurl.pp @@ -0,0 +1 @@ +type Stdlib::HTTPUrl = Pattern[/^https?:\/\//] diff --git a/types/unixpath.pp b/types/unixpath.pp new file mode 100644 index 0000000..76f2c17 --- /dev/null +++ b/types/unixpath.pp @@ -0,0 +1,2 @@ +# this regex rejects any path component that is a / or a NUL +type Stdlib::Unixpath = Pattern[/^\/([^\/\0]+(\/)?)+$/] diff --git a/types/windowspath.pp b/types/windowspath.pp new file mode 100644 index 0000000..bc1ee9c --- /dev/null +++ b/types/windowspath.pp @@ -0,0 +1 @@ +type Stdlib::Windowspath = Pattern[/^(([a-zA-Z]:[\\\/])|([\\\/][\\\/][^\\\/]+[\\\/][^\\\/]+)|([\\\/][\\\/]\?[\\\/][^\\\/]+))/] |