Posts about Ruby
-
Kernel#send Should Be Removed
Opinion:
Kernel#send
should be deprecated and removed from future rubies.send
always felt weird when I was an active ruby developer but I have never seen any strong criticisms on it. It's either an attack on all family of send-like calls or a fierce defence that "usingsend
is not a bad practice". Only some style guides argue againstsend
because it may overlap with existing methods. This post was written after reading one of defences. -
Fix AsciiDoc Display in Gitea
After installing my own Gitea I looked for the support for the markups I use. Gitea has support for external markup renderers and the official doc lists configs for both reStructuredText and AsciiDoc:
-
journald-native and journald-logger Transferred to the Foreman
Yesterday I moved two of my ruby gems, journald-native and journald-logger, to
theforeman
GitHub namepace. Developing them further is out of my current professional interest and hopefully the Foreman project will be a good home for them.It's hard to say farewell however to the most popular library I created so far :D (8 GitHub stars, 57000 downloads)
-
Embracing CommonMark as the One True Markdown
As you may know, CommonMark is a project aiming to create unified and unambiguous Markdown syntax specification. So, I'm in. I want to spread the word and even use it in my own blog.
The trouble number one is that Jekyll uses kramdown by default. So we find a gem and the gem is jekyll-commonmark. Oh hell, we lost syntax highlighting :(
The trouble number two is that CommonMark standard lacks support for server side syntax highlighting. That's bad, I don't want any JavaScript on my static pages. Let's try to wrap it somehow and enable syntax highligting.
The strong side of Ruby CommonMark implementation, CommonMarker is its ability to parse a document to the abstract syntax tree, so let's use it to extract our blocks and highlight them with Rouge for example.
-
How to work with Ruby strings in C extensions
The Problem
That's about string types in C and Ruby. As you may know, C uses null-terminated strings while Ruby uses more sophisticated string type, therefore C strings cannot contain null byte while Ruby strings can. Many Ruby gems are written in C but what happens when you convert Ruby string to the C string?
-
When does journald-native work better?
There is already a nice gem called
systemd-journal
, why another one? Well, because there are some edge cases that it does not cover. I had a trouble with one.