This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |