Getting Started with Mastodon Hacking


#1

I have spun up a Mastodon instance with an eye towards implementing a few things on my slowly-growing list of feature ideas. I’ve been able to do some simple things, but this is the first time I’ve ever touched Ruby and its software ecosystem, and it looks pretty damn alien to someone who’s mostly used to tweaking around C-likes.

Would anyone like to suggest recommended reading? Intros to Ruby, intros to the particular flavor of Ruby used on Rails (I seem to recall hearing that Rails has a highly idiomatic style), intros to… man, I dunno, this is just such a huge pile of tools written on tools that just trying to list all the stuff I slightly recognize when searching around the codebase would be a mammoth undertaking.


#2

Here is something that worked for me: I have started writing Ruby for tests first (RSpec http://rspec.info/ is a domain-specific language built in Ruby) and did some programming for Chef. Whenever I am confused about the Mastodon codebase I refer to the testsuite to understand what a particular piece of code should do.

I find Ruby very easy to jump into and start writing in even without fully “knowing” the language. (I also come with extensive C/Java/etc. background but I do also a lot of Python/UNIX shell/Perl/whatever scripting).

Maybe starting with RSpec could be good for you as well. Next stop would probably be Rails, but I somehow get by with a cursory knowledge and looking up the documentation on demand when needed.