Add *_to_slashes methods to compat.

This commit is contained in:
Markus Reiter 2019-04-20 23:56:55 +02:00
parent e68fc530c0
commit ce15622584
3 changed files with 26 additions and 1 deletions

View File

@ -17,7 +17,7 @@ module Cask
def cask_path
casks.first.sourcefile_path
rescue CaskInvalidError, CaskUnreadableError
rescue CaskInvalidError, CaskUnreadableError, MethodDeprecatedError
path = CaskLoader.path(args.first)
return path if path.file?

View File

@ -0,0 +1 @@
require "compat/cask/dsl/version"

View File

@ -0,0 +1,24 @@
module Cask
class DSL
class Version < ::String
module Compat
def dots_to_slashes
odeprecated "#dots_to_slashes"
version { tr(".", "/") }
end
def hyphens_to_slashes
odeprecated "#hyphens_to_slashes"
version { tr("-", "/") }
end
def underscores_to_slashes
odeprecated "#underscores_to_slashes"
version { tr("_", "/") }
end
end
prepend Compat
end
end
end