From d33f8cf52a52e0826baf30fef01f73cef4340a00 Mon Sep 17 00:00:00 2001 From: Philip C Monk Date: Tue, 3 May 2016 19:26:52 -0400 Subject: [PATCH] improvements for fuse --- app/gh.hoon | 33 +++++++++++++++++++++++++++++---- arvo/ford.hoon | 13 ++++++++++++- arvo/gall.hoon | 16 +++++++++------- lib/gh-parse.hoon | 3 +++ mar/gh/issue.hoon | 12 ++++++++++++ mar/gh/list-issues.hoon | 12 ++++++++++++ mar/lens/command.hoon | 1 + sur/gh.hoon | 3 ++- 8 files changed, 80 insertions(+), 13 deletions(-) create mode 100644 mar/gh/issue.hoon create mode 100644 mar/gh/list-issues.hoon diff --git a/app/gh.hoon b/app/gh.hoon index 863122290..e616ade45 100644 --- a/app/gh.hoon +++ b/app/gh.hoon @@ -59,6 +59,9 @@ ^- (list place:connector) =+ (helpers:connector ost.hid wir "https://api.github.com") => |% :: gh-specific helpers + ++ read-sentinel + |=(pax/path [ost %diff %arch `0vsen.tinel ~]) + :: ++ sigh-list-issues-x |= jon/json %+ bind ((ar:jo issue:gh-parse) jon) @@ -70,7 +73,9 @@ %+ bind ((ar:jo issue:gh-parse) jon) |= issues/(list issue:gh) :- `(shax (jam issues)) - (malt (turn issues |=(issue:gh [(rsh 3 2 (scot %ui number)) ~]))) + %- malt ^- (list {@ta $~}) + :- [%gh-list-issues ~] + (turn issues |=(issue:gh [(rsh 3 2 (scot %ui number)) ~])) -- :~ ^- place :: / :* guard=$~ @@ -89,7 +94,14 @@ ^- place :: /issues/mine :* guard={$issues $mine $~} read-x=(read-get /issues) - read-y=(read-get /issues) + read-y=(read-static %gh-list-issues ~) + sigh-x=sigh-list-issues-x + sigh-y=sigh-list-issues-y + == + ^- place :: /issues/mine/ + :* guard={$issues $mine @t $~} + read-x=read-null + read-y=read-sentinel sigh-x=sigh-list-issues-x sigh-y=sigh-list-issues-y == @@ -123,12 +135,18 @@ sigh-x=sigh-list-issues-x sigh-y=sigh-list-issues-y == - ^- place :: /issues/by-repo// + ^- place :: /issues/by-repo/// :* guard={$issues $by-repo @t @t @t $~} ^= read-x |=(pax/path (get /repos/[-.+>.pax]/[-.+>+.pax]/issues/[-.+>+>.pax])) :: - read-y=(read-static ~) + ^= read-y + |= pax/path + %. pax + ?: ((sane %tas) -.+>+>.pax) + read-sentinel + (read-static %gh-issue ~) + :: ^= sigh-x |= jon/json %+ bind (issue:gh-parse jon) @@ -137,6 +155,13 @@ :: sigh-y=sigh-strange == + ^- place :: /issues/by-repo//// + :* guard={$issues $by-repo @t @t @t @t $~} + read-x=read-null + read-y=read-sentinel + sigh-x=sigh-strange + sigh-y=sigh-strange + == == :: :: When a peek on a path blocks, ford turns it into a peer on diff --git a/arvo/ford.hoon b/arvo/ford.hoon index b1d60c210..1ef30e906 100644 --- a/arvo/ford.hoon +++ b/arvo/ford.hoon @@ -322,7 +322,13 @@ ?+ van ~&(%camp-stub !!) $g :+ %pass (camp-wire +<) - [%g [%deal [our p.bem] q.bem [%peer %scry ren (flop s.bem)]]] + =+ ^= tyl + ?. ?=($x ren) + s.bem + ?> ?=(^ s.bem) + t.s.bem + + [%g [%deal [our p.bem] q.bem [%peer %scry ren (flop tyl)]]] :: $c :+ %pass (camp-wire +<) @@ -1786,6 +1792,11 @@ |= {{van/vane ren/care bem/beam} cag/cage} ^+ ..zo ?> ?=($g van) + ?: |(!?=($x ren) =(-.s.bem p.cag)) + =. kig (~(del in kig) +<-.$) + =. mow :_(mow [hen (cancel van ren bem)]) + =+ (cat 3 van ren) + exec(keg (~(put by keg) [- bem] cag)) =. mow :_ mow :^ hen %pass (camp-wire van ren bem) diff --git a/arvo/gall.hoon b/arvo/gall.hoon index e7f23da45..d775f105c 100644 --- a/arvo/gall.hoon +++ b/arvo/gall.hoon @@ -489,9 +489,9 @@ byk:(~(got by bum) dap) :: ++ mo-peek - |= {dap/dude pry/prey ren/@tas tyl/path mar/mark} + |= {dap/dude pry/prey ren/@tas tyl/path} ^- (unit (unit cage)) - (ap-peek:(ap-abed:ap dap pry) ren tyl mar) + (ap-peek:(ap-abed:ap dap pry) ren tyl) :: ++ mo-clip :: apply club |= {dap/dude pry/prey cub/club} @@ -635,8 +635,13 @@ (ap-sake p.zem) :: ++ ap-peek - |= {ren/@tas tyl/path mar/mark} + |= {ren/@tas tyl/path} ^- (unit (unit cage)) + =+ ?. ?=($x ren) + [mar=%$ tyl=tyl] + =+ `path`(flop tyl) + ?> ?=(^ -) + [mar=i tyl=(flop t)] =+ cug=(ap-find %peek ren tyl) ?~ cug ((slog leaf+"peek find fail" >tyl< >mar< ~) [~ ~]) @@ -1309,10 +1314,7 @@ [~ ~] ?. ?=(^ tyl) ~ - =+ =+ `path`(flop tyl) - ?> ?=(^ -) - [mar=i pax=(flop t)] - (mo-peek:(mo-abed:mo who *duct) syd high+`who ren pax mar) + (mo-peek:(mo-abed:mo who *duct) syd high+`who ren tyl) :: ++ stay :: save w+o cache `axle`all diff --git a/lib/gh-parse.hoon b/lib/gh-parse.hoon index 48d0846fb..72900f6c3 100644 --- a/lib/gh-parse.hoon +++ b/lib/gh-parse.hoon @@ -101,6 +101,9 @@ == ++ issue ^- $-(json (unit issue:gh)) + |= jon/json + =- (bind - |*(issue/* `issue:gh`[jon issue])) + %. jon =+ jo %- ot :~ 'url'^so diff --git a/mar/gh/issue.hoon b/mar/gh/issue.hoon new file mode 100644 index 000000000..7963aad4b --- /dev/null +++ b/mar/gh/issue.hoon @@ -0,0 +1,12 @@ +/- gh +|_ issue/issue:gh +++ grab + |% + ++ noun issue:gh + -- +++ grow + |% + ++ json raw.issue + ++ mime [/txt/plain (taco (crip ))] + -- +-- diff --git a/mar/gh/list-issues.hoon b/mar/gh/list-issues.hoon new file mode 100644 index 000000000..c65b2cc5d --- /dev/null +++ b/mar/gh/list-issues.hoon @@ -0,0 +1,12 @@ +/- gh +|_ issues/(list issue:gh) +++ grab + |% + ++ noun (list issue:gh) + -- +++ grow + |% + ++ json [%a (turn issues |=(issue:gh raw))] + ++ mime [/txt/plain (taco (crip ))] + -- +-- diff --git a/mar/lens/command.hoon b/mar/lens/command.hoon index a6e47b639..65f5f77ab 100644 --- a/mar/lens/command.hoon +++ b/mar/lens/command.hoon @@ -7,6 +7,7 @@ ++ json |= jon/^json ^- command:lens + ~| jon=jon %- need %. jon => [. jo] diff --git a/sur/gh.hoon b/sur/gh.hoon index 71fdd2241..d76ee9461 100644 --- a/sur/gh.hoon +++ b/sur/gh.hoon @@ -97,7 +97,8 @@ site-admin/? == ++ issue - $: url/@t + $: raw/json + url/@t labels-url/@t comments-url/@t events-url/@t