Module: Tipsy::Helpers::AssetPaths

Included in:
Tipsy::Helpers
Defined in:
lib/tipsy/helpers/asset_paths.rb

Instance Method Summary collapse

Instance Method Details

#asset_path(path) ⇒ Object



7
8
9
10
# File 'lib/tipsy/helpers/asset_paths.rb', line 7

def asset_path(path)
  return path if path.match(/^https?:/) || Pathname.new(path).absolute?
  "/" << path_for_asset_type(path)
end

#path_with_ext(path, ext) ⇒ Object



12
13
14
15
# File 'lib/tipsy/helpers/asset_paths.rb', line 12

def path_with_ext(path, ext)
  return path if path.match(/^https?:/) || path.ends_with?(".#{ext}")
  [path, ext].join('.')
end