Using ruby ​​to automate tasks

I would like to study some scenarios to help automate some common tasks. Is ruby ​​a good language to learn and what gems will be useful?

I would like to make scripts look like this bash script

http://nikhgupta.com/code/initialize-gitolite-bash-script/

Which automates the configuration of the new gitolite repository.

You would recognize bash, sed grep, etc.

+4
source share
3 answers

Sounds like work for Ruby and Rake! Check this one . In my opinion, Python and Ruby are the best languages ​​out there when it comes to automating tasks on * NIX systems. Being a Windows buff, I'll stick with PowerShell ..

+3
source

Linux / Unix administration requires good scripting skills. For more advanced automation, it is also useful to know python, perl, or ruby. No matter what you choose. Once you master one, you will find that raising the rest to be an easy task.

Personally, the ruby ​​package management system (gems) has always been disconnected from using it from the scripting platform. Others have different opinions and love it.

Pick one and dive.

0
source

A few years ago, I would recommend using PERL for such things. In my opinion, it is always useful to have a basic knowledge of shell scripts, but if you really want to do something more, use a script language (like Python, Ruby or Perl).

So far I see no reason not to use ruby ​​for such things. I really like this language, and you can do everything (?), What could you do in PERL in ruby ​​(and you will have a real OO language at hand).

CPAN , on the other hand, is a pretty nice argument for PERL. Ruby stones are similar, but I don’t think there are such gems as the available CPAN modules. But please compare yourself ( http://rubygems.org/ ).

0
source

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


All Articles