class Redundant

Public Class Methods

findAssets(path) click to toggle source
# File lib/redundant.rb, line 49
def self.findAssets(path)
  require 'find'


  assets = []

  if File.directory? "#{path}/app/assets/images/"
    Find.find("#{path}/app/assets/images/").each do |asset|
      assets.push asset.gsub(/#{path}/, '') if asset.match(/(png|jpg|jpeg|gif|webp)/i)
    end
  else
    puts "Can't find an assets image directory (#{path}/app/assets/images/)"
  end
  return assets
end