Method: CSL::Loader#extend_name

Defined in:
lib/csl/loader.rb

#extend_name(string) ⇒ Object

Extends the passed-in string to a style/locale name, by prefixing and appending the default name prefix and extension.



48
49
50
51
52
53
54
55
56
57
58
59
60
# File 'lib/csl/loader.rb', line 48

def extend_name(string)
  if File.extname(string.to_s).empty?
    name = [string, extension].compact.join
  else
    name = string.to_s.dup
  end

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

  name
end