src/pub/blurb.bend checks
raw source on the hub · import ezx@1.14.0.0/src/pub/blurb.bend as Blurb
pub/blurb: the line the hub shows as a package's description, pure. The
hub takes the first line of the package's first file by path, in plain
string order (so an uppercase letter comes before every lowercase one), and
passes over a file named LICENSE, which bend 2.0.27 sends beside the files
it publishes, and the README.md bend 2.0.40 sends beside the entry. The hub's
own listing says so: a package whose files are LICENSE, README.md and
main.bend is described by main.bend's first line. ez publish says this line before it uploads (pub/plan.bend),
and ez init opens the entry it writes with a line of its own for it
(init/plan.bend), so the line a project is shown by on the hub is one its
author wrote.
Paths are compared with String.is_le, the order the package walk writes a
manifest in (K.file.le). It compares characters by code point, which is
JavaScript's order for every path whose characters are all in the Basic
Multilingual Plane.
3 imports
import Base import ../pkg/pkg.bend as K import ../pkg/path.bend as Path
Definitions
def nl.step source · line 22 · raw
@here:Bool -> @rest:(@_:Unit -> Bool) -> Bool
one step of a scan for a newline, with the head's answer in hand; the rest arrives as a thunk, so the first newline ends the scan
def has.nl source · line 30 · raw
@text:String -> Bool
whether a text holds a newline, so is more than one line
def line.step source · line 39 · raw
@end:Bool -> @+head:Char -> @rest:(@_:Unit -> String) -> String
one step of the first line: a newline ends it, and any other character starts what the rest of the line is
def line.first source · line 48 · raw
@text:String -> String
a text's first line: everything before its first newline, the whole text when it has none
def lic source · line 56 · raw
@file:0xe21073738926f8a159714d5cdaf60edb/src/pkg/pkg.Source -> Bool
whether a file of a package is a LICENSE, which the hub passes over
def readme source · line 61 · raw
@file:0xe21073738926f8a159714d5cdaf60edb/src/pkg/pkg.Source -> Bool
whether a file of a package is the README, which the hub passes over too
def passed source · line 66 · raw
@+file:0xe21073738926f8a159714d5cdaf60edb/src/pkg/pkg.Source -> Bool
whether the hub passes a file over: a LICENSE or the README
def at source · line 70 · raw
@file:0xe21073738926f8a159714d5cdaf60edb/src/pkg/pkg.Source -> String
where a file stands in the hub's order
def least.vs source · line 76 · raw
@cur:Maybe<&2, 0xe21073738926f8a159714d5cdaf60edb/src/pkg/pkg.Source> -> @+next:0xe21073738926f8a159714d5cdaf60edb/src/pkg/pkg.Source -> Maybe<&2, 0xe21073738926f8a159714d5cdaf60edb/src/pkg/pkg.Source>
the earlier of the file found so far and the next one; a tie keeps the one found first
def least.pick source · line 85 · raw
@skip:Bool -> @cur:Maybe<&2, 0xe21073738926f8a159714d5cdaf60edb/src/pkg/pkg.Source> -> @+next:0xe21073738926f8a159714d5cdaf60edb/src/pkg/pkg.Source -> Maybe<&2, 0xe21073738926f8a159714d5cdaf60edb/src/pkg/pkg.Source>
the next file weighed: a LICENSE or the README is passed over, and any other file is the earlier of itself and the one found so far
def least source · line 94 · raw
@fs:List<&2, 0xe21073738926f8a159714d5cdaf60edb/src/pkg/pkg.Source> -> @cur:Maybe<&2, 0xe21073738926f8a159714d5cdaf60edb/src/pkg/pkg.Source> -> Maybe<&2, 0xe21073738926f8a159714d5cdaf60edb/src/pkg/pkg.Source>
the first file by path among these and the one found so far, LICENSE files and the README passed over
def line.file source · line 102 · raw
@file:0xe21073738926f8a159714d5cdaf60edb/src/pkg/pkg.Source -> String
a file's first line
def line.of source · line 107 · raw
@got:Maybe<&2, 0xe21073738926f8a159714d5cdaf60edb/src/pkg/pkg.Source> -> String
the first line of the file found, "" when there is none
def blurb source · line 116 · raw
@fs:List<&2, 0xe21073738926f8a159714d5cdaf60edb/src/pkg/pkg.Source> -> String
the line the hub describes a package by: the first line of its first file by path that is neither a LICENSE nor the README
def after.step source · line 121 · raw
@here:Bool -> @rest:(@_:Unit -> Bool) -> Bool
one step of the walk below, with the head's answer in hand; the rest arrives as a thunk, so the first file that comes earlier ends the walk
def after source · line 130 · raw
@+path:String -> @fs:List<&2, 0xe21073738926f8a159714d5cdaf60edb/src/pkg/pkg.Source> -> Bool
whether every file of these comes no earlier than a path, a LICENSE included. Law vocabulary: a file whose path is this one comes first.