src/pub/blurb.bend checks
raw source on the hub · import 0x74799d3f846634a3d7461d4336d7c9d4/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. 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 20 · 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 28 · raw
@text:String -> Bool
whether a text holds a newline, so is more than one line
def line.step source · line 37 · 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 46 · 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 54 · raw
@file:0x74799d3f846634a3d7461d4336d7c9d4/src/pkg/pkg.Source -> Bool
whether a file of a package is a LICENSE, which the hub passes over
def at source · line 59 · raw
@file:0x74799d3f846634a3d7461d4336d7c9d4/src/pkg/pkg.Source -> String
where a file stands in the hub's order
def least.vs source · line 65 · raw
@cur:Maybe<&2, 0x74799d3f846634a3d7461d4336d7c9d4/src/pkg/pkg.Source> -> @+next:0x74799d3f846634a3d7461d4336d7c9d4/src/pkg/pkg.Source -> Maybe<&2, 0x74799d3f846634a3d7461d4336d7c9d4/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 74 · raw
@skip:Bool -> @cur:Maybe<&2, 0x74799d3f846634a3d7461d4336d7c9d4/src/pkg/pkg.Source> -> @+next:0x74799d3f846634a3d7461d4336d7c9d4/src/pkg/pkg.Source -> Maybe<&2, 0x74799d3f846634a3d7461d4336d7c9d4/src/pkg/pkg.Source>
the next file weighed: a LICENSE is passed over, and any other file is the earlier of itself and the one found so far
def least source · line 83 · raw
@fs:List<&2, 0x74799d3f846634a3d7461d4336d7c9d4/src/pkg/pkg.Source> -> @cur:Maybe<&2, 0x74799d3f846634a3d7461d4336d7c9d4/src/pkg/pkg.Source> -> Maybe<&2, 0x74799d3f846634a3d7461d4336d7c9d4/src/pkg/pkg.Source>
the first file by path among these and the one found so far, LICENSE files passed over
def line.file source · line 91 · raw
@file:0x74799d3f846634a3d7461d4336d7c9d4/src/pkg/pkg.Source -> String
a file's first line
def line.of source · line 96 · raw
@got:Maybe<&2, 0x74799d3f846634a3d7461d4336d7c9d4/src/pkg/pkg.Source> -> String
the first line of the file found, "" when there is none
def blurb source · line 105 · raw
@fs:List<&2, 0x74799d3f846634a3d7461d4336d7c9d4/src/pkg/pkg.Source> -> String
the line the hub describes a package by: the first line of its first file by path that is not a LICENSE
def after.step source · line 110 · 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 119 · raw
@+path:String -> @fs:List<&2, 0x74799d3f846634a3d7461d4336d7c9d4/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.