~/bend-docscommunity

src/pub/world.bend checks

raw source on the hub · import 0x74799d3f846634a3d7461d4336d7c9d4/src/pub/world.bend as World

pub/world: what ez publish reads. The directory the project is in (here), which git is asked about; the ledger's text, None when there is no ez.toml; and the answers to the questions the planner (pub/plan.bend) asked. There is no field for BEND_LIB, the hub or the clock, because the planner reads none of them.

A question is one of the tool commands' own (tool/world.bend): Locate for what git says of the project, git status --porcelain --untracked-files=normal among it, and Read for a file the package walk asks for. Two are publish's: Tracked, every file git tracks under the project with its git ls-files -v tag, and Upload, bend <entry> --publish, with the <name>@<version> the ledger names the package by after it when it names one, run and what it printed. The upload carries the line said just before it runs: the description the hub will show. The upload is the one question whose answering is not a read: it sends the package, so the planner asks it last, once every check that can be made before it has passed.

2 imports
import Base
import ../tool/world.bend as TW

Types

type Ask source · line 21 · raw

Data

a question the planner asks

type Answer source · line 30 · raw

Data

the answer to one: the tool commands' answer, or whether a program exited 0 and what it printed

type Reply source · line 35 · raw

Data

one question, answered

type World source · line 39 · raw

Data

everything ez publish reads

type Heard source · line 83 · raw

Data

an answer looked up, or none yet

Definitions

def toml source · line 43 · raw

String

the ledger's path, which is fixed

def lockfile source · line 47 · raw

String

the lock's path, which is fixed

def here source · line 51 · raw

@world:World -> String

the directory the project is in

def ledger source · line 56 · raw

@world:World -> Maybe<&2, String>

the ledger's text, None when there is no ez.toml

def replies source · line 61 · raw

@world:World -> List<&2, Reply>

every question answered so far

def key source · line 69 · raw

@ask:Ask -> String

the key a question is looked up by. A command uploads once, so the upload's key does not name the entry: the planner looks its answer up without knowing which entry the ledger names, and a law about that answer holds whatever the ledger says.

def look.step source · line 89 · raw

@hit:Bool -> @answer:Answer -> @rest:(@_:Unit -> Heard) -> Heard

this answer when it is the question's, otherwise the rest's. The rest arrives as a thunk, so the first hit ends the scan.

def look source · line 97 · raw

@rs:List<&2, Reply> -> @+want:String -> Heard

the first answer given to a question

def heard source · line 105 · raw

@+world:World -> @ask:Ask -> Heard

the answer to a question, or none yet