EasyFind is a thin wrapper of *nix find command. It enables users to specify find command line. The syntax of EasyFind is quite simple, and you may easily replace current syntax with your perferred syntax.
Specify find command in STDIN string
Run easy_find, and you may specify intended find command in the STDIN string as follows:
EasyFind::Finder.find do
in_folder { [".", "~", "/usr/bin"] }
where do
type "f"
size :greater_than, 1000
grouping do
atime :greater_than, 7
or_else
mtime :less_than, 10
end
end
with_actions { print }
end
The script will print generated find command line in the last line.
Specify find command in a .rb file
You may save the above contents in a .rb file, say demo.rb. Then run "easy_find demo.rb", and copy&paste generated printed find command line.
API calls
require 'easy_find'
find_command = EasyFind::Finder.find do
in_folder { "/usr/bin" }
where do
...
end
with_actions do
...
end
end