module CiteProc::Asset::ClassMethods

Attributes

extension[RW]
prefix[RW]
root[RW]

Public Instance Methods

extend_name(input) click to toggle source
# File lib/citeproc/assets.rb, line 67
def extend_name(input)
  if File.extname(input) != extension
    name = [input, extension].compact.join
  else
    name = input.to_s.dup
  end

  unless name.start_with?(prefix.to_s)
    name = [prefix, name].join
  end

  name
end
extend_path(input) click to toggle source
# File lib/citeproc/assets.rb, line 63
def extend_path(input)
  File.join(root.to_s, extend_name(input))
end
open(path_or_name) click to toggle source
# File lib/citeproc/assets.rb, line 59
def open(path_or_name)
  new.open(path_or_name)
end