📜 ⬆️ ⬇️

Embedded custom blog engines for Ruby on Rails

Sometimes it seems to me that there is a damned place in the Ruby on Rails ecosystem: embedded blogging engines. This is especially nice to see in the light of the endless screencast of “Rails Blog in 10 Minutes”.

Apparently, any attempt to create any solution for blogs in the form of a plug-in leads, as a rule, to one of two outcomes: either the person is tired of this work and he leaves to do more pressing things, or the engine turns into a monster that can eat any Rails application before it is initialized.

Some time ago, when I worked at ABAK-PRESS, the management ordered to add a very fashionable feature to the cute site LookMart.ru - user blogs (at the moment this functionality is in active development). The last thing we wanted was to reinvent the wheel and fence the obvious cars from the controllers with the models, but after a bit of intelligence, we had to accept and do everything on our own. Why?

Because we did not find a suitable solution, alas. The main restrictions were imposed by the formulation of the problem and the features of the code base of our portal:
The world is small. One of the most prominent existing solutions will probably come in handy for someone, and this article will help reduce the cost of exploration.
')

Description of analogues


Governor

Governor is a plugin for Ruby on Rails 3.0 that makes it possible to incorporate blogging functionality into a Web application virtually painless.

The plugin is completely covered with tests using RSpec and has a minimum of runtime dependencies: just ActiveRecord and will_paginate. Authentication and authorization methods of users are specified by overriding the corresponding helpers.

It is a bit annoying that the last commit was dated November 27th last year, and support for Rails 3.1 has not yet been announced.

Locomotive

In the Ruby on Rails ecosystem, “combines” like Locomotive have a certain popularity, which can be embedded in a Web application in a completely trivial way (like an engine ) and used to build user blogs.

There is a question of the feasibility of embedding such solutions: these CMS can do too much. The functionality implemented in them can, at best, duplicate existing practices and sometimes spoil the architectural idyll. Not every person is willing to accept it.

The popularity of these solutions affects both the pace of development of projects and the quality of code coverage tests. Do not forget that Locomotive uses only MongoDB, which may not suit everyone.

Kublog

There is also a more modern analogue of the Governor- Kublog engine .

Kublog is very similar to Governor in its essence, however, it is designed for somewhat more “modern” tools: Ruby on Rails ≥ 3.1 and carrierware (analogue to paperclip).

Judging by the fact that the last commit is dated November 21, 2011, and only to the partial presence of tests for the code, there is a hypothesis that there is a certain relationship between the number of blog plug-ins for Rails and the time of year.

Despite the low intensity of development and virtually no interest in the project from the community, it is used by the developer in production and probably shows very good results.

Jabe

The embedded JABE engine appeared relatively recently and already now has a number of dependencies comparable to a good CMS: Rails ≥ 3.1, ActiveRecord, kaminari, devise, simple_form, and so on.

The test coverage is missing as a fact, despite the very respectable version 0.7.0, to which the engine was able to grow from December last year.

Summary table

AnalogLightnessPopularityRestrictionsTest coverage
GovernorYes83 watchers, 5 forks, last commit at 11/27/2011ActiveRecordthe good
Locomotivenot947 watchers, 218 forks, last commit at 02/09/2012mongoidthe good
KublogYes3 watchers, 1 fork, last commit at 11/21/2011ActiveRecordthe average
JabeYes14 watchers, 3 forks, last commit at 02.02.2012ActiveRecordnot
Thus, I want to ask a rhetorical question: is the original task really so irrelevant to the Ruby on Rails community that no one publicly tries to solve it?

I dare to suggest that the task is relevant though, but when developing a blog engine, there are always clarifying requirements, which is why making a solution for (user) blogs on rails in general terms - Sisyphean labor.

Source: https://habr.com/ru/post/138055/


All Articles