wander
Version, currently master branch1 version
- master branchlatestMar 6, 2020
github.com/russ/wander
Maybe a Router?
Installation
# Add this to your shard.yml
dependencies:
wander:
github: russ/wander
branch: mastermaster is a branch, not a release, so this tracks it rather than pinning a version.
Then run:
shards installshard.yml
- Crystal
0.33.0- License
- MIT
- Author
- Russ Smith
Dependencies
This version declares no dependencies.
README
wander
TODO: Write a description here
Installation
-
Add the dependency to your
shard.yml:dependencies: wander: github: russ/wander -
Run
shards install
Usage
require "wander"
TODO: Write usage instructions here
Development
TODO: Write development instructions here
Contributing
- Fork it (https://github.com/russ/wander/fork)
- Create your feature branch (
git checkout -b my-new-feature) - Commit your changes (
git commit -am 'Add some feature') - Push to the branch (
git push origin my-new-feature) - Create a new Pull Request
Contributors
- Russ Smith - creator and maintainer
class Visitor
def accept(node, seed)
visit(node, seed)
end
def visit(node, seed)
seed.call(node.not_nil!) unless node.nil?
if node.not_nil!.left
visit(node.not_nil!.left, seed)
end
end
end
class Each < Visitor
def visit(node, &block)
block.call(node)
super
end
INSTANCE = new
end
class Node
property name : String
property left : Node?
def initialize(@name)
@left = nil
end
def initialize(@name, @left)
end
def each(&block : Node -> _)
Each::INSTANCE.accept(self, block)
end
end
Node.new("outer", Node.new("inner")).each do |node|
puts node.name
end
#<Journey::GTG::TransitionTable:0x00005597ddc4a458 @accepting={2=>true, 3=>true}, @memos= {2=> [#<Journey::Nodes::Cat:0x00005597ddc34310 @left= #<Journey::Nodes::Slash:0x00005597ddc345e0 @left="/", @memo=#<Journey::Nodes::Cat:0x00005597ddc34310 ...>>, @memo=#<Journey::Nodes::Cat:0x00005597ddc34310 ...>, @right= #<Journey::Nodes::Literal:0x00005597ddc34388 @left="foo", @memo=#<Journey::Nodes::Cat:0x00005597ddc34310 ...>>>], 3=> [#<Journey::Nodes::Cat:0x00005597ddc4b7b8 @left= #<Journey::Nodes::Slash:0x00005597ddc4b920 @left="/", @memo=#<Journey::Nodes::Cat:0x00005597ddc4b7b8 ...>>, @memo=#<Journey::Nodes::Cat:0x00005597ddc4b7b8 ...>, @right= #<Journey::Nodes::Literal:0x00005597ddc4b808 @left="bar", @memo=#<Journey::Nodes::Cat:0x00005597ddc4b7b8 ...>>>]}, @regexp_states={}, @string_states={0=>{"/"=>1}, 1=>{"foo"=>2, "bar"=>3}}>
Documentation
Built from the current release. The first visit to a release nobody has asked for starts its build.
Links
This branch
- Branch
master- Seen
- Mar 6, 2020
- Crystal
0.33.0- Indexed
- yes
Dependents
No indexed shard depends on this one yet.
Repository
github.com/russ/wander
Metadata
- Created
- Aug 12, 2026
- Updated
- Aug 12, 2026
- Synced
- Aug 12, 2026
- Versions
- 1