Skip to content

Instantly share code, notes, and snippets.

@michaeledgar
michaeledgar / gist:4462675
Last active December 10, 2015 16:39 — forked from seydar/gist:4462672
Chitin is a general-purpose shell. Chitin is not bash, nor ksh, zsh, nor any *sh. Chitin is Ruby. Everything you type is Ruby and everything works in pure Ruby. This makes doing programmatic things in the shell natural and not arcane, without bash's baggage and stagnation. Ever forget bash for-loop syntax? Use .each!
Recent Ruby-themed variations on shells either rely on another existing shell or don't lend themselves to immediate interactive use. Chitin has no dependencies apart from Ruby and any irb user will feel at home with Chitin during day-to-day shell work.
We’ll talk about all the parts involved in loading programs, piping, and the challenges in extracting a bash-like syntax from Ruby — it will be a fun dive into Ruby and Unix.
server = DSLServer.new do |root|
root.menu('Blog/') do |blog_menu|
BlogPost.public.all.each do |post|
blog_menu.item(post.title) { post.body }
end
end
root.menu('Projects/') do |project_menu|
Project.all.each do |proj|
project_menu.item(proj.title) { proj.readme }
end