What is the best ruby ​​api for git?

I would like to implement the Rake task, which automates some of the tasks that I have to complete in order to transfer my changes from development to production (and yes, I know that there is something like Capistrano, and that is too much for me). There are some interactive commands in the center, such as git add -i and a series of commit and click. On the production side, transfers and assets will be completed.

It’s quite tedious to enter all the same commands, so I would like to fully automate it. I did not find the Ruby API for Git.

It should work under Windows 7 and allow at least the following commands: git add , git status , git commit , git push , git pull .

+6
source share
3 answers

This one seems pretty popular. If you're more interested in GitHub, you can check out this one .

UPDATE:

Rugged seems to be the newest of them, although Gem , since it was not created after a while. It is best to use a source from Github.

+5
source

I know a bad habit, but I would like to capture the experience of this weekend:

  • At https://softwareengineering.stackexchange.com/questions/62843/best-ruby-git-library there is a similar question that names 3 relevant candidates: Git , Grit and Rugged .
  • Git and Grit are not yet developed; Rugged is currently developed, but not completed.
  • Git works out of the box, but has some disadvantages:
    • Known weaknesses (see issues ).
    • I had a problem that the added and changed elements do not correspond to each other, they can only be in one of two states (which currently does not apply to Git).
    • The API is reasonable and works well in the console, Ruby script or Rake task.
  • Grit did not work for me at all, and I did not find a reason. I got a stack trace (low level) and tried several patches that may be relevant for use in Windows 7, but without success.
  • Rugged could not be installed for me, so I filed a bug in rugged, which got some feedback. The problem is that it only works for POSIX systems, so it does not compile with DevKit for Ruby.

Therefore, I will try to find a compiled version of libgit2.dll for Windows 7 and try to use it. I did this in the past with sqlite3.dll , so maybe this is the best attempt. For me, lasting is the most reasonable solution, because there are people behind this project, they are interested in providing a solution that works on a cross-platform.

+10
source

July 2013 update:

Rugged seems to be the tool of choice for now. It is actively maintained, and it seems that most (all) of the main committers work on github.

Even if grit is the most popular and created by one of the founders of github, he was not touched for 5 months and had little activity.

See the Ruby-Toolbox for more details.

+1
source

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


All Articles