问题
I've recently started working on a project that uses git for storage and ruby as a front-end. The first version of my script used ruby-git, which was ok though pretty simple. When I needed to do more specific work with my commits and logs it was recommended that I move to grit. However, I've a road block early on- grit seems incapable of cloning remote repositories. All examples I've found using the Repository class create a local repository and searching through the source I've found Grit's clone method is undefined. What gives?
This is my first StackOverflow question, so thanks in advance for any help.
回答1:
Since Git is well structured, Grit uses a method missing (Grit::Git#method_missing) to 'systematically' execute Git commands.
See link below for an example that should help you.
https://gist.github.com/731502
来源:https://stackoverflow.com/questions/4370628/grits-clone-method-is-undefined