module Zap::Utils::File
Defined in:
utils/file.crConstant Summary
-
ALWAYS_IGNORED =
[".git", "CVS", ".svn", ".hg", ".lock-wscript", ".wafpickle-N", ".*.swp", ".DS_Store", "._*", "npm-debug.log", ".npmrc", "node_modules", "config.gypi", "*.orig", "package-lock.json"] of ::String
-
ALWAYS_INCLUDED =
["/package.json", "/README.*", "/Readme.*", "/readme.*", "/LICENSE.*", "/License.*", "/license.*", "/LICENCE.*", "/Licence.*", "/licence.*"] of ::String
-
See: https://docs.npmjs.com/cli/v9/configuring-npm/package-json#files
Class Method Summary
- .can_hardlink?(source : Path | String, dest : Path | String, *, tempfile_name : String | Nil = nil) : Bool
- .crawl(directory : Path | String, *, always_included : Git::Ignore | Nil = nil, always_excluded : Git::Ignore | Nil = nil, included : Git::Ignore | Nil = nil, excluded : Git::Ignore | Nil = nil, path_prefix = Path.new, &block : Path -> Bool | Nil)
-
.crawl_package_files(directory : Path, &block : Path -> Bool | Nil)
Crawl a package and yield directories and files that are not ignored by git and included in the package.json files field.
- .delete_file_or_dir?(path : Path) : Bool
- .find_package_files(path : String | Path) : PackagesData
- .join(*paths : Path | String) : String
- .linkeable_ancestor?(path : Path) : String | Nil
- .recursively(path : Path | String, relative_path : Path = Path.new, &block : Path, Path -> Nil)
- .tempname(prefix : String | Nil = nil, suffix : String | Nil = nil) : String
- .with_flock(path : Path | String, *, file : ::File | Nil = nil, shared = false, close_fd = true, unlock_flock = true, &block : ::File -> T) forall T
Class Method Detail
def self.can_hardlink?(source : Path | String, dest : Path | String, *, tempfile_name : String | Nil = nil) : Bool
#
def self.crawl(directory : Path | String, *, always_included : Git::Ignore | Nil = nil, always_excluded : Git::Ignore | Nil = nil, included : Git::Ignore | Nil = nil, excluded : Git::Ignore | Nil = nil, path_prefix = Path.new, &block : Path -> Bool | Nil)
#
def self.crawl_package_files(directory : Path, &block : Path -> Bool | Nil)
#
Crawl a package and yield directories and files that are not ignored by git and included in the package.json files field.
def self.recursively(path : Path | String, relative_path : Path = Path.new, &block : Path, Path -> Nil)
#