Tim Masliuchenko 6d1fafae13 Final tweaks
2019-10-24 09:43:59 +03:00

30 lines
610 B
Ruby

# frozen_string_literal: true
require "cask/artifact/symlinked"
module Cask
module Artifact
class Manpage < Symlinked
attr_reader :section
def self.from_args(cask, source)
section = source.to_s[/\.([1-8]|n|l)$/, 1]
raise CaskInvalidError, "'#{source}' is not a valid man page name" unless section
new(cask, source, section)
end
def initialize(cask, source, section)
@section = section
super(cask, source)
end
def resolve_target(target)
config.manpagedir.join("man#{section}", target)
end
end
end
end