def mtime_including_imports(file)
      mtimes = [mtime(file)]
      File.readlines(file).each do |line|
        next unless line =~ /^\s*@import ['"]([^'"]+)/

        imported = File.join(File.dirname(file), Regexp.last_match[1])

        # complete path given ?
        mod_time = if imported =~ /\.le?ss$/
                     mtime(imported)
                   else
                     # we need to add .less or .lss
                     [mtime("#{imported}.less"), mtime("#{imported}.lss")].max
                   end
        mtimes << mod_time
      end
      mtimes.max
    end
def mtime_including_imports(file)
      mtimes = [mtime(file)]
      File.readlines(file).each do |line|
        next unless line =~ /^\s*@import ['"]([^'"]+)/

        imported = File.join(File.dirname(file), Regexp.last_match[1])

        # complete path given ?
        mod_time = if imported =~ /\.le?ss$/
                     mtime(imported)
                   else
                     # we need to add .less or .lss
                     [mtime("#{imported}.less"), mtime("#{imported}.lss")].max
                   end
        mtimes << mod_time
      end
      mtimes.max
    end
consider imports for mtime
 just 1 level deep so we do not get any looping/nesting errors