Michal Čihař - Weblate hook at Github

Weblate hook at Github

Github now provides native hook for Weblate. This means that all you need to do to link these two together is to enter URL of your Weblate installation and you are done.

This was actually my first code in Ruby and I don't think I will start to like it, Python still looks nicer to me :-). However it was not that hard as I expected and I've even contribute (simple) testcase for this service.

Comments

wrote on Nov. 20, 2012, 2:17 p.m.

Just a small tip from a Rubyst :)

For simple if/unless logic you can post-fix the condition:

if url.empty?
raise_config_error "Invalid URL: #{url.inspect}"
end

could become:

raise_config_error "Invalid URL: #{url.inspect}" if url.empty?

Also, since Ruby 1.9 (I'm not sure what github-services is targetting), you can use "payload: payload.to_json" instead of ":payload => payload.to_json".

I hope you enjoy writing more Ruby code :) I never had the need to try out Python so I can't judge it, but I find Ruby a very pleasant language :)

wrote on Nov. 20, 2012, 3:04 p.m.

How about proposing the opensuse guys to replace vertaal with weblate? :D

wrote on Nov. 20, 2012, 3:38 p.m.

@Rodrigo: Well the Ruby code was mostly stolen from examples and other services, I really did not pay much attention in choosing the best way to do something :-).

@Theo: Virtaal is desktop application, while Weblate is web based, what I think makes it quite different...