Class: Baid::ProjectScanner

Inherits:
Object
  • Object
show all
Defined in:
lib/baid/project_scanner.rb

Constant Summary collapse

PACKAGE_FILES =
%w[
  Gemfile
  package.json
  requirements.txt
  pom.xml
  go.mod
  Cargo.toml
  composer.json
  pubspec.yaml
  build.gradle
  pyproject.toml
].freeze
IGNORED =
%w[. .. node_modules vendor .git .svn .hg __pycache__ .DS_Store].freeze
MAX_PACKAGE_SIZE =
10_000

Class Method Summary collapse

Class Method Details

.scan(project_dir) ⇒ Object



22
23
24
25
26
27
# File 'lib/baid/project_scanner.rb', line 22

def self.scan(project_dir)
  file_tree = collect_tree(project_dir, depth: 0)
  package_files = collect_packages(project_dir)

  { file_tree: file_tree, package_files: package_files }
end