find.cr v2.0.0
find.cr
This shard is inspired by the Ruby module:
https://ruby-doc.org/stdlib-2.7.2/libdoc/find/rdoc/index.html
It implements a simple API for the top down traversal of a set of paths, and it provides a convenience method for a simple-to-use matching system that depends on Crystal's file matching syntax.
Installation
-
Add the dependency to your
shard.yml
:dependencies: find: github: wyhaines/find.cr
Usage
require "find"
The API is simple.
require 'find'
total_size = 0
Find.find(ENV["HOME"]) do |path|
if File.directory?(path)
if File.basename(path).start_with?('.')
Find.prune # Don't look any further into this directory.
else
next
end
end
total_size += FileTest.size(path)
end
Repository
find.cr
Owner
Statistic
- 3
- 1
- 1
- 1
- 1
- almost 3 years ago
- March 1, 2021
License
Apache License 2.0
Links
Synced at
Fri, 09 May 2025 16:04:26 GMT
Languages