find

Version, currently 1.0.02 versions

github.com/wyhaines/find.cr

No description declared in shard.yml.

3 stars
1 dependent
License: MIT

Nothing has been indexed for 1.0.0 yet. The tag is recorded, its shard.yml has not been read, so the manifest and dependency list below are empty because they are unknown rather than because they are absent.

Installation

# Add this to your shard.yml
dependencies:
  find:
    github: wyhaines/find.cr
    version: ~> 1.0.0

Then run:

shards install

shard.yml

No shard.yml has been indexed for 1.0.0. You can read it on the repository.

Dependencies

Unknown: the shard.yml for this version has not been read yet.

README

This README is the one indexed from the repository at its latest ref, not from the tag for this version.

SplayTreeMap CI GitHub release GitHub commits since latest release (by SemVer)

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

  1. 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

GitHub code size in bytes GitHub issues