Class: Pikuri::Bundle::Base

Inherits:
Data
  • Object
show all
Defined in:
lib/pikuri/bundle/base.rb

Overview

One search base: a directory to scan, plus whether the bytes under it are the user's own.

Bundle::Base.new(dir: project_root, trusted: repo_sources_are_mine)
Bundle::Base.new(dir: Dir.home)              # trusted: false

trusted asks what Pikuri::Workspace::Filesystem#trusted? asks for the file tools — user-authored bytes, or bytes that arrived with a clone? — but about this root alone. That is why it is a value the host passes rather than a reach into the workspace: the two objects reach different bytes, so a workspace whose readable: carries ~/.m2/repository is honestly untrusted while the project's own .pikuri/skills beside it is honestly the user's. Like private:, it is unverifiable, so silence buys false.

A scanner grades its own untrusted trifecta leg by unioning this flag over the bundles it actually stored, so an untrusted base costs nothing while it holds nothing.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(dir:, trusted: false) ⇒ Base

Parameters:

  • dir (String, Pathname)

    directory to scan for bundle subdirs

  • trusted (Boolean) (defaults to: false)

    every byte under dir is user-authored



30
# File 'lib/pikuri/bundle/base.rb', line 30

def initialize(dir:, trusted: false) = super

Instance Attribute Details

#dirObject (readonly)

Returns the value of attribute dir

Returns:

  • (Object)

    the current value of dir



26
27
28
# File 'lib/pikuri/bundle/base.rb', line 26

def dir
  @dir
end

#trustedObject (readonly)

Returns the value of attribute trusted

Returns:

  • (Object)

    the current value of trusted



26
27
28
# File 'lib/pikuri/bundle/base.rb', line 26

def trusted
  @trusted
end