diff --git a/doc/procedures/README.md b/doc/procedures/README.md index 5d0c8d99..ddad6f44 100644 --- a/doc/procedures/README.md +++ b/doc/procedures/README.md @@ -85,12 +85,24 @@ * [Flor::Procedure](https://github.com/floraison/flor/blob/master/) : * [Flor::Macro](https://github.com/floraison/flor/blob/master/) : + * [Flor::Pro::Ccollect](https://github.com/floraison/flor/blob/master/lib/flor/punit/c_collect.rb) : [ccollect, c-collect](c_collect.md) + * [Flor::Pro::Ceach](https://github.com/floraison/flor/blob/master/lib/flor/punit/c_each.rb) : ceach, c-each + * [Flor::Pro::Collect](https://github.com/floraison/flor/blob/master/lib/flor/pcore/collect.rb) : [collect](collect.md) + * [Flor::Pro::Cron](https://github.com/floraison/flor/blob/master/lib/flor/punit/cron.rb) : [cron](cron.md) + * [Flor::Pro::Detect](https://github.com/floraison/flor/blob/master/lib/flor/pcore/detect.rb) : [detect](detect.md) * [Flor::Pro::DoReturn](https://github.com/floraison/flor/blob/master/lib/flor/pcore/do_return.rb) : [do-return](do_return.md) * [Flor::Pro::DoTrap](https://github.com/floraison/flor/blob/master/lib/flor/punit/do_trap.rb) : [do-trap](do_trap.md) + * [Flor::Pro::Each](https://github.com/floraison/flor/blob/master/lib/flor/pcore/each.rb) : [each](each.md) + * [Flor::Pro::Every](https://github.com/floraison/flor/blob/master/lib/flor/punit/every.rb) : [every](every.md) + * [Flor::Pro::Inject](https://github.com/floraison/flor/blob/master/lib/flor/pcore/inject.rb) : [inject](inject.md) * [Flor::Pro::On](https://github.com/floraison/flor/blob/master/lib/flor/pcore/on.rb) : [on](on.md) + * [Flor::Pro::Select](https://github.com/floraison/flor/blob/master/lib/flor/pcore/select.rb) : [select, reject](select.md) + * [Flor::Pro::All](https://github.com/floraison/flor/blob/master/lib/flor/pcore/all.rb) : [all?](all.md) * [Flor::Pro::Andor](https://github.com/floraison/flor/blob/master/lib/flor/pcore/andor.rb) : [and, or](andor.md) + * [Flor::Pro::Any](https://github.com/floraison/flor/blob/master/lib/flor/pcore/any.rb) : [any?](any.md) * [Flor::Pro::Apply](https://github.com/floraison/flor/blob/master/lib/flor/pcore/apply.rb) : [apply](apply.md) * [Flor::Pro::Arith](https://github.com/floraison/flor/blob/master/lib/flor/pcore/arith.rb) : +, -, *, /, % + * [Flor::Pro::Arr](https://github.com/floraison/flor/blob/master/lib/flor/pcore/_arr.rb) : [_arr](_arr.md) * [Flor::Pro::ArrayQmark](https://github.com/floraison/flor/blob/master/lib/flor/pcore/array_qmark.rb) : [array?, object?, boolean?, number?, string?, null?, list?, dict?, hash?, nil?, false?, true?, pair?, float?](array_qmark.md) * [Flor::Pro::Atom](https://github.com/floraison/flor/blob/master/lib/flor/pcore/_atom.rb) : _num, _boo, _sqs, _nul, _func * [Flor::Pro::Att](https://github.com/floraison/flor/blob/master/lib/flor/pcore/_att.rb) : _att @@ -98,33 +110,50 @@ * [Flor::Pro::Cancel](https://github.com/floraison/flor/blob/master/lib/flor/punit/cancel.rb) : [cancel, kill](cancel.md) * [Flor::Pro::Case](https://github.com/floraison/flor/blob/master/lib/flor/pcore/case.rb) : [case](case.md) * [Flor::Pro::Match](https://github.com/floraison/flor/blob/master/lib/flor/pcore/match.rb) : [match](matchr.md) + * [Flor::Pro::Ccollect](https://github.com/floraison/flor/blob/master/lib/flor/punit/c_collect.rb) : [ccollect, c-collect](c_collect.md) + * [Flor::Pro::Ceach](https://github.com/floraison/flor/blob/master/lib/flor/punit/c_each.rb) : ceach, c-each + * [Flor::Pro::CforEach](https://github.com/floraison/flor/blob/master/lib/flor/punit/c_for_each.rb) : [c-for-each](c_for_each.md) + * [Flor::Pro::Cmap](https://github.com/floraison/flor/blob/master/lib/flor/punit/c_map.rb) : [cmap, c-map](c_map.md) * [Flor::Pro::Cmp](https://github.com/floraison/flor/blob/master/lib/flor/pcore/cmp.rb) : =, ==, <, >, <=, >=, !=, <> * [Flor::Pro::Coll](https://github.com/floraison/flor/blob/master/lib/flor/pcore/_coll.rb) : * [Flor::Pro::Arr](https://github.com/floraison/flor/blob/master/lib/flor/pcore/_arr.rb) : [_arr](_arr.md) * [Flor::Pro::Obj](https://github.com/floraison/flor/blob/master/lib/flor/pcore/_obj.rb) : [_obj](_obj.md) + * [Flor::Pro::Collect](https://github.com/floraison/flor/blob/master/lib/flor/pcore/collect.rb) : [collect](collect.md) * [Flor::Pro::Concurrence](https://github.com/floraison/flor/blob/master/lib/flor/punit/concurrence.rb) : [concurrence](concurrence.md) * [Flor::Pro::ConcurrentIterator](https://github.com/floraison/flor/blob/master/lib/flor/punit/c_iterator.rb) : * [Flor::Pro::CforEach](https://github.com/floraison/flor/blob/master/lib/flor/punit/c_for_each.rb) : [c-for-each](c_for_each.md) * [Flor::Pro::Cmap](https://github.com/floraison/flor/blob/master/lib/flor/punit/c_map.rb) : [cmap, c-map](c_map.md) * [Flor::Pro::Cond](https://github.com/floraison/flor/blob/master/lib/flor/pcore/cond.rb) : [cond](cond.md) + * [Flor::Pro::Cron](https://github.com/floraison/flor/blob/master/lib/flor/punit/cron.rb) : [cron](cron.md) * [Flor::Pro::Cursor](https://github.com/floraison/flor/blob/master/lib/flor/pcore/cursor.rb) : [cursor](cursor.md) * [Flor::Pro::Loop](https://github.com/floraison/flor/blob/master/lib/flor/pcore/loop.rb) : [loop](loop.md) * [Flor::Pro::Define](https://github.com/floraison/flor/blob/master/lib/flor/pcore/define.rb) : [def, fun, define](define.md) + * [Flor::Pro::Detect](https://github.com/floraison/flor/blob/master/lib/flor/pcore/detect.rb) : [detect](detect.md) * [Flor::Pro::Dmute](https://github.com/floraison/flor/blob/master/lib/flor/pcore/_dmute.rb) : _dmute + * [Flor::Pro::DoReturn](https://github.com/floraison/flor/blob/master/lib/flor/pcore/do_return.rb) : [do-return](do_return.md) + * [Flor::Pro::DoTrap](https://github.com/floraison/flor/blob/master/lib/flor/punit/do_trap.rb) : [do-trap](do_trap.md) * [Flor::Pro::Dol](https://github.com/floraison/flor/blob/master/lib/flor/pcore/_dol.rb) : _dol * [Flor::Pro::DoubleQuoteString](https://github.com/floraison/flor/blob/master/lib/flor/pcore/_dqs.rb) : _dqs * [Flor::Pro::Dump](https://github.com/floraison/flor/blob/master/lib/flor/pcore/_dump.rb) : _dump + * [Flor::Pro::Each](https://github.com/floraison/flor/blob/master/lib/flor/pcore/each.rb) : [each](each.md) * [Flor::Pro::Echo](https://github.com/floraison/flor/blob/master/lib/flor/pcore/echo.rb) : echo * [Flor::Pro::Empty](https://github.com/floraison/flor/blob/master/lib/flor/pcore/empty.rb) : [empty?](empty.md) * [Flor::Pro::Err](https://github.com/floraison/flor/blob/master/lib/flor/pcore/_err.rb) : _err + * [Flor::Pro::Every](https://github.com/floraison/flor/blob/master/lib/flor/punit/every.rb) : [every](every.md) * [Flor::Pro::Fail](https://github.com/floraison/flor/blob/master/lib/flor/pcore/fail.rb) : [fail, error](fail.md) + * [Flor::Pro::Filter](https://github.com/floraison/flor/blob/master/lib/flor/pcore/filter.rb) : [filter, filter-out](filter.md) + * [Flor::Pro::Find](https://github.com/floraison/flor/blob/master/lib/flor/pcore/find.rb) : [find](find.md) + * [Flor::Pro::Any](https://github.com/floraison/flor/blob/master/lib/flor/pcore/any.rb) : [any?](any.md) * [Flor::Pro::Flatten](https://github.com/floraison/flor/blob/master/lib/flor/pcore/flatten.rb) : [flatten](flatten.md) + * [Flor::Pro::ForEach](https://github.com/floraison/flor/blob/master/lib/flor/pcore/for_each.rb) : [for-each](for_each.md) * [Flor::Pro::Graft](https://github.com/floraison/flor/blob/master/lib/flor/punit/graft.rb) : [graft, import](graft.md) * [Flor::Pro::Head](https://github.com/floraison/flor/blob/master/lib/flor/pcore/_head.rb) : _head * [Flor::Pro::If](https://github.com/floraison/flor/blob/master/lib/flor/pcore/if.rb) : [if, unless, ife, unlesse, _if, _unless](if.md) * [Flor::Pro::Includes](https://github.com/floraison/flor/blob/master/lib/flor/pcore/includes.rb) : includes? + * [Flor::Pro::Inject](https://github.com/floraison/flor/blob/master/lib/flor/pcore/inject.rb) : [inject](inject.md) * [Flor::Pro::Iterator](https://github.com/floraison/flor/blob/master/lib/flor/pcore/iterator.rb) : * [Flor::Pro::All](https://github.com/floraison/flor/blob/master/lib/flor/pcore/all.rb) : [all?](all.md) + * [Flor::Pro::Any](https://github.com/floraison/flor/blob/master/lib/flor/pcore/any.rb) : [any?](any.md) * [Flor::Pro::Filter](https://github.com/floraison/flor/blob/master/lib/flor/pcore/filter.rb) : [filter, filter-out](filter.md) * [Flor::Pro::Find](https://github.com/floraison/flor/blob/master/lib/flor/pcore/find.rb) : [find](find.md) * [Flor::Pro::Any](https://github.com/floraison/flor/blob/master/lib/flor/pcore/any.rb) : [any?](any.md) @@ -134,6 +163,9 @@ * [Flor::Pro::SortBy](https://github.com/floraison/flor/blob/master/lib/flor/pcore/sort_by.rb) : [sort_by](sort_by.md) * [Flor::Pro::Keys](https://github.com/floraison/flor/blob/master/lib/flor/pcore/keys.rb) : [keys, values](keys.md) * [Flor::Pro::Length](https://github.com/floraison/flor/blob/master/lib/flor/pcore/length.rb) : [length, size](length.md) + * [Flor::Pro::Loop](https://github.com/floraison/flor/blob/master/lib/flor/pcore/loop.rb) : [loop](loop.md) + * [Flor::Pro::Map](https://github.com/floraison/flor/blob/master/lib/flor/pcore/map.rb) : [map](map.md) + * [Flor::Pro::Match](https://github.com/floraison/flor/blob/master/lib/flor/pcore/match.rb) : [match](matchr.md) * [Flor::Pro::Matchr](https://github.com/floraison/flor/blob/master/lib/flor/pcore/matchr.rb) : [matchr, match?, pmatch](matchr.md) * [Flor::Pro::Max](https://github.com/floraison/flor/blob/master/lib/flor/pcore/max.rb) : max, min * [Flor::Pro::Merge](https://github.com/floraison/flor/blob/master/lib/flor/pcore/merge.rb) : [merge](merge.md) @@ -141,24 +173,33 @@ * [Flor::Pro::NoEval](https://github.com/floraison/flor/blob/master/lib/flor/pcore/noeval.rb) : [noeval](noeval.md) * [Flor::Pro::NoRet](https://github.com/floraison/flor/blob/master/lib/flor/pcore/noret.rb) : [noret](noret.md) * [Flor::Pro::Not](https://github.com/floraison/flor/blob/master/lib/flor/pcore/not.rb) : [not](not.md) + * [Flor::Pro::Obj](https://github.com/floraison/flor/blob/master/lib/flor/pcore/_obj.rb) : [_obj](_obj.md) + * [Flor::Pro::On](https://github.com/floraison/flor/blob/master/lib/flor/pcore/on.rb) : [on](on.md) * [Flor::Pro::OnCancel](https://github.com/floraison/flor/blob/master/lib/flor/pcore/on_cancel.rb) : [on_cancel](on_cancel.md) * [Flor::Pro::OnError](https://github.com/floraison/flor/blob/master/lib/flor/pcore/on_error.rb) : [on_error](on_error.md) * [Flor::Pro::OnTimeout](https://github.com/floraison/flor/blob/master/lib/flor/punit/on_timeout.rb) : [on_timeout](on_timeout.md) * [Flor::Pro::Part](https://github.com/floraison/flor/blob/master/lib/flor/punit/part.rb) : part, flank + * [Flor::Pro::PatArr](https://github.com/floraison/flor/blob/master/lib/flor/pcore/_pat_arr.rb) : _pat_arr * [Flor::Pro::PatContainer](https://github.com/floraison/flor/blob/master/lib/flor/pcore/_pat_.rb) : * [Flor::Pro::PatArr](https://github.com/floraison/flor/blob/master/lib/flor/pcore/_pat_arr.rb) : _pat_arr * [Flor::Pro::PatGuard](https://github.com/floraison/flor/blob/master/lib/flor/pcore/_pat_guard.rb) : _pat_guard * [Flor::Pro::PatObj](https://github.com/floraison/flor/blob/master/lib/flor/pcore/_pat_obj.rb) : _pat_obj * [Flor::Pro::PatOr](https://github.com/floraison/flor/blob/master/lib/flor/pcore/_pat_or.rb) : _pat_or * [Flor::Pro::PatRegex](https://github.com/floraison/flor/blob/master/lib/flor/pcore/_pat_regex.rb) : _pat_regex + * [Flor::Pro::PatGuard](https://github.com/floraison/flor/blob/master/lib/flor/pcore/_pat_guard.rb) : _pat_guard + * [Flor::Pro::PatObj](https://github.com/floraison/flor/blob/master/lib/flor/pcore/_pat_obj.rb) : _pat_obj + * [Flor::Pro::PatOr](https://github.com/floraison/flor/blob/master/lib/flor/pcore/_pat_or.rb) : _pat_or + * [Flor::Pro::PatRegex](https://github.com/floraison/flor/blob/master/lib/flor/pcore/_pat_regex.rb) : _pat_regex * [Flor::Pro::Push](https://github.com/floraison/flor/blob/master/lib/flor/pcore/push.rb) : [push, pushr](push.md) * [Flor::Pro::Rand](https://github.com/floraison/flor/blob/master/lib/flor/pcore/rand.rb) : [rand](rand.md) * [Flor::Pro::Range](https://github.com/floraison/flor/blob/master/lib/flor/pcore/range.rb) : [range](range.md) + * [Flor::Pro::Reduce](https://github.com/floraison/flor/blob/master/lib/flor/pcore/reduce.rb) : [reduce](reduce.md) * [Flor::Pro::Ref](https://github.com/floraison/flor/blob/master/lib/flor/pcore/_ref.rb) : _ref, _rep, _reff * [Flor::Pro::RegularExpressionString](https://github.com/floraison/flor/blob/master/lib/flor/pcore/_rxs.rb) : _rxs * [Flor::Pro::Return](https://github.com/floraison/flor/blob/master/lib/flor/pcore/return.rb) : return * [Flor::Pro::Reverse](https://github.com/floraison/flor/blob/master/lib/flor/pcore/reverse.rb) : [reverse](reverse.md) * [Flor::Pro::Schedule](https://github.com/floraison/flor/blob/master/lib/flor/punit/schedule.rb) : [schedule](schedule.md) + * [Flor::Pro::Select](https://github.com/floraison/flor/blob/master/lib/flor/pcore/select.rb) : [select, reject](select.md) * [Flor::Pro::Sequence](https://github.com/floraison/flor/blob/master/lib/flor/pcore/sequence.rb) : [sequence, begin](sequence.md) * [Flor::Pro::Set](https://github.com/floraison/flor/blob/master/lib/flor/pcore/set.rb) : [set, setr](set.md) * [Flor::Pro::Shuffle](https://github.com/floraison/flor/blob/master/lib/flor/pcore/shuffle.rb) : [shuffle, sample](shuffle.md) @@ -167,6 +208,7 @@ * [Flor::Pro::Sleep](https://github.com/floraison/flor/blob/master/lib/flor/punit/sleep.rb) : [sleep](sleep.md) * [Flor::Pro::Slice](https://github.com/floraison/flor/blob/master/lib/flor/pcore/slice.rb) : [slice, index](slice.md) * [Flor::Pro::Sort](https://github.com/floraison/flor/blob/master/lib/flor/pcore/sort.rb) : [sort](sort.md) + * [Flor::Pro::SortBy](https://github.com/floraison/flor/blob/master/lib/flor/pcore/sort_by.rb) : [sort_by](sort_by.md) * [Flor::Pro::Split](https://github.com/floraison/flor/blob/master/lib/flor/pcore/split.rb) : split * [Flor::Pro::Stall](https://github.com/floraison/flor/blob/master/lib/flor/pcore/stall.rb) : [stall](stall.md) * [Flor::Pro::Strings](https://github.com/floraison/flor/blob/master/lib/flor/pcore/strings.rb) : [downcase, lowercase, lowcase, upcase, uppercase, capitalize, trim, strip, snakecase, snake_case, camelcase, camelCase](strings.md) diff --git a/mak/ptree.rb b/mak/ptree.rb index 056e8acf..909e0f95 100644 --- a/mak/ptree.rb +++ b/mak/ptree.rb @@ -19,14 +19,14 @@ h } INDEX .each { |k, v| - a = v[:ancestors][1] - a = INDEX[a] - next unless a - (a[:children] ||= []) << k } - + v[:ancestors][1..-1].each { |a| + a = INDEX[a] + next unless a + (a[:children] ||= []) << k } } Dir['lib/flor/{pcore,punit}/*.rb'] .each { |path| m = File.read(path).match(/^class (Flor::.+) < /) + next unless m k = Flor.const_lookup(m[1]) INDEX[k][:spath] = path } Dir['doc/procedures/*.md'] @@ -60,5 +60,6 @@ def render(level, klass) .sort_by { |c| c.to_s } .each { |c| render(level + 1, c) } end + render(0, Flor::Procedure)