Skip to content

Instantly share code, notes, and snippets.

@fitzhaile fitzhaile/file_exists.rb
Last active Dec 14, 2015

Embed
What would you like to do?
Ruby: Custom file_exists Sass Function
module Sass::Script::Functions
def file_exists(image_file)
path = Dir.getwd + "/" + image_file.value
Sass::Script::Bool.new(File.exists?(path))
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.